ropensci / rentrez

talk with NCBI entrez using R
https://docs.ropensci.org/rentrez
Other
196 stars 38 forks source link

Include search "translation" in return of entrez_search #37

Closed dwinter closed 9 years ago

dwinter commented 9 years ago

The returned file from entrez_search includes a "tranlation stack" that describes how the NCBI delt with the query:

seq_ambr <- entrez_search(db = "nuccore", "Euteleostomi[Organism] AND Brazil: Amazonas[country]")
 seq_ambr$file["//TranslationStack/TermSet"]
[[1]]
<TermSet>
  <Term>"Euteleostomi"[Organism]</Term>
  <Field>Organism</Field>
  <Count>64453608</Count>
  <Explode>Y</Explode>
</TermSet> 

[[2]]
<TermSet>
  <Term>Brazil[All Fields]</Term>
  <Field>All Fields</Field>
  <Count>1211469</Count>
  <Explode>N</Explode>
</TermSet> 

[[3]]
<TermSet>
  <Term>Amazonas[All Fields]</Term>
  <Field>All Fields</Field>
  <Count>10123</Count>
  <Explode>N</Explode>
</TermSet> 

attr(,"class")
[1] "XMLNodeSet

It would be nice to parse this, and return it to the user in a human-readable way.

Amazonas[All Fields] AND Brazil[All Fields] AND Euteleostomi"[Organism]