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')"
Thank you for your help, but I need a solution specifically in the R environment -
rentrez
package