taxonomy information based on SRA id
2
0
Entering edit mode
2.9 years ago
agata ▴ 10

I would like to get taxonomy information (species, family, class, and so on) based on SRA id using rentrez package. I was trying to build a query but was not sure if approaching it correctly.

The taxonomy information are directly included in sra database, as: entrez_db_searchable("sra") --> [ORGN] - Scientific and common names of organism, and all higher levels of taxonomy.

So if I understand correctly, I don't need to link any other database (e.g taxonomy) to get all I need. When I tried:

test <- entrez_search(db="sra", term="ERR5883998[ACCN]", rettype="xml", parsed=TRUE)
test
Entrez search result with 1 hits (object contains 1 IDs and no web_history object)
Search term (as translated):  ERR5883998[ACCN] 

But when I want to extract XML to extract taxonomy, I got error:

info <- XML::xmlToList(test)
Error in UseMethod("xmlSApply") : 
no applicable method for 'xmlSApply' applied to an object of class "c('esearch', 'list')"
rentrez R • 1.1k views
ADD COMMENT
1
Entering edit mode
2.9 years ago
agata ▴ 10

I found a way how to use the rentrez package to obtain the ScienticName based on SRAid (here more info: manual). Maybe someone else will also find it useful.

test <- entrez_search(db="sra", term=sraid)
tax_rec <- entrez_fetch(db="sra", id=test$ids, rettype="xml", parsed=TRUE)
tax_list <- XML::xmlToList(tax_rec)
info <- tax_list$EXPERIMENT_PACKAGE$RUN_SET$RUN$Pool$Member$.attrs
organism <- as.vector(info["organism"])
ADD COMMENT
1
Entering edit mode
2.9 years ago
GenoMax 147k

Using EntrezDirect:

$ esearch -db sra -query ERR5883998 | efetch -format runinfo | awk -F "," '{print $28,$29}'
TaxID ScientificName
39272 Allacma fusca

OR

$ efetch -db sra -id ERR5883998 -format runinfo | awk -F "," '{print $28,$29}'
TaxID ScientificName
39272 Allacma fusca
ADD COMMENT
0
Entering edit mode

Thank you for your help, but I need a solution specifically in the R environment - rentrez package

ADD REPLY

Login before adding your answer.

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