pub fn revcomp<C, T>(text: T) -> Vec<u8> ⓘ
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");