Don’t suppose anyone can recommend a tool/Python l...
# meta-omics
j
Don’t suppose anyone can recommend a tool/Python library that takes an NCBI taxid at some non-species-level clade and gives a generic submittable taxid for it? E.g. 561 (Escherischia) -> 1884818 (Escherischia sp.)
j
taxonkit
maybe?
Via
list
?
j
I was using
taxonkit name2taxid
to do this - generating a submittable name and then getting its taxid. But it turns out that for some clades the pattern of what is submittable is not predictable - sometimes it’s just “X bacterium”, sometimes it’s “unclassified” or “uncultured” “X bacterium”. So I think I actually need to traverse a list…
taxonkit list
not a bad shout if there’s no library to do this.
j
Ah I see. I think unfortunately you've hit the crux of the matter: the taxonomy itself isn't clean either 😅. To my own knowledge there isn't a clear tag for finding the unnamed one (also because sometimes you can have multiple strains underneath sp.) 😕
🫠 1
But maybe someone else knows of something...
j
That’s definitely the crux of it… perhaps foolish of me to assume that if they can put
environmental samples
as a clade under just shoot everything that that means they would have a consistent naming scheme for unknown taxa at every level…
j
That's biology!
😬
g
I wrote something very custom for a sequence upload script in python - if you are not too worried about losing taxon specificity I can point you to it (feedback welcome!)
The problem is (to my understanding) that if no-one in the world ever registered a certain taxon, you won't find consistency in NCBI (e.g. you might have
uncultured [genus] sp.
but not
uncultured [genus] bacterium
). NCBI rules are still foreign to me hence I put together a few cases I found, which of course won't cover everything
j
Thanks, that would be really helpful
I actually just found that the ENA has a REST API that suggests names for submission: https://www.ebi.ac.uk/ena/taxonomy/rest/suggest-for-submission/Myxococcia
g
Indeed, I know of this one - I think it's very useful, but if you need to find more than 10 submittable taxonomies it becomes quite tedious. There are other endpoints that allow you to check if a taxon is submittable, hence why I went for "composing a taxon that makes sense" if no species-level definition exists
Here's the one I wrote, it's a bit scattered as it's specific for my use but let me know if it doesn't make a lot of sense to you. Assume that the given input is a taxonomy string (e.g.
phylum;class;order;family;genus;species
)
j
So I currently have an approach that looks like the following: 1. Classify the genome with GTDB-Tk 2. Convert that classification to NCBI using the GTDB script 3. Take the NCBI lineage, parse out the most highly-resolved clade, then generate a taxname like "Alphaproteobacteria bacterium", and grab the taxid for it using TaxonKit. I suppose that querying the taxname/taxid only for those that fail this process would be a good place to start!
Thanks, I'll take a look - am sure it will be useful
🤞🏻 1
g
We follow the same principle! If you give these functions an NCBI-converted taxonomy from GTDB it should work 🙂 Or at least, it's how we submit genomes to ENA hehe
Let me know if you have any questions
Since you mentioned Alphraproteobacteria - you can see here that I wrote something custom for deltaproteobacteria because we encountered it in our submissions and it was giving us troubles. I am sure I am missing a whole bunch of rules that might be easy to add
👍 1
j
Do you know in general if there is a difference between "uncultured X bacterium" and "X bacterium"? Should we prefer the former for metagenomics? e.g. there exists both: https://www.ebi.ac.uk/ena/taxonomy/rest/scientific-name/Chloroflexota%20bacterium and https://www.ebi.ac.uk/ena/taxonomy/rest/scientific-name/uncultured%20Chloroflexota%20bacterium
g
The two taxonomies have probably been registered separately... I could see a case where an organism used to be uncultured, then new experiments allow its culture, therefore you need to register a new taxonomy after your discovery. Or simply, who registered one wasn't aware of the other name. In terms of picking one, difficult to say... What if there's a culturable strain within that species, but some others aren't? I'd feel uncertain about picking one over the other, unless you are sure and you put the manual effort into checking for every organism - which can be hard to do in a population-level metagenomic study. It's another reason why I don't fully trust taxonomies on ENA/GenBank and I only use them as an indicator - then I try to recompute them myself anyway TL;DR Probably "uncultured" is better to use but it's difficult to define a gold standard rule to the best of my knowledge - either would probably be okay
I hope the taxonomy Gods won't punish me if I am being too skeptical
j
Thanks - I think currently we have just been using the "X bacterium" format, where available, but that wouldn't be too hard to fix. Though maybe changing at this point would be a complicating factor downstream. There's definitely not really time to do manual checking - the goal is to make this as automated as possible, so that metagenomes assembled from our Tree of Life samples can be submitted and made available to our partners.
g
I don't think there's the need to refactor old ones - as I mentioned especially in population studies we like having an idea of what organisms to find in the sample, but whether the annotation mentions cultured/uncultured doesn't really matter
j
Makes sense! Thanks a lot for sharing those functions, they're really helpful 🤩
meow vnhouse 1
Thanks again for sharing - I have a working solution now! For the highest taxon level in the NCBI lineage string, I am querying the "suggest_for_submission" API for: {taxon name} {taxon name} (bacterium|archaeon) uncultured {taxon name} (bacterium|archaeon) If at any stage I get a name that meets the desired pattern, I don't bother to query the rest. This handles Alphaproteobacteria - you don't get a suitable result for just the taxon name, but you do for "Alphaproteobacteria bacterium", for example.
g
That's a good idea! I might look into it myself, glad it helped 😊