This skill infers who-infected-whom in outbreaks using pathogen genomics. It covers SNP-cluster definition (snp-dists + Gubbins for bacteria; HIV-TRACE for HIV) with pathogen-specific thresholds and explicit population caveats, Bayesian who-infected-whom inference (outbreaker2 with contact data; TransPhylo from a dated tree; phybreak; BadTrIP / SCOTTI for mixed-strain), source attribution (Mather 2013 islandR framework), within-host diversity and transmission bottleneck estimation (Sobel Leonard 2017 beta-binomial), and the conceptual distinctions that surveillance teams routinely conflate: cluster vs WIWS vs source-attribution; generation interval vs serial interval; pairwise SNP distance vs epidemiological linkage. The decision-grade content is in the caveats: there is NO universal SNP cutoff for transmission, direction of transmission cannot be inferred from pairwise SNP alone, unsampled intermediates inflate apparent R_e, and Walker 2013 thresholds derived from UK low-transmission settings inflate apparent recent-transmission rates 2-5x in high-burden settings.
Distinct from phylodynamics (which owns R_e estimation from tree priors) and from pathogen-typing (which owns cluster definition without WIWS inference).
conda install -c bioconda snippy snp-dists gubbins iqtree treetime hiv-trace beast2
R -e "install.packages(c('TransPhylo', 'outbreaker2', 'phybreak', 'BactDating', 'ape', 'igraph', 'transcluster'), repos='https://cran.r-project.org')"
pip install pandas biopython
Tell the AI agent what transmission question to answer:
"Forty methicillin-resistant Staphylococcus aureus isolates from a 6-month ICU surveillance project with full contact-tracing data (ward histories, overlap dates). Build core-genome alignment via snippy-core; mask recombination via Gubbins on
core.full.aln; compute pairwise SNP distances via snp-dists; define clusters at Coll 2017 <=15 SNP threshold for hospital outbreaks. Then run outbreaker2 with the contact-tracing matrixctd, MRSA generation-time prior, and explicit sampling proportion. Report posterior WIWS with credibility, unsampled-case count, and joint generation-interval posterior. Compare cluster definitions from raw SNP threshold vs outbreaker2 -- where they disagree, trust outbreaker2."
"Eighty Mycobacterium tuberculosis isolates from a multi-year clinical cohort with suspected reactivation cases. Snippy + snippy-core + Gubbins; build a dated tree with BactDating (Poisson model, not mixedgamma); pass to TransPhylo with TB-tuned generation-time prior (w.scale = months); within-host effective population size prior
startNegfrom literature; sampling-time priorws.*. Run transcluster as a secondary check with TB-tuned SNP+time prior. Identify samples with implausibly early inferred transmission dates relative to clinical onset -- these are likely reactivations of years-old strains. Report transmission cluster membership AND reactivation flag per case."
"One hundred Salmonella Typhimurium DT104 isolates from a national outbreak; reference collections from poultry (n=300), cattle (n=250), pigs (n=150), human (n=400). Run Mather 2013 Science 341:1514 Bayesian source attribution framework via islandR. Report per-source posterior probability per query isolate. Caveat: source-attribution circularity -- the model reproduces the host distribution of training data unless explicitly corrected. Run a rarified-reference sensitivity analysis and report multiple scenarios."
"Two hundred HIV-1 pol sequences from a regional surveillance project; mixed subtype A and C from East / Southern Africa. Do NOT apply the US-CDC HIV-TRACE 1.5% threshold globally (subtype-B-tuned for MSM cohorts). Calibrate threshold per subtype against locally documented transmission pairs; if no local calibration exists, use the published subtype-specific threshold from UKHSA / ECDC and document the choice. Compare cluster definitions across subtype and discuss subtype-C diversity inflating cluster size at the US default."
"Ten household influenza A donor-recipient pairs with deep paired-end Illumina sequencing (>1000x median coverage). Call within-host minor variants with lofreq at MAF >=1%. Apply the Sobel Leonard 2017 J Virol 91:e00171-17 beta-binomial estimator to each pair to estimate transmission bottleneck size Nb. Report Nb posterior per pair; flag any pair with Nb >100 as inconsistent with the narrow-bottleneck literature (McCrone 2018 eLife 7:e35962 1-2 virions). Note that narrow bottleneck means consensus genomes are near-identical across transmission -- consensus-only transmission inference would lose this information."
"Thirty SARS-CoV-2 consensus sequences from a hospital outbreak; samples sequenced with mixed ARTIC primer schemes (some V3, some V4.1, some V5.3.2). Per-sample mask the dropout amplicons (V4.1 amplicons 64, 76, 88-90 in particular); compute pairwise SNP distance only on positions called in ALL samples; warn that primer-scheme heterogeneity makes naive cross-sample comparison invalid. Note that SARS-CoV-2 cluster definition is NOT defined by SNP alone; combine 0-2 SNPs + epi link + sampling window (Lythgoe 2021)."
outbreaker_data(... ctd=contact_matrix) and create_config(n_iter=N).w_dens encodes generation-interval or serial-interval; sampling proportion; primer scheme version per isolate (for amplicon surveillance).pi parameter or TransPhylo / SCOTTI model this explicitly.create_config(n_iter=N), NOT as iters to outbreaker().w.* is generation-time Gamma prior; ws.* is sampling-time Gamma prior. Both must match the pathogen's biology.