Skip to main content

format_codons

Function format_codons 

Source
pub fn format_codons(
    ref_codon: &[u8; 3],
    alt_codon: &[u8; 3],
    changed_pos: u8,
) -> String
Expand description

Format ref/alt codons with VEP’s capitalization convention.

The changed base is uppercase; unchanged bases are lowercase. The two codons are separated by /.

§Arguments

  • ref_codon — Reference codon (3 uppercase ASCII bases)
  • alt_codon — Alternate codon (3 uppercase ASCII bases)
  • changed_pos — 0-based position of the changed base (0, 1, or 2)

§Examples

use vareffect::codon::format_codons;
assert_eq!(format_codons(b"CGT", b"TGT", 0), "Cgt/Tgt");
assert_eq!(format_codons(b"CGT", b"CAT", 1), "cGt/cAt");
assert_eq!(format_codons(b"CGT", b"CGA", 2), "cgT/cgA");