Will use this as a meta issue to list as track changes need to support this change.
A proposed solution
This should actually be simple to handle. In fact, the main entrez functions will all happily pass on the new api_key argument and its value. We can still make it easier for users and developers of 'higher-level' packages to use this feature, so here is a proposed change.
Document the existence of an environment variable ENTREZ_KEY and describe how users can set this in their Renviron files
Modify the function make_entrez_query to
search for the argument api_key in any request
if this argument is not present look for the ENTREZ_KEY environmental value to pass to NCBI
Delete the Sys.sleep() arguments many entrez functions have, since > 3 requests per second will now be allowed. (Need to check with NCBI exactly how to handle this).
From the typical user's point of view, this means they can take advantage of the API keys either by explicitly passing them to a function or by setting them as an environmental variable.
Developers of packages that use the rentrez will not have to make any changes, but the NCBI-calling function will take advantage of the keys if an ENTREZ_KEY is set.
NCBI is going to start using API keys to allow registered users to make more requests per second. https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/
Will use this as a meta issue to list as track changes need to support this change.
A proposed solution
This should actually be simple to handle. In fact, the main entrez functions will all happily pass on the new
api_key
argument and its value. We can still make it easier for users and developers of 'higher-level' packages to use this feature, so here is a proposed change.ENTREZ_KEY
and describe how users can set this in theirRenviron
filesmake_entrez_query
toapi_key
in any requestENTREZ_KEY
environmental value to pass to NCBISys.sleep()
arguments many entrez functions have, since > 3 requests per second will now be allowed. (Need to check with NCBI exactly how to handle this).From the typical user's point of view, this means they can take advantage of the API keys either by explicitly passing them to a function or by setting them as an environmental variable.
Developers of packages that use the
rentrez
will not have to make any changes, but the NCBI-calling function will take advantage of the keys if anENTREZ_KEY
is set.