Function bio::alphabets::rna::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"uAGg"b"cCUa". All Ns and Zs remain as they are.

use bio::alphabets::rna;

assert_eq!(rna::revcomp(b"ACGUN"), b"NACGU");
assert_eq!(rna::revcomp(b"GaUuaCA"), b"UGuaAuC");
assert_eq!(rna::revcomp(b"AGCUYRWSKMDVHBNZ"), b"ZNVDBHKMSWYRAGCU");