Abstract / Summary
Whole-genome sequencing (WGS) is the gold standard for bacterial pathogen surveillance, where transmission is commonly inferred by calculating pairwise single nucleotide polymorphisms (SNPs) and applying a fixed threshold below which two genomes are considered the ''same'' strain. Such cutoffs are largely arbitrary. The relationship between genetic distance and epidemiological linkage varies with sample size, sampling duration, setting, and patterns of infection and carriage. A threshold calibrated in one study may not transfer to another. To address this, we present THRESHER, a pipeline that infers data-driven phylothresholds directly from each dataset's genomic structure. THRESHER implements four endpoint methods, plateau, public, peak, and discrepancy, with each reflecting a distinct hypothesis about what constitutes the ''sameness'' of a strain. Across 55 published datasets spanning Staphylococcus aureus, Clostridioides difficile, and Klebsiella pneumoniae, THRESHER reproduced the originally reported strain compositions in smaller studies. In larger studies, where the two diverged, SNP distances and phylogenetic topology supported THRESHER's assignments. In simulated populations with known strain structure, THRESHER recovered transmission clusters with substantially higher sensitivity than fixed cutoffs while retaining high specificity.