Browse code

added one argument checkData per meta_data change

Qian Liu authored on 14/12/2022 16:06:01
Showing 3 changed files

... ...
@@ -1,6 +1,6 @@
1 1
 Package: ReUseData
2 2
 Title: Reproducible and ReUsable Data Resources
3
-Version: 0.99.7
3
+Version: 0.99.8
4 4
 Authors@R: 
5 5
     person(given = "Qian",
6 6
            family = "Liu",
... ...
@@ -28,7 +28,10 @@
28 28
 #'     intermediate files that don't match to any data file, `cleanup`
29 29
 #'     will also remove those.
30 30
 #' @param cloud Whether to return the pre-generated data from Google
31
-#'     Cloud bucket of ReUseData. Default is FALSE. 
31
+#'     Cloud bucket of ReUseData. Default is FALSE.
32
+#' @param checkData check if the data (listed as "# output: " in the
33
+#'     yml file) exists. If not, do not include in the output csv
34
+#'     file. This argument is added for internal testing purpose. 
32 35
 #' @details Users can directly retrieve information for all available
33 36
 #'     datasets by using `meta_data(dir=)`, which generates a data
34 37
 #'     frame in R with same information as described above and can be
... ...
@@ -60,7 +63,8 @@
60 63
 #' ## newly generated data are now cached and searchable
61 64
 #' dataSearch(c("ensembl", "liftover"))  ## both locally generated data and google cloud data! 
62 65
 #' 
63
-dataUpdate <- function(dir, cachePath = "ReUseData", outMeta = FALSE, keepTags = TRUE, cleanup = FALSE, cloud = FALSE) {
66
+dataUpdate <- function(dir, cachePath = "ReUseData", outMeta = FALSE,
67
+                       keepTags = TRUE, cleanup = FALSE, cloud = FALSE, checkData = TRUE) {
64 68
     ## find/create the cache path, and create a BFC object.
65 69
     bfcpath <- Sys.getenv("cachePath")
66 70
     if(bfcpath != ""){
... ...
@@ -83,7 +87,7 @@ dataUpdate <- function(dir, cachePath = "ReUseData", outMeta = FALSE, keepTags =
83 87
     
84 88
     bfcremove(bfc, bfcinfo(bfc)$rid)
85 89
     
86
-    meta <- meta_data(dir = dir, cleanup = cleanup)
90
+    meta <- meta_data(dir = dir, cleanup = cleanup, checkData = checkData)
87 91
 
88 92
     ## append pre-generated cloud data
89 93
     if (cloud) {
... ...
@@ -10,7 +10,8 @@ dataUpdate(
10 10
   outMeta = FALSE,
11 11
   keepTags = TRUE,
12 12
   cleanup = FALSE,
13
-  cloud = FALSE
13
+  cloud = FALSE,
14
+  checkData = TRUE
14 15
 )
15 16
 }
16 17
 \arguments{
... ...
@@ -45,6 +46,10 @@ will also remove those.}
45 46
 
46 47
 \item{cloud}{Whether to return the pre-generated data from Google
47 48
 Cloud bucket of ReUseData. Default is FALSE.}
49
+
50
+\item{checkData}{check if the data (listed as "# output: " in the
51
+yml file) exists. If not, do not include in the output csv
52
+file. This argument is added for internal testing purpose.}
48 53
 }
49 54
 \value{
50 55
 a \code{dataHub} object containing the information about local