Claude
Skills
Sign in
Back

bio-epidemiological-genomics-pathogen-typing

Included with Lifetime
$97 forever

Assigns isolate identity at the right resolution for the question -- ANI / Mash species triage, 7-locus MLST historical comparability, cgMLST / wgMLST outbreak resolution (chewBBACA, BIGSdb, Ridom SeqSphere, EnteroBase HierCC), in-silico serotyping (SISTR, SeqSero2 for Salmonella; SerotypeFinder for E. coli; Kaptive K/O for Klebsiella; SeroBA for pneumococcus; spa + SCCmec for S. aureus), and lineage callers (TB-Profiler / Mykrobe Coll-Napier barcode for MTBC, Pangolin + Nextclade for SARS-CoV-2, PopPUNK GPSC for S. pneumoniae). Use when typing bacterial isolates for surveillance or outbreak investigation, choosing between cgMLST allele distance and core-SNP distance for cluster definition, harmonising calls across schemas / database versions (chewBBACA vs Ridom vs EnteroBase), assigning MTBC lineage with the Napier 2020 90-SNP barcode, calling Salmonella serovar via SISTR with monophasic Typhimurium awareness, running Pangolin UShER mode with explicit pangolin-data version pinning, or selecting a typing resolution to match the surveillance question.

General

What this skill does


## Version Compatibility

Reference examples tested with: mlst 2.23+, chewBBACA 3.3+, SISTR 1.1+, SeqSero2 1.3+, SerotypeFinder 2.0+, Kleborate 3.0+, Kaptive 3.0+, SeroBA 1.0+, PopPUNK 2.7+, pangolin 4.3+ (pangolin-data 1.30+), nextclade 3.8+, tb-profiler 6.2+, mykrobe 0.13+, mash 2.3+, skani 0.2+, snippy 4.6+, snp-dists 0.8+, pandas 2.2+, BioPython 1.84+.

Before using code patterns, verify installed versions match. If versions differ:
- Python: `pip show <package>` then `help(module.function)` to check signatures
- R: `packageVersion('<pkg>')` then `?function_name`
- CLI: `<tool> --version` then `<tool> --help` to confirm flags
- Pangolin: `pangolin --all-versions` records pangolin + pangolin-data + scorpio + constellations
- Nextclade dataset: `nextclade dataset list --tag latest sars-cov-2`
- chewBBACA schema: schemas are versioned independently; record the schema source AND the schema-fetch date for any published call
- TB-Profiler bundled DB: `tb-profiler list_db` for the WHO catalogue edition currently bundled

If a tool reports an unexpected serovar / lineage / ST, the schema or barcode version is the first thing to check; introspect the installed package and database date before re-running.

# Pathogen Typing

**"What is this isolate, and is it the same as that one?"** -> Pick a typing resolution that matches the epidemiological question, then run the appropriate caller and report the call with explicit schema / database / lineage-barcode versions. Resolution mismatch is the single most common typing error -- using 7-locus MLST to investigate a 20-isolate outbreak (multiple unrelated isolates share an ST) and using cgMLST to track decade-long lineage trends (allele drift obscures the lineage signal) are equally wrong, in opposite directions.

- CLI: `mlst assembly.fa` -- 7-locus MLST via Seemann's mlst with PubMLST schemas
- CLI: `chewBBACA.py AlleleCall -i assemblies/ -g schema/ -o alleles/ --cpu 8` -- cgMLST allele profile
- CLI: `pangolin sequences.fasta --analysis-mode usher --all-versions` -- SARS-CoV-2 Pango lineage with version provenance
- CLI: `tb-profiler profile -1 r1.fq.gz -2 r2.fq.gz -p sample` -- MTBC lineage (Coll/Napier barcode) plus DR call
- Python: `pandas` + `snp-dists` for cluster definition with pathogen-specific thresholds

## The Single Most Important Modern Insight -- cgMLST and core-SNP distance answer different questions

cgMLST counts allele changes (one wobble within a 1-kb locus = 1 allelic difference, regardless of how many SNPs sit inside that allele) and is robust to small assembly artifacts; core-SNP counts every position and is sensitive to alignment / mapping artifacts but recovers higher resolution. The EFSA harmonised foodborne approach uses cgMLST for *Salmonella* / *Listeria* / *E. coli* (Salm cgMLST <=5 alleles = cluster; PulseNet *Listeria* <=4 alleles); UK / EU TB outbreak literature uses core-SNP with recombination masking (Walker 2013: <=12 SNPs = likely transmission; <=5 = recent). Mixing the two yields incompatible cluster definitions: the same 50-isolate outbreak under cgMLST may cluster as 1 group at threshold 5, under core-SNP as 3 groups at threshold 12. The output of pathogen-typing is not a single distance -- it is a distance metric, a threshold derived from a specific population, and a schema or reference version. All three must travel with the call.

## Algorithmic Taxonomy

| Method | Mechanism | Resolution | Strength | Fails when |
|--------|-----------|-----------|----------|------------|
| ANI / fastANI / skani | Pairwise nucleotide identity over orthologous regions | Species (>=95% ANI = same species) | Species-level QC; cross-genus is non-metric for Mash | Species below ~80% ANI; Mash distance violates triangle inequality |
| Mash (Ondov 2016 *Genome Biol* 17:132) | MinHash sketches; fast pairwise distances | Species triage | Seconds per pair; the rapid screening standard | Distance non-metric at low identity; ANI <80% unreliable |
| 7-locus MLST (Maiden 2013 *Nat Rev Microbiol* 11:728; Seemann mlst tool) | PubMLST allele lookup at 7 housekeeping loci | Sequence type | Historical comparability across decades | Insufficient resolution for outbreaks; multiple unrelated isolates may share ST |
| cgMLST (chewBBACA; BIGSdb; Ridom SeqSphere) | Allele lookup across ~1000-3000 core loci | Outbreak / multi-country surveillance | Allele-distance is robust to small mapping errors | Schema-version-dependent; cross-schema NON-comparable; missing-locus handling matters |
| wgMLST | Allele lookup across all genes including accessory | Highest typing resolution | Maximum resolution within schema | Even more schema-dependent than cgMLST |
| Core-SNP typing (snippy + snp-dists; Parsnp; Lyve-SET) | Reference-based SNP calling on core genome | Single-SNP resolution | Highest resolution; underlies most Mtb work | Reference-dependent; recombination must be masked for bacteria |
| HierCC (Zhou 2021 *Bioinformatics* 37:3645) | Hierarchical clustering on cgMLST at multiple thresholds (HC5, HC10, HC50, etc.) | Stable nomenclature across schema updates | Cross-schema-update stability for EnteroBase pathogens | Limited to EnteroBase organisms |
| PopPUNK GPSC (Lees 2019 *Genome Res* 29:304) | k-mer-based clustering with Gaussian mixture on core+accessory distance | Population cluster | Stable IDs across additions; scales to >100k genomes | Cluster membership of an individual isolate can shift as model is refined |
| Pangolin (O'Toole 2021 *Virus Evol* 7:veab064) | Phylogenetic placement (UShER) or ML classifier (pangoLEARN) | SARS-CoV-2 Pango lineage | Curated dynamic nomenclature; recombinant X-prefix designations | pangoLEARN deprecated mid-2023; lab-to-lab version skew silently flips lineage calls |
| Nextclade (Aksamentov 2021 *JOSS* 6:3773) | Reference-tree placement + clade calling + QC | Clade nomenclature + mutations + QC | Mutation reports + QC integrated; multi-pathogen datasets | Dataset version drift changes which mutations count as "lineage-defining" |
| TB-Profiler + Coll/Napier barcode (Phelan 2019; Coll 2014; Napier 2020) | Reference-based SNP call against H37Rv + barcode SNP set | MTBC lineage 1-9 + drug resistance | Integrated lineage + DST; supports Napier 90-SNP barcode covering lineages 7-9 | Pre-Napier 2020 barcodes miscall lineage 7-9 isolates |
| Mykrobe (Hunt 2019 *Wellcome Open Res* 4:191) | k-mer presence/absence panels | Species + AMR for TB / S. aureus / Salmonella | Fast; cross-check for TB-Profiler | Panel may lag WHO catalogue |
| SISTR (Yoshida 2016 *PLoS ONE* 11:e0147101) | cgMLST + ribosomal MLST + serovar inference | Salmonella serovar + antigenic formula | ~94% concordance with traditional sero-typing; monophasic-aware | Novel/rare serovars without reference panel; antigen-cluster regulatory mutations are silent |
| SeqSero2 (Zhang 2019 *AEM* 85:e01746-19) | k-mer + targeted-assembly for Salmonella | Salmonella serovar | Designed for low-coverage / fragmented data | Slightly different output schema than SISTR |
| SerotypeFinder (Joensen 2015 *J Clin Microbiol* 53:2410) | BLAST against O- and H-antigen biosynthesis genes | E. coli O:H | Standard for E. coli serotyping | Misses novel O / H types; fimH typing is separate |
| Kleborate + Kaptive (Lam 2021 *Nat Commun* 12:4188) | Integrated MLST + K/O typing + virulence (ICEKp / iuc / ybt / clb / iro) + AMR | Klebsiella surveillance | Hypervirulence vs classical distinction; K/O loci typed by Kaptive | Kaptive K-locus DB versioned; KL calls can flip between Kaptive v1 / v2 / v3 |
| spa + SCCmec (Harmsen 2003 *J Clin Microbiol* 41:5442; Kaya 2018 *mSphere* 3:e00612-17) | spa repeat-region typing + SCCmec cassette typing | S. aureus typing | Historical comparability; clinical surveillance | spa repeat array fragments at borderline read length; assembler-dependent |
| SeroBA (Epping 2018 *Microb Genom* 4:e000186) | k-mer-based serotyping from raw reads | S. pneumoniae serotype | 98% concordance; no assembly needed; runs on >=15

Related in General