ropensci / bold

Interface to the Bold Systems barcode webservice
https://docs.ropensci.org/bold
Other
17 stars 11 forks source link

Graceful failure for lists of taxa #24

Closed boopsboops closed 8 years ago

boopsboops commented 8 years ago

Hi Scott, for some reason a small number of taxa are returning NA dataframes, but more annoyingly, when combined with taxa that are working as expected, also return a NA dataframe. Taxa that are not in BOLD return nothing, and do not interfere with those that are. Hope this example makes sense. Cheers!

cod <- "Gadus morhua"
haddock <- "Melanogrammus aeglefinus"
pipefish <- "Nerophis lumbriciformis"
str(bold_seqspec(taxon=cod))# taxon in BOLD, but doesn't work (returns a dataframe of NA)
str(bold_seqspec(taxon=haddock))# taxon in BOLD, works (returns nice dataframe)
str(bold_seqspec(taxon=pipefish))# taxon not in BOLD, returns nothing (i.e. works)
str(bold_seqspec(taxon=c(cod,haddock)))# when combined, both fail and a NA dataframe is returned
str(bold_seqspec(taxon=c(haddock,pipefish)))# when combined, returns just haddock data as expected
sckott commented 8 years ago

Hi @boopsboops - weird, I'll have a look

sckott commented 8 years ago

@boopsboops made some changes in 650c40faa53fa6cc3e041b7bee8f597a2b00314c

try again after re-installing like devtools::install_github("ropensci/bold") - There was some weirdness going on with parsing the result from httr, using rawToChar(content()) on the httr response now, and it seems to fix the problems.

let me know if this does or doesn't fix your pboelsm

boopsboops commented 8 years ago

Hi Scott. Sorry for the delay getting back to you. It's working great now. Thanks!

sckott commented 8 years ago

great, glad it works!