ropensci / rentrez

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

Feature Request: Enable an update method for entrez_search #125

Open billdenney opened 6 years ago

billdenney commented 6 years ago

Thank you for the rentrez package!

I'm currently using it to assist with a meta-analysis. Within that, I need to be able to track why articles are not included in the search from the initial to the final search. As an example, my meta-analysis is related to clinical trials in humans for a set of medicines; I need to track the initial search with all medicines and then the filter for in humans and then the filter for in clinical trials.

It would help to have an update.esearch method that can change one part of the search and then repeat the search. To accomplish this, we would need to store all of the arguments to entrez_search. Then, we could simply repeat the search using something like:

update.esearch <- function(object, ...) {
  new_args <- object$args # which stored all of the initial call arguments as a list
  args <- list(...)
  if (is.null(names(args))) {
    stop("Updated arguments to update.esearch must all be named (none are named)")
  } else if (any(names(args) %in% "")) {
    stop("Updated arguments to update.esearch must all be named (some are named)")
  }
  for (nm in names(args)) {
    new_args[[nm]] <- args[[nm]]
  }
  do.call(entrez_search, new_args)
}

(The above was typed directly into GitHub and may have bugs.)

dwinter commented 6 years ago

Hi @billdenney ,

Thanks for this interesting-looking idea and your feedback on rentrez. Grant writing and a few other commitments mean I will really have no time to dedicate to this in the next few weeks.

Just letting you know my silence on this issue doesn't mean I'm ignoring you!