reverse_complement

Function reverse_complement 

Source
pub fn reverse_complement(seq: String) -> String
Expand description

Generate the reverse complement of a DNA sequence.

This function takes a DNA sequence as a String and returns its reverse complement. The reverse complement is generated by reversing the sequence and replacing each nucleotide with its complement (A<->T, C<->G).

§Arguments

  • seq - A DNA sequence as a String

§Returns

The reverse complement sequence as a String

§Example

use deepbiop_core::seq::reverse_complement;

let seq = String::from("ATCG");
let rev_comp = reverse_complement(seq);
assert_eq!(rev_comp, "CGAT");