logo
pub fn complement(a: u8) -> u8
Expand description

Return complement of given RNA alphabet character (IUPAC alphabet supported).

Casing of input character is preserved, e.g. ua, but UA. All Ns and Zs remain as they are.

use bio::alphabets::rna;

assert_eq!(rna::complement(65), 85); // A → U
assert_eq!(rna::complement(103), 99); // g → c
assert_eq!(rna::complement(89), 82); // Y → R
assert_eq!(rna::complement(115), 115); // s → s
assert_eq!(rna::complement(78), 78); // N → N