traits
traits copied to clipboard
Error : Bad Request (HTTP 400)
Hi! I'm trying to use ncbi_byname function, but it is returning the Error : Bad Request (HTTP 400). What can I do?
ncbi_byname(taxa="Otaria flavescens", gene = c("coi", "co1"), seqrange = "1:2000")
Returns:
Working on Otaria flavescens... ...retrieving sequence IDs... Error : Bad Request (HTTP 400) NULL
@babinecha Do you have an API Key? Try
Sys.getenv("ENTREZ_KEY", "")
And if the result is an empty string (""), try:
- create an NCBI account (if you don't have one) https://www.ncbi.nlm.nih.gov/account/
- generate an API key
- go to https://www.ncbi.nlm.nih.gov/account/settings/
- scroll down and create an API key
- copy the key
- store the key in your .Renviron
- an easy way is to install the usethis package and type
usethis::edit_r_environ() - add a line with
ENTREZ_ID="your_api_key_here" - restart R and try again
- an easy way is to install the usethis package and type
(plus, note to self, I need to update the documentation)