Thank you!
• 0 views
•
link
Hi! I am writing a python script to obtain the taxonomic classification to the phylum level of some protein sequences. I currently have the NCBI accession numbers (see question Retrieving taxonomy from entrez search in biopython). I realized that I need the taxon ID to search it in the taxonomy database to obtain the information about the phylum. Do you know how to do this in Python?
Many thanks!
Using EntrezDirect (you will need to translate this to biopython):
Following answers will work for both of your questions.
$ esearch -db protein -query OGI11933 | elink -target taxonomy | efetch -format native -mode xml | xtract -pattern Taxon -block "*/Taxon" -unless Rank -equals "no rank" -tab "\n" -element Rank,ScientificName,TaxId
superkingdom Archaea 2157
clade DPANN group 1783276
phylum Candidatus Micrarchaeota 1801631
$ esearch -db protein -query OGI11933 | elink -target taxonomy | efetch -format native -mode xml | xtract -pattern Taxon -block "*/Taxon" -if Rank -equals "phylum" -element ScientificName
Candidatus Micrarchaeota
Thank you!
Log in to answer this question.