Function bio::alphabets::dna::revcomp

source ·
pub fn revcomp<C, T>(text: T) -> Vec<u8> 
where C: Borrow<u8>, T: IntoIterator<Item = C>, T::IntoIter: DoubleEndedIterator,
Expand description

Calculate reverse complement of given text (IUPAC alphabet supported).

Casing of characters is preserved, e.g. b"NaCgT"b"aCgTN". All Ns remain as they are.

use bio::alphabets::dna;

assert_eq!(dna::revcomp(b"ACGTN"), b"NACGT");
assert_eq!(dna::revcomp(b"GaTtaCA"), b"TGtaAtC");
assert_eq!(dna::revcomp(b"AGCTYRWSKMDVHBN"), b"NVDBHKMSWYRAGCT");