From d3db77d5fdb144cf810349e276b99d43420c5959 Mon Sep 17 00:00:00 2001 From: Katrin Leinweber <9948149+katrinleinweber@users.noreply.github.com> Date: Mon, 3 Sep 2018 09:45:44 +0200 Subject: [PATCH] Explain use-case of dataset testing --- DESCRIPTION | 2 +- NEWS.md | 11 +++ R/retrieve_search_results.R | 8 +- tests/testthat/test-retrieve_search_results.R | 8 ++ vignettes/BacDive-geo-logic-fault.png | Bin 0 -> 61252 bytes vignettes/BacDive.bib | 23 ++++++ vignettes/logic-checking-bacdive-datasets.Rmd | 76 ++++++++++++++++++ 7 files changed, 124 insertions(+), 4 deletions(-) create mode 100644 vignettes/BacDive-geo-logic-fault.png create mode 100644 vignettes/logic-checking-bacdive-datasets.Rmd diff --git a/DESCRIPTION b/DESCRIPTION index 6d7b9ac..3febd6d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: BacDiveR Title: A Programmatic Interface For BacDive, The DSMZ's Bacterial Diversity Metadatabase -Version: 0.5.1 +Version: 0.6.0 Authors@R: person("Katrin", "Leinweber", email = "katrin.leinweber@tib.eu", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-5135-5758")) diff --git a/NEWS.md b/NEWS.md index d105ac7..c4ecdf8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Security +# BacDiveR 0.6.0 + +### Added + +- The vignette [Logic-Checking BacDive Datasets](https://tibhannover.github.io/BacDiveR/articles/logic-checking-bacdive-datasets.html) + +### Changed + +- `retrieve_search_results()` now returns `NULL` when no results are found, in + order to ease integration of datasets into `testthat` tests. + ## BacDiveR 0.5.1 ### Fixed diff --git a/R/retrieve_search_results.R b/R/retrieve_search_results.R index f9d2276..2301de2 100644 --- a/R/retrieve_search_results.R +++ b/R/retrieve_search_results.R @@ -19,8 +19,10 @@ retrieve_search_results <- function(queryURL) if (!grepl(pattern = paste0("$", download_param), x = queryURL)) queryURL <- paste0(queryURL, download_param) - result_IDs <- - strsplit(x = RCurl::getURL(queryURL), split = "\\n")[[1]] + payload <- RCurl::getURL(queryURL) - aggregate_datasets(result_IDs, from_IDs = TRUE) + if (grepl("^[[:digit:]]", payload)) + aggregate_datasets(strsplit(x = payload, split = "\\n")[[1]], from_IDs = TRUE) + else if (grepl("^N`TqV_buaH; z+^4pvWp`(`XXfedr@LprDk(@IBM=|}0D$~KT3iJHpdJALA{ibMykc5AZw>%tzz1;= zHTR5@b{{oW&6fMu4MemYx
rxsqkr@Ye*+~(&$&xSKQN%}#GhYlc
zc3qw~G;qRAtuv3l@M*@1(9Kx4 7W29SyvKsITdtr43YM6J*a@pFg@={#bEGOt1t_s;+mt|xoKW;`FcU6!%FlGdohhA_erjMUpYxgDGuxgwO$XbhUN>i2I|aHgO`2
z_Y^=|?OTo3O!qUQ#i4~!QfB%XA0A m3*5pHIDZ@qK!V=X>X`(~
zs>4Uu-LhnJq`u{i7`*tjWeo9!e(&ibKk4%fKxGH9Mz_#@>|m(!+|k(lT)apUpSFfS
zn=x6Z@#H4TOza~rw|sMDa3`>!Q^Fb~=8LbB79d?GQ7 }Yaj(?0DyioHwzz8Xw_3?)Xj#)!*G#)ZID`f
z6aLoe#o6^l#ac{%J3jZZ#Py5MaZ1y878VWp2=a64!j9T!QVo&Hf@(1L%NJ|wqw%+(
zjw>bW5?uzY@z-vx#*r?&I}k*0=jLx`780@}wa%pD$!vp1f*aG3x7OPyw+;z}x#+(b
z{KoMCAD=C0`$zBMvy1IP^@xeM<;l{@%8F-&8+ilM>eA9mtA_xPeIK|czY3j?Gu$6<
zD?FY3vMp5LYnu))w-3%sh7ufO`o(n33oU*%LFEzMO!G>5v-0&@(7qt~S5k2^+5Q1_
zr2*6aac>EATWaSvW%b>+lvGXQ&+x`VD9nfKHxqJA5zFz&FGwLWi5b*v9|(AjfIPfg
zM-jB}By_#PS`38s&(Z)_$_KNTLv8=U}D|_9)f|{BpATT_tCFoO>Xc>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