I am trying to retrieve the direct children of a taxon from entrez. I can accomplish this easily if I use the taxon name, for example:
https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=taxonomy&term=Bacteria[NXLV]&RetMax=1000&RetStart=0
This retrieves all taxa whose immediate parent is 'Bacteria'.
However, taxon names are ambiguous. In this case, 'Bacteria' can refer to either the domain or to a genus of walking sticks (e.g. taxon 629398 from the link above).
So rather than use the term 'Bacteria' in the search, I would like to use the taxon ID.
But I can't directly replace Bacteria with its taxon ID (2)
https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=taxonomy&term=2[NXLV]&RetMax=1000&RetStart=0
Or use the 'txid2' convention (which I've seen a few places)
https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=taxonomy&term=txid2[NXLV]&RetMax=1000&RetStart=0
I've tried using the UID tag in tandem with NXLV, but only one tag seems to be considered
https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=taxonomy&term=2[UID:NXLV]&RetMax=1000&RetStart=0
Using taxon ID ought to be at least as straightforward as using taxon name. Am I missing something?
how about using the taxdump file to get all the children of a given id ? ftp://ftp.ncbi.nih.gov/pub/taxonomy/
Thanks Pierre! I probably should have provided more context. I am currently helping out with an R package that uses entrez (https://github.com/ropensci/taxize). One restriction of this package (by design) is that it does not require downloading and building entire databases. We have a related package, taxizedb, that builds an SQLite database from the taxonomy dump. In this case, getting the direct children is a trivial SQL command.
So, for this project, I would like to get the children just through a simple REST interface, if possible.