Where did this isolate come from? Why I am building a One Health metadata tool
This post is about a question that keeps coming up with researchers working on ‘One Health’: where did this isolate actually come from? For many genomic analyses, that is a minor detail. For One Health questions, it is the whole point. I have started building a tool that does basic onehealth analysis in the beginning or at least helps with the initial steps, and this post explains the reasoning behind it. It is not a tutorial and I am building this with the help of Claude and sometimes Gemini or ChatGPT for secondary review or for testing. I have taken the requirements from some of the One Health papers I have read and from my own experience curating thousands of BioSample records by hand. It’s already online and you can find it onehealth. You are welcome to try it out and give feedback (I would really appreciate it), but please note that it is still in early development. My plan is to test this on more data and improve the rules and the tool over time. I will also be adding more features to it as I go along. Once I have a more stable version, I will make an initial release and write a proper tutorial.
Where this started: our IMP carbapenemase paper
Last year we published a genomic epidemiology study of IMP carbapenemases in Nature Communications (Vezina, Morampalli et al. 2025). We analysed 4,556 publicly available genomes collected between 1996 and 2023, carrying 52 blaIMP variants across 93 bacterial species. The genomes came from the NCBI Pathogen Detection isolate browser and GenBank, and the metadata came from each genome’s BioSample record.
I manually curated the data and worked on the analysis. Part of that work was a One Health analysis: did blaIMP genes move between human, animal and environmental reservoirs? To answer it, every genome had to be assigned to a source.
Most genomes were of human origin (4,051 of 4,556; 88.9%), followed by environmental (454; 10.0%) and animal (51; 1.1%). Nine could not be classified. Most environmental genomes (353 of 454) came from healthcare settings, at least 128 of them from hospital aquatic environments. After collapsing closely related genomes into clusters, 65 of 1,381 clusters (4.7%) spanned more than one source category. We also found at least 20 plasmids moving between sources, most often between clinical and environmental categories.
Two limitations we observed in our study. The first was that metadata “were frequently poorly curated, thus preventing discovery of additional non-clinical spread”. The second was that non-clinical sources are likely under-sampled. In other words, our One Health conclusions were only as good as the source labels, and those labels came from free text that I had read and categorised by hand.
What curating by hand made me notice
Curating thousands of BioSample records by hand is slow, but the slowness was not what bothered me most. Many of the decisions were judgement calls, and each one could shift a result:
- Is a hospital sink drain a human sample because the host field says Homo sapiens, or an environmental one because nobody swabbed a person?
- Does bare “clinical” mean a patient specimen or the clinical environment?
- What do you do with an empty field, “missing”, or “not collected”?
- What about a record where the organism name was typed into the isolation source?
In our paper, most environmental genomes came from healthcare settings, and the cross-source signal was mainly between clinical and environmental categories. That is exactly where these judgement calls sit. If hospital environmental samples are labelled human, the cross-source links disappear. If patient isolates are labelled as hospital environment, links appear that are not there. Someone repeating the analysis on a different dataset would have to make similar calls again, and could easily make them differently.
Reading how other studies handled it
For getting a better understanding of this problem, I also looked more closely at how other One Health genomic studies assigned sources and measured sharing between them:
- Pavia, Italy. Thorpe and colleagues sequenced 3,482 Klebsiella genomes from clinical, community, animal and environmental settings around one city over 17 months (Thorpe et al. 2022). They saw occasional transmission between clinical and non-clinical settings, and no genotypic or phenotypic evidence of carbapenem non-susceptibility outside the clinical environment.
- Norway. Hetland and colleagues analysed 3,255 K. pneumoniae species complex genomes from human, animal and marine sources collected over 20 years (Hetland et al. 2025). The populations were distinct but overlapping: 107 of 857 sublineages occurred in more than one niche. At a threshold of 22 SNPs, they counted 130 strain-sharing events within niches and only nine between niches.
- Nairobi, Kenya. Muloi and colleagues sequenced 1,338 Escherichia coli isolates from humans, livestock and wildlife in 99 households (Muloi et al. 2022). Sharing was structured by household and host type, and sharing between humans and animals was much less frequent than within each group.
- Vellore, India. Jacob and colleagues compared clinical, livestock and hospital sewage K. pneumoniae and found limited overlap of clones, resistance genes, virulence genes and plasmids between settings (Jacob et al. 2024).
The conclusions are broadly consistent with ours: sources overlap, but recent transmission happens mostly within a source. Links between sources are uncommon, and when they occur they matter.
Two differences stood out to me. First, these studies collected their own samples, so the source of each isolate was known from the sampling design. Our paper relied on public genomes, where the source had to be reconstructed from whatever the submitter wrote. Second, every study defined its sources differently. Pavia separated hospital disease, hospital carriage, the community, several animal species, water, soil and plants. Norway used human, animal and marine niches. Nairobi used humans, livestock birds, livestock mammals, wild birds and wild mammals. We used human, animal and environmental. Each grouping suits its study, but together they make comparison difficult.
The genomic thresholds differ too. Pavia reported results across 0 to 20 SNPs. Norway chose 22 SNPs with a data-driven cut-point. Nairobi used 10 or fewer cgMLST allele differences. We clustered genomes within 5 SNVs per Mb within the same lineage. A European survey of carbapenem-resistant K. pneumoniae found that about 21 SNPs best separated hospital clusters (David et al. 2019). None of these is wrong; they answer slightly different questions with different data. It does mean a result should be reported across a range of thresholds, not as a single number.
Why public metadata makes this hard
NCBI BioSample records describe the source in a few attributes. On paper, the definitions are clear. host is “the natural (as opposed to laboratory) host to the organism from which the sample was obtained”. isolation_source “describes the physical, environmental and/or local geographical source of the biological sample”. In practice, both are free text. When Gonçalves and Musen analysed 11.4 million sample records from NCBI BioSample and EBI BioSamples, they found that most field names and values were neither standardised nor controlled (Gonçalves & Musen 2019).
These are the kinds of values that need a decision:
isolation_source |
host |
What it seems to say | Why it needs care |
|---|---|---|---|
wound drainage |
Homo sapiens | A patient specimen | Shares the word “drain” with hospital sink drains |
hospital drain |
Homo sapiens | Hospital environment | The host field says human, but nobody swabbed a person |
clinical |
Homo sapiens | A patient isolate | Easily confused with “clinical environment” |
pig feces |
(blank) | An animal sample | A rule that matches “feces” alone would call it human |
Animal - food producing |
(blank) | Livestock | Contains the word “food” |
Escherichia coli |
(blank) | Nothing about the source | The organism name was typed into the source field |
not collected |
missing |
No information | Should stay unclassified, not fall into a default class |
A curator reads most of these correctly at a glance. A keyword script does not, and its mistakes are silent: it runs, returns a label, and the label is wrong. Newer NCBI packages also include a controlled source_type attribute (human, animal, food, environmental or other). That helps when it is filled in, but it is not filled in for every record.
Why the labels matter scientifically
Misclassification is not just random noise here. One Health studies ask how often isolates from different sources are closely related. A labelling error moves isolates between exactly the categories being compared, so it can create, or erase, the cross-source signal the study is trying to measure. Because genuine cross-source links are uncommon, a small number of mislabelled genomes can change the conclusion. In our paper, 65 of 1,381 clusters spanned sources; with numbers that small, a modest number of mislabelled records could change the picture.
There is also a reproducibility cost. With public genomes, every reanalysis repeats the curation, usually by hand, and the decisions are rarely written down in enough detail to repeat them.
What I started to build, and why
I have started building a small command-line tool, which I am calling onehealth. It resolves mixed NCBI identifiers to their BioSample records, assigns each genome to a source class, and produces the summaries these studies report. The reasoning behind its design comes directly from the curation work and the papers above:
- Written-down rules. Classification should come from a versioned list of phrases that a person can read and disagree with, rather than from my memory or a model nobody can inspect.
- Unknown stays unknown. Empty, conflicting or uninformative metadata should go to a review queue, not into a default class. In particular, “unknown” should never quietly become “environmental”.
- The host decides between human and animal. Blood, urine and faeces occur in any host. Anatomy ontologies such as Uberon treat body sites as species-neutral for the same reason. A specimen word with an animal host is an animal sample.
- Healthcare environments are tracked separately. In our paper, most environmental genomes came from hospitals. A hospital sink and a river are both environmental, but they mean different things for transmission, so the tool keeps a separate healthcare-environment flag.
- Every label is traceable. Each genome should carry the rule that classified it and the lexicon version, so a result can be traced back to the decision behind it.
- Curators get the last word. A table of manual corrections should always override the rules.
- Thresholds are reported as a range. Following the Pavia study, cross-source sharing should be shown across several SNP thresholds rather than one.
Two isolates a few SNPs apart probably share a recent common ancestor. That is evidence of a connection between their sources. It does not tell you the direction, the route, or whether an unsampled source links them. Sharing a lineage or a resistance gene is weaker evidence still. In a UK study, livestock and bloodstream E. coli carried some of the same resistance genes, but the bacteria themselves formed distinct populations (Ludden et al. 2019). Our paper made a similar point from the other side: plasmids moved between sources even when strains largely did not. I want the tool’s wording to stay at the level the evidence supports: “close relatives” and “sharing events”, not “transmission from A to B”.
Working with Claude and other LLMs
I am building this with Anthropic’s Claude, with infrequent reviews from different LLMs like Gemini or ChatGPT. It helps me write and test the code and find literature. The reasoning behind the choices in this post, and in the tool, is mine.
Where I am with this
This is in an early stage. I have a working first version and have tested it on small sets of public records and on synthetic data. Next, I want to run it on a larger set of public genomes and compare its labels with a hand-curated set, so I know how often it disagrees with a careful curator, and why.
I do not expect a set of rules to replace careful curation. What I want is for that curation to be written down, versioned and repeatable. Then the next person asking “where did this isolate come from?” does not have to start from an empty spreadsheet, as I did. If you do try it out, please let me know what you think. I would really appreciate feedback on the rules, the tool, and the documentation.
References
- Vezina B, Morampalli BR, Nguyen HA, Gomez-Simmonds A, Peleg AY, Macesic N (2025) The rise and global spread of IMP carbapenemases (1996–2023): a genomic epidemiology study. Nature Communications 17:183. https://doi.org/10.1038/s41467-025-66874-7
- Thorpe HA et al. (2022) A large-scale genomic snapshot of Klebsiella spp. isolates in Northern Italy reveals limited transmission between clinical and non-clinical settings. Nature Microbiology 7:2054–2067. https://doi.org/10.1038/s41564-022-01263-0
- Hetland MAK et al. (2025) A genome-wide One Health study of Klebsiella pneumoniae in Norway reveals overlapping populations but few recent transmission events across reservoirs. Genome Medicine 17:42. https://doi.org/10.1186/s13073-025-01466-0
- Muloi DM et al. (2022) Population genomics of Escherichia coli in livestock-keeping households across a rapidly developing urban landscape. Nature Microbiology 7:581–589. https://doi.org/10.1038/s41564-022-01079-y
- Jacob JJ et al. (2024) Limited evidence of spillover of antimicrobial-resistant Klebsiella pneumoniae from animal/environmental reservoirs to humans in Vellore, India. Journal of Epidemiology and Global Health 14:1668–1677. https://doi.org/10.1007/s44197-024-00323-4
- David S et al. (2019) Epidemic of carbapenem-resistant Klebsiella pneumoniae in Europe is driven by nosocomial spread. Nature Microbiology 4:1919–1929. https://doi.org/10.1038/s41564-019-0492-8
- Ludden C et al. (2019) One Health genomic surveillance of Escherichia coli demonstrates distinct lineages and mobile genetic elements in isolates from humans versus livestock. mBio 10:e02693-18. https://doi.org/10.1128/mBio.02693-18
- Gonçalves RS, Musen MA (2019) The variable quality of metadata about biological samples used in biomedical experiments. Scientific Data 6:190021. https://doi.org/10.1038/sdata.2019.21
- Mungall CJ et al. (2012) Uberon, an integrative multi-species anatomy ontology. Genome Biology 13:R5. https://doi.org/10.1186/gb-2012-13-1-r5
- NCBI BioSample attribute definitions. https://www.ncbi.nlm.nih.gov/biosample/docs/attributes/