Browse code

meta do not include tag

Qian Liu authored on 22/12/2022 16:05:59
Showing 5 changed files

... ...
@@ -21,6 +21,7 @@ export(recipeSearch)
21 21
 export(recipeUpdate)
22 22
 export(toList)
23 23
 exportMethods("[")
24
+exportMethods("[<-")
24 25
 exportMethods(c)
25 26
 exportMethods(show)
26 27
 import(BiocFileCache)
... ...
@@ -127,6 +127,7 @@ setGeneric("dataTags", function(object)standardGeneric("dataTags"))
127 127
 #' @rdname dataHub-class
128 128
 setMethod("dataTags", "dataHub", function(object) {
129 129
     if("tag" %in% colnames(mcols(object))){
130
+        ## mcols(object)[, c("rname", "tag")]
130 131
         mcols(object)$tag
131 132
     }else{
132 133
         NULL
... ...
@@ -134,7 +135,8 @@ setMethod("dataTags", "dataHub", function(object) {
134 135
 })
135 136
 
136 137
 #' @rdname dataHub-class
137
-#' @param value The tag values to assign to datasets in `dataHub` object.
138
+#' @param value Character string specifying the tag values to assign
139
+#'     to datasets in `dataHub` object.
138 140
 #' @param append Whether to append new tag or replace all tags.
139 141
 #' @export
140 142
 setGeneric("dataTags<-", function(object, append=TRUE, value)
... ...
@@ -158,12 +160,20 @@ setReplaceMethod("dataTags", "dataHub", function(object, append=FALSE, value){
158 160
 #' @param x A `dataHub` object.
159 161
 #' @param i The integer index of the `dataHub` object, or a logical
160 162
 #'     vector same length as the `dataHub` object.
163
+#' @param j inherited from `[` generic.
164
+#' @param drop Inherited from `[` generic.
161 165
 #' @export
162
-setMethod("[", c("dataHub"), function(x, i) {
166
+setMethod("[", c("dataHub"), function(x, i, j, drop) {
163 167
     rids <- x@rid[i]
164 168
     return(x[rids])
165 169
 })
166
-setGeneric("[")
170
+
171
+#' @rdname dataHub-class
172
+#' @param value A `dataHub` object  
173
+#' @export
174
+setReplaceMethod("[", "dataHub", function(x, i, j, value){
175
+    return(x)
176
+})
167 177
 
168 178
 #' combine dataHub
169 179
 #' @rdname dataHub-class
... ...
@@ -25,7 +25,7 @@
25 25
 meta_data <- function(dir = "", cleanup = FALSE, checkData = TRUE) {
26 26
     ymls <- normalizePath(list.files(dir, pattern = ".yml", full.names = TRUE, recursive = TRUE))
27 27
     dnames <- sub(".yml$", "", basename(ymls))  ## file name.
28
-    keys <- c("output", "notes", "date", "tag")
28
+    keys <- c("output", "notes", "date")
29 29
 
30 30
     if (!length(dnames)) {
31 31
         meta <- setNames(data.frame(matrix(ncol = 6, nrow = 0)), c("yml", "params", keys))
... ...
@@ -7,7 +7,7 @@
7 7
             "Use inputs(", ifelse(return, value, ""),
8 8
             ") to check required input parameters before evaluation.",
9 9
             "\nCheck here: https://rcwl.org/dataRecipes/", value, ".html",
10
-            "\nfor recipe instructions (e.g., eligible input values, data source, etc.)\n"
10
+            "\nfor user instructions (e.g., eligible input values, data source, etc.)\n"
11 11
             )
12 12
 }
13 13
 .load_rcp <- function(rscript, env = .GlobalEnv, return = FALSE){
... ...
@@ -13,6 +13,7 @@
13 13
 \alias{dataTags<-}
14 14
 \alias{dataTags<-,dataHub-method}
15 15
 \alias{[,dataHub,ANY,ANY,ANY-method}
16
+\alias{[<-,dataHub,ANY,ANY,ANY-method}
16 17
 \alias{c,dataHub-method}
17 18
 \alias{toList}
18 19
 \title{dataHub Class}
... ...
@@ -37,11 +38,13 @@ dataTags(object)
37 38
 
38 39
 \S4method{dataTags}{dataHub}(object)
39 40
 
40
-dataTags(object, append = TRUE) <- value
41
+dataTags(object, append = TRUE, newtag) <- value
41 42
 
42
-\S4method{dataTags}{dataHub}(object, append = FALSE) <- value
43
+\S4method{dataTags}{dataHub}(object, append = FALSE, newtag) <- value
43 44
 
44
-\S4method{[}{dataHub,ANY,ANY,ANY}(x, i)
45
+\S4method{[}{dataHub,ANY,ANY,ANY}(x, i, j, drop)
46
+
47
+\S4method{[}{dataHub,ANY,ANY,ANY}(x, i, j) <- value
45 48
 
46 49
 \S4method{c}{dataHub}(x, ...)
47 50
 
... ...
@@ -54,13 +57,20 @@ toList(x, format = c("list", "json", "yaml"), type = NULL)
54 57
 
55 58
 \item{append}{Whether to append new tag or replace all tags.}
56 59
 
57
-\item{value}{The tag values to assign to datasets in \code{dataHub} object.}
60
+\item{newtag}{Character string specifying the tag values to assign
61
+to datasets in \code{dataHub} object.}
58 62
 
59 63
 \item{x}{A \code{dataHub} object.}
60 64
 
61 65
 \item{i}{The integer index of the \code{dataHub} object, or a logical
62 66
 vector same length as the \code{dataHub} object.}
63 67
 
68
+\item{j}{inherited from \code{[} generic.}
69
+
70
+\item{drop}{Inherited from \code{[} generic.}
71
+
72
+\item{value}{A \code{dataHub} object}
73
+
64 74
 \item{...}{More \code{dataHub} objects to combine.}
65 75
 
66 76
 \item{format}{can be "list", "json" or "yaml". Supports partial