This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Mapping NCBI Genome Accessions - NCBI Taxonomy IDs

Hi all,

I have list of NCBI genome accessions (SAMN02441064, NC_014374, NZ_ACYB00000000 ...) and would like to know taxonomic IDs of the species that they belong to.

Is there a mapping file somewhere? Or how can I find their taxonomic IDs programmatically?

Thanks in advance, Marina

genome taxonomy genbank ncbi

2 answers

The directory ftp://ftp.ncbi.nlm.nih.gov/pub/taxonomy/accession2taxid/ provides mapping files between the accession.version (from a nucleotide, protein, WGS or TSA sequence record) and a taxonomy ID.

If these are all nucleotide accessions then you can also use NCBI EntrezDirect:

$ esearch -db nuccore -query "SAMN02441064" | elink -target taxonomy | esummary | xtract -pattern DocumentSummary -element TaxId
1052825
$ esearch -db nuccore -query "NC_014374" | elink -target taxonomy | esummary | xtract -pattern DocumentSummary -element TaxId
666510

Log in to answer this question.