Question: converting taxID to taxonomy
0
gravatar for Freddy
7 months ago by
Freddy20
Freddy20 wrote:

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?

terminal taxonomy taxid ncbi • 283 views
ADD COMMENTlink modified 3 months ago by SilentGene50 • written 7 months ago by Freddy20
2

Did you try taxonkit

ADD REPLYlink written 7 months ago by lakhujanivijay5.2k

, but the suggested solutions were not helpful

so, what did you try ?

ADD REPLYlink written 7 months ago by Pierre Lindenbaum130k
2
gravatar for genomax
7 months ago by
genomax90k
United States
genomax90k wrote:

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 COMMENTlink written 7 months ago by genomax90k

@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 REPLYlink written 7 months ago by Freddy20
2
gravatar for SilentGene
3 months ago by
SilentGene50
The University of Melbourne
SilentGene50 wrote:

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 COMMENTlink written 3 months ago by SilentGene50
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1373 users visited in the last hour