TaxID to taxonomy (Entrez Direct: E-utilities on the Unix Command Line)
1
0
Entering edit mode
2.6 years ago
Abu Bakar ▴ 10

Entrez Direct: E-utilities on the Unix Command Line

I would like to execute the following command but with a list where i have thousands tax ids (id). How to execute that?

efetch -db taxonomy -id 9606,7227,10090 -format xml | xtract -pattern Taxon \ -element TaxId ScientificName GenbankCommonName Division

Entrez • 1.1k views
ADD COMMENT
0
Entering edit mode

you either download the complete taxonomy table locally and query that one (with eg grep ) or you put the the efetch command in a for loop and loop over all your taxIDs.

ADD REPLY
1
Entering edit mode

thanks, how to do that, any suggestion? is at like that?

for i in tax_ids.txt;    do  efetch -db taxonomy -id $i -format xml | xtract -pattern Taxon \ -element TaxId ScientificName GenbankCommonName Division
ADD REPLY
1
Entering edit mode
2.6 years ago
GenoMax 148k

One way

$ more ids
9606
7227
10090

$ for i in `cat ids`; do  efetch -db taxonomy -id ${i} -format xml | xtract -pattern Taxon -element TaxId,ScientificName,GenbankCommonName,Division;done 
9606    Homo sapiens    human   Primates
7227    Drosophila melanogaster fruit fly   Invertebrates
10090   Mus musculus    house mouse Rodents
ADD COMMENT

Login before adding your answer.

Traffic: 1366 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