This shiny app is designed to identify transmission clusters among neonatal sepsis bacterial isolates using genomic (genetic distance) and epidemiological (spatiotemporal) data.
Transmission Estimator is available as a web app at klebsiella.shinyapps.io/transmission_estimator
You may also run this tool locally on your computer. Follow these steps to clone the repository, set up the required environment, and run the Shiny app.
- Install and open RStudio on your machine
- Go to File > New Project > Version Control > Git
- Paste the repository URL (https://github.com/klebgenomics/transmission_estimator.git)
- Choose a location to save the project, and click Create Project
This project uses the renv package to manage package dependenciesand ensure that correct versions of packages are installed.
To install renv if it's not already installed, run:
install.packages("renv")
Then, use renv to install the packages specified in the renv.lock file:
renv::restore()
Once the dependencies are installed, you can run the app using the following command in the RStudio console:
shiny::runApp()
Alternatively, you can open the app.R file in the root of the repository, and simply click Run App at the top right of the script window.
Note: Adjust the view to fit your screen by pressing
Cmd+-/+on Mac orCtrl+-/+on Windows.
Two input files in TSV or CSV format are required.
-
Metadata file
Metadata file containing epidemiological and other information on the isolates. See sample metadata. Required columns include:id: Sample ID column. Values must match IDs in distance matrix fileYear: YYYY format, e.g., 2019Month: MM format, e.g., 10Day: DD format, e.g., 25Site: Site/location of isolation. Used by default as the spatial clustering variableCountry: Country of isolationST: Sequence type of the strain. This column is not used for clustering but is only used to group clusters in the plot.
-
Genetic distance matrix file
Pairwise genetic distance matrix. See sample matrix. This can be generated using Pathogenwatch.
This file must be in square matrix format with the first column labelled 'Name'.
Clusters are identified using single linkage clustering based on the clustering options / thresholds specified in the Clusters tab.
Clusters comprise isolates with sufficient genetic similarity (as specified with the genetic distance threshold) that were isolated within a given time frame (as specified with the temporal distance threshold) and in the same location (as specified with the spatial clustering variable, default: Site). Users may provide alternative columns like Ward, Unit, Hospital, etc. in the metadata file for use as the spatial clustering variable (adjustable in the Clusters tab).
The proportion of cases attributable to transmission is calculated by excluding a hypothetical index case per cluster.
Use the Sensitivity tab to explore the sensitivity of the transmission estimates to the choice of temporal and genetic distance thresholds.
If you use this tool, please cite:
- This repository using this DOI:
- The preprint: "Contribution of nosocomial transmission to Klebsiella pneumoniae neonatal sepsis in Africa and South Asia: a meta-analysis of infection clusters inferred from pathogen genomics and temporal data." Odih et al, 2025, MedRxiv. DOI: 10.1101/2025.11.15.25340095v1)