ropensci / bold

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

bold_specimens returns no records with format="tsv" for taxa with large numbers of records #47

Closed griffinp closed 7 years ago

griffinp commented 7 years ago

Hi @sckott, thanks for fixing issue #46 so promptly, the table format seems fine now.

I have run into another issue when using bold_specimens to retrieve info in tsv format for some taxa. I suspect this is a problem for taxa with large numbers of records only. The command returns a (kind of) NA value and no records and does not generate an error message. xml format seems to return okay. For example:

> bold_specimen_records <- bold::bold_specimens(taxon="Carabidae", format="tsv")
> bold_specimen_records
[1] NA.
<0 rows> (or 0-length row.names)

Whereas it works fine for a taxon with not many sequence records:

> bold_specimen_records <- bold::bold_specimens(taxon="Athericidae", format="tsv")
> bold_specimen_records[1:5,1:5]
     processid   sampleid recordID   catalognum fieldnum
1   BYRN013-12   Byrn12E1  2895459                ByrnE1
2 GBDP14660-13   KC592679  3662005      PLIM180         
3 GBDP14675-13   KC592664  3662020     PEET1005         
4 GBDP15865-15   KM243490  5649052 NCSU08021521 KM243490
5  MHTAB099-09 ACTDpON10A  1085756              DpONT10A
Session Info ```r Session info --------------------------------------------------------------------- setting value version R version 3.4.0 (2017-04-21) system x86_64, darwin15.6.0 ui RStudio (1.0.143) language (EN) collate en_AU.UTF-8 tz Australia/Melbourne date 2017-07-21 Packages ------------------------------------------------------------------------- package * version date source ape 4.1 2017-02-14 CRAN (R 3.4.0) assertthat 0.2.0 2017-04-11 CRAN (R 3.4.0) backports 1.1.0 2017-05-22 CRAN (R 3.4.0) base * 3.4.0 2017-04-21 local bindr 0.1 2016-11-13 cran (@0.1) bindrcpp 0.2 2017-06-17 cran (@0.2) bold 0.5.0 2017-07-21 Github (ropensci/bold@48a9fe9) codetools 0.2-15 2016-10-05 CRAN (R 3.4.0) commonmark 1.2 2017-03-01 CRAN (R 3.4.0) compiler 3.4.0 2017-04-21 local crayon 1.3.2 2016-06-28 CRAN (R 3.4.0) crul 0.3.8 2017-06-15 cran (@0.3.8) curl 2.7 2017-06-26 cran (@2.7) data.table 1.10.4 2017-02-01 CRAN (R 3.4.0) datasets * 3.4.0 2017-04-21 local desc 1.1.0 2017-01-27 CRAN (R 3.4.0) devtools * 1.13.2 2017-06-02 CRAN (R 3.4.0) digest 0.6.12 2017-01-27 CRAN (R 3.4.0) dplyr 0.7.1 2017-06-22 CRAN (R 3.4.1) foreach 1.4.3 2015-10-13 CRAN (R 3.4.0) git2r 0.18.0 2017-01-01 CRAN (R 3.4.0) glue 1.1.1 2017-06-21 cran (@1.1.1) graphics * 3.4.0 2017-04-21 local grDevices * 3.4.0 2017-04-21 local grid 3.4.0 2017-04-21 local httr 1.2.1 2016-07-03 CRAN (R 3.4.0) iterators 1.0.8 2015-10-13 CRAN (R 3.4.0) jsonlite 1.5 2017-06-01 cran (@1.5) lattice 0.20-35 2017-03-25 CRAN (R 3.4.0) magrittr 1.5 2014-11-22 CRAN (R 3.4.0) memoise 1.1.0 2017-04-21 CRAN (R 3.4.0) metabarcodedb * 0.0.0.9000 local methods * 3.4.0 2017-04-21 local nlme 3.1-131 2017-02-06 CRAN (R 3.4.0) parallel 3.4.0 2017-04-21 local pbapply * 1.3-3 2017-07-04 CRAN (R 3.4.1) pkgconfig 2.0.1 2017-03-21 cran (@2.0.1) plyr 1.8.4 2016-06-08 CRAN (R 3.4.0) R6 2.2.2 2017-06-17 cran (@2.2.2) Rcpp 0.12.12 2017-07-15 CRAN (R 3.4.1) rentrez 1.1.0 2017-06-01 cran (@1.1.0) reshape 0.8.6 2016-10-21 CRAN (R 3.4.0) reshape2 1.4.2 2016-10-22 CRAN (R 3.4.0) rlang 0.1.1 2017-05-18 cran (@0.1.1) roxygen2 * 6.0.1 2017-02-06 CRAN (R 3.4.0) rprojroot 1.2 2017-01-16 CRAN (R 3.4.0) stats * 3.4.0 2017-04-21 local stringi 1.1.5 2017-04-07 CRAN (R 3.4.0) stringr * 1.2.0 2017-02-18 CRAN (R 3.4.0) taxize 0.8.9 2017-07-11 CRAN (R 3.4.1) testthat * 1.0.2 2016-04-23 CRAN (R 3.4.0) tibble 1.3.3 2017-05-28 cran (@1.3.3) tools 3.4.0 2017-04-21 local triebeard 0.3.0 2016-08-04 CRAN (R 3.4.0) urltools 1.6.0 2016-10-17 CRAN (R 3.4.0) utils * 3.4.0 2017-04-21 local withr 1.0.2 2016-06-20 CRAN (R 3.4.0) XML 3.98-1.9 2017-06-19 cran (@3.98-1.) xml2 1.1.1 2017-01-24 CRAN (R 3.4.0) ```
sckott commented 7 years ago

try again after reinstalling - was related to a problem for some reason in readBin - switched to rawToChar and works fine.

griffinp commented 7 years ago

Works fine now! Thanks a lot for the fix.

sckott commented 7 years ago

great, glad it works now!