pub fn complement_dna(dna: Sequence) -> Sequence
Expand description

Complement DNA by reversing in the first step.

In the double helix, adenine (A) always bonds with Thymine (T), and cytosine (C) always bonds with guanine (G). To generate the complementary strand of the primary, a strand must be reversed and bases must be swapped: A-T and G-C.

Arguments

  • dna - DNA string to transcribe into RNA

Example

use biogarden::processing::transformers::complement_dna;
use biogarden::ds::sequence::Sequence;

let seq = Sequence::from("AAAACCCGGT");
let complement = Sequence::from("ACCGGGTTTT");

assert_eq!(complement_dna(seq), complement);