Expand description
Return complement of given DNA alphabet character (IUPAC alphabet supported).
Casing of input character is preserved, e.g. t
→ a
, but T
→ A
.
All N
s remain as they are.
use bio::alphabets::dna;
assert_eq!(dna::complement(65), 84); // A → T
assert_eq!(dna::complement(99), 103); // c → g
assert_eq!(dna::complement(78), 78); // N → N
assert_eq!(dna::complement(89), 82); // Y → R
assert_eq!(dna::complement(115), 115); // s → s