bioRxiv · 10.64898/2026.11.19.767809
SNP2Cluster-Py: A pathogen-agnostic, context-aware framework for Core SNP and transmission-cluster analysis
Abstract
Whole-genome sequencing enables high-resolution identification of genetically related pathogen isolates, but genomic similarity alone does not establish epidemiologically meaningful transmission. We developed SNP2Cluster-Py, an open-source Python framework that separates context-aware Core SNP clustering from the subsequent application of epidemiological and temporal criteria. The software accepts a precomputed pairwise Core SNP-distance matrix and user-configured metadata and supports analysis of all eligible isolates in a single context, as well as sequence-type, geographical, epidemiological and ordered composite contexts. Within each context, authoritative Core clusters are defined as connected components of an SNP-threshold graph; K-means assignments and silhouette widths are retained as exploratory diagnostics only. We evaluated the workflow using 172 Klebsiella pneumoniae isolates from six neonatal-surveillance hospitals in South Africa, a focused 36-isolate single-hospital subset from the same surveillance dataset, and 168 Streptococcus pneumoniae carriage isolates from Ghana. In the full K. pneumoniae dataset, ST-only analysis assigned 141 isolates to Core SNP clusters, whereas Facility + ST analysis assigned 134, demonstrating how facility stratification can remove cross-facility genomic connections. In the single-hospital subset, both contexts assigned 30 of 36 isolates to five Core clusters, and Facility analysis retained 23 isolates in four temporally compatible clusters. In the pneumococcal dataset, ST-context analysis assigned 114 isolates to 38 Core clusters, which were characterised across sampling locations and time through Community analysis. SNP2Cluster-Py therefore provides a reproducible framework for adapting genomic clustering to specific surveillance questions while maintaining a clear distinction between genomic relatedness, analytically inferred transmission clusters and confirmed direct transmission. SNP2Cluster-Py v1.1.2 is available under the Apache License 2.0 through GitHub and Zenodo.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Kwenda, S., Christoffels, A.. 2026-11-20. SNP2Cluster-Py: A pathogen-agnostic, context-aware framework for Core SNP and transmission-cluster analysis. https://doi.org/10.64898/2026.11.19.767809. https://searchbiorxiv.org/record/biorxiv%3A10.64898%2F2026.11.19.767809/snp2cluster-py-a-pathogen-agnostic-context-aware-framework-for-core-snp-and-transmission-cluster-ana
Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite Search bioRxiv by Indiciae: BibTeX · RIS.