Module pnca

Module pnca 

Source

StructsΒ§

MutationRow πŸ”’
PncaSnpCall
PncaSusceptibilityCalls
All pncA susceptibility evidence for one sample, ready for UI display.

EnumsΒ§

PncaCallKind
One diagnostic pncA site: either a single nucleotide (promoter or coding) or a single codon.
PncaEvidence πŸ”’
What the read showed at one diagnostic pncA site, for is_susceptible_pnca.

ConstantsΒ§

AA3 πŸ”’
Standard 3-letter amino acid codes used by the WHO catalogue p. notation.
UPSTREAM_FLANK πŸ”’
Extra bases fetched upstream of the start codon when building pnca/pnca_h37rv.fasta (must match upstream_flank in res/sequences/sequences.toml’s pncA [[genome]] entry). HGVS c.-N positions are resolved against this flank.

StaticsΒ§

PNCA_RESISTANCE_SNPS πŸ”’

FunctionsΒ§

call_pnca_aa_snps πŸ”’
call_pnca_nt_snps πŸ”’
codon_at_ref_pos πŸ”’
Collect 3 consecutive non-deleted query bases at reference positions ref_pos..ref_pos+3. Returns None if the position is outside the aligned region or any of the 3 ref positions has a deletion in the query (consistent with the existing policy of skipping frameshifts).
codon_to_ref_idx πŸ”’
0-based index into REF_PNCA of the first base of a 1-based codon number.
identify_sequence_pnca
Database is REF_PNCA: the pncA CDS plus a 50bp upstream promoter flank for each M. tuberculosis complex member with a distinct sequence (H37Rv Rv2043c, bovis AF2122/97, canettii β€” see res/sequences/sequences.toml for the rest, including the bovis BCG Pasteur/africanum/mungi/orygis references that were tried and dropped as exact duplicates of one of these three), fetched from NCBI at build time (via fetch_sequences_from_toml() in build.rs).
is_susceptible_pnca
Returns Some(false) when any covered site’s allele matches a catalogued resistance- conferring alt at confidence rank < 2 (e.g. β€œAssoc w R”). Returns Some(true) only when every diagnostic site is covered and every observed allele is wildtype. Returns None whenever any site went uncovered, an uncatalogued variant was found, weak/uncertain resistance evidence was seen, or no diagnostic site was reached at all.
nt_pos_to_ref_idx πŸ”’
0-based index into REF_PNCA of a signed HGVS coding-sequence position. There is no c.0 β€” c.-1 sits immediately before c.1 (the A of the start codon).
parse_pnca_resistance_snps πŸ”’
Parses tbprofiler/mutations.csv, keeping only pncA rows whose mutation is a simple nucleotide substitution (c.POS[wt]>[alt], promoter or coding) or a single-codon amino acid substitution / nonsense call (p.WtNNNAlt / p.WtNNN*).
translate_codon πŸ”’
Translate a single codon to its 3-letter amino acid code ("*" for a stop codon). Returns None for incomplete codons or non-ACGT bytes.

Type AliasesΒ§

PncaAaSnpMap πŸ”’
Maps a 1-based codon number to (wt_aa, alts) where alts maps each resistance alt amino acid (3-letter code, or "*" for nonsense) to (drugs, WHO confidence label).
PncaNtSnpMap πŸ”’
Maps a signed HGVS coding-sequence position (negative = promoter, e.g. c.-11) to (wt_base, alts) where alts maps each resistance alt to (drugs, WHO confidence label).