ropensci / rentrez

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

issue with `id_or_webenv()`? #90

Closed fmichonneau closed 7 years ago

fmichonneau commented 7 years ago

In the data mashup vignette in rotl, it seems that one piece of the code just started to fail, but I'm unsure why, as it doesn't look like there is a new version of rentrez. I can't reproduce the problem when running the code interactively, it's only when it's run through devtools::check() or devtools::build_vignettes().

We have in the vignette:

extra_data <- study_external_IDs("pg_1980")
library(rentrez)
seqs <- entrez_fetch(db="nucleotide", id=extra_data$nucleotide_ids[1:2], rettype="fasta")

That returns: Error: Must specify either (not both) 'id' or 'web_history' arguments

In debugging mode within the id_or_webenv() function, I find that both args$id and args$web_history are NULL which triggers the error. I haven't messed with environments enough to figure out what's wrong, but my guess is that devtools runs the vignette in a special environment and calling sys.parent() doesn't work as expected. Is it something that could be fixed in rentrez, or do I need to bring it up with devtools?

dwinter commented 7 years ago

Hi @fmichonneau, sorry for taking so long to look at this. Moving half way around the world takes you out of the loop!

I gather this was an intermittent problem with the NCBI's servers, ending up with no nucleotide links for this dataset. I should work out if it makes more sense to check for the existence of these IDs in the rotl function or add a warning on the rentrez side.