logo
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"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");