Getting family level from taxonomy via E-Utils for virus classification
1
0
Entering edit mode
2.7 years ago
AUROSHIS ▴ 10

esearch -db nucleotide -query "MW605321:MW605421[accn]" | efetch -format docsum | xtract -pattern DocumentSummary -element Caption TaxId Organism

I have to get the family information of viruses from their species information. I have more than 200 virus species data with me. I have tried a lot of things to get the family information of multiple viruses using NCBI utilities.

So can any one please help me hoe to get the family information of viruses from species information.

esearch -db nucleotide -query "MW605321:MW605421[accn]" | efetch -format docsum | xtract -pattern DocumentSummary -element Caption TaxId Organism

how to modify this command .

taxonomy • 592 views
ADD COMMENT
0
Entering edit mode
2.7 years ago
Michael 55k

Such a query in E-Utils is not trivial and cannot be done properly in a single command. Also note that the results you are getting from your query hint at environmental samples from animals, not viruses. So I am not sure what you are exactly looking for here. If you are looking for viruses in these samples you may need a different analysis.

Anyway, the following query resolves a taxid to the family level using e-fetch:

efetch -db taxonomy -id 333810,2811796,2811795,2811794,2811793,2811792,696705 -format xml | \ 
xtract -pattern  LineageEx  -block Taxon -if Rank -equals family -element "ScientificName"

Chironomidae
Naididae
Tephritidae
Chironomidae
Sepsidae
Culicidae

To add a fourth column to your output file requires a little scripting, like so:

 esearch -db nucleotide -query "MW605321:MW605421[accn]" | efetch -format docsum | xtract -pattern DocumentSummary \ 
 -element Caption TaxId Organism > file1.txt
 efetch -db taxonomy -id $(cut -f2 file1.txt | tr "\n" ",") -format xml | 
 xtract -pattern  LineageEx  -block Taxon -if Rank -equals family -element "ScientificName" > file2.txt
 paste file1.txt file2.txt

MW605421    333810  Chironomidae environmental sample   Chironomidae
MW605420    333810  Chironomidae environmental sample   Chironomidae
MW605419    333810  Chironomidae environmental sample   Chironomidae
MW605418    333810  Chironomidae environmental sample   Chironomidae
MW605417    333810  Chironomidae environmental sample   Chironomidae
MW605416    333810  Chironomidae environmental sample   Chironomidae
....
ADD COMMENT
0
Entering edit mode

Thank you so much for the help

ADD REPLY

Login before adding your answer.

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