ropensci / rentrez

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

entrez_fetch ignoring retmax #92

Closed boopsboops closed 7 years ago

boopsboops commented 7 years ago

I'm trying to search for and download some sequences and then filter the xml afterwards by some criteria (e.g. gene, location, voucher specimen etc).

For some reason entrez_fetch is ignoring the retmax option, and is returning 30 xml records rather than one. Here's an example:

esr <- rentrez::entrez_search(db="nuccore", term="KX347635[ACCN]", retmax=1, use_history=FALSE)
efr <- rentrez::entrez_fetch(db="nuccore", id=esr$ids, rettype="native", parsed=TRUE, retmode="xml", retmax=1)
XML::xpathSApply(efr, "//BinomialOrgName_species", xmlValue)

Any ideas what is going on here? I'm using the latest devtools version of the package (1.0.3).

Cheers!

dwinter commented 7 years ago

Hi @boopsboops , that's weird!

Just checked this out, and it's a problem on the NCBI side (you can hit the same URL with a browser: https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucccore&id=1061272804&rettype=native&retmax=). I can contact the NCBI folks and let you know if we hear anything from them?

boopsboops commented 7 years ago

Awesome. Cheers David!