parse_erm41_lof_snps

Function parse_erm41_lof_snps 

Source
fn parse_erm41_lof_snps(
    csv: &str,
    refseq: &[u8],
) -> BTreeMap<usize, (u8, BTreeMap<u8, (String, Option<String>)>)>
Expand description

Parse loss-of-function SNPs for erm(41) from a ntm-db resistance CSV.

Returns a map keyed by 0-based nucleotide position in the erm(41) reference sequence. Each value is a tuple:

  • .0 — the wild-type base at that position (u8 ASCII, e.g. b'A')
  • .1lof_alts: a map from alternative base (u8 ASCII) to a (mutation_label, drug) pair, where mutation_label is the HGVS protein annotation (e.g. "p.Trp28*") and drug is the affected drug (None if absent in the CSV, interpreted as susceptible). Only single-nucleotide substitutions that produce the annotated LoF amino-acid change (stop codon or annotated replacement) are included; synonymous changes are skipped.