converting taxID to taxonomy
3
1
Entering edit mode
4.8 years ago
Frieda ▴ 60

Hello,

I know the following question have been asked many times by now, but the suggested solutions were not helpful. I have a set of taxIDs and I want to convert them to taxonomies, but I do not want to download any extra databases. Is there any simple way to do this via terminal?

NCBI TAXONOMY TAXID terminal • 5.2k views
ADD COMMENT
3
Entering edit mode

Did you try taxonkit

ADD REPLY
0
Entering edit mode

, but the suggested solutions were not helpful

so, what did you try ?

ADD REPLY
7
Entering edit mode
4.5 years ago
SilentGene ▴ 110

Another solution using Entrez Direct

efetch -db taxonomy -id 387462,2594474 -format xml | \
xtract -pattern Taxon -first TaxId -element Taxon -block "*/Taxon"  \
-unless Rank -equals "no rank" -tab "," -sep "_" -element Rank,ScientificName

387462  superkingdom_Eukaryota,kingdom_Metazoa,phylum_Mollusca,class_Gastropoda,subclass_Caenogastropoda,order_Littorinimorpha,superfamily_Stromboidea,family_Strombidae,genus_Strombus
2594474 superkingdom_Bacteria,phylum_Firmicutes,class_Clostridia,order_Clostridiales,family_Peptococcaceae,genus_Dehalobacter
ADD COMMENT
4
Entering edit mode
4.8 years ago
GenoMax 148k

Using Entrezdirect:

$ esearch -db taxonomy -query "4932 [taxID]" | efetch -format nativemode xml | xtract -pattern Taxon -block "*/Taxon" -unless Rank -equals "no rank" -tab "\n" -element Rank,ScientificName
superkingdom    Eukaryota
kingdom Fungi
subkingdom  Dikarya
phylum  Ascomycota
subphylum   Saccharomycotina
class   Saccharomycetes
order   Saccharomycetales
family  Saccharomycetaceae
genus   Saccharomyces

OR

$ esearch -db taxonomy -query "4932 [taxID]" | efetch -format native -mode xml | grep ScientificName | awk -F ">|<" 'BEGIN{ORS=", ";}{print $3;}'
Saccharomyces cerevisiae, cellular organisms, Eukaryota, Opisthokonta, Fungi, Dikarya, Ascomycota, saccharomyceta, Saccharomycotina, Saccharomycetes, Saccharomycetales, Saccharomycetaceae, Saccharomyces
ADD COMMENT
0
Entering edit mode

@genomax Thank you very much, it works perfectly. There is a manual on how to use Entrez on NCBI, but I find it difficult to use. Do you have any suggestions for me on how to learn Entrez' commands properly?

ADD REPLY

Login before adding your answer.

Traffic: 2101 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6