pub fn revcomp<C, T>(text: T) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
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 N
s 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");