Browse code

print warning to indicate singleCell has been depracated

sherman5 authored on 15/10/2019 05:23:10
Showing 2 changed files

... ...
@@ -165,7 +165,8 @@ startupMessage <- function(data, allParams)
165 165
 parseExtraParams <- function(allParams, extraParams)
166 166
 {
167 167
     # parse direct params
168
-    for (s in slotNames(allParams$gaps))
168
+    deprecatedSlots <- c("singleCell")
169
+    for (s in c(slotNames(allParams$gaps), deprecatedSlots))
169 170
     {
170 171
         if (!is.null(extraParams[[s]]))
171 172
         {
... ...
@@ -9,7 +9,10 @@
9 9
 #' params
10 10
 CogapsParams <- function(...)
11 11
 {
12
-    new("CogapsParams", ...)
12
+    if (!is.null(list(...)$singleCell))
13
+        warning("singleCell has been deprecated, this parameter will be ignored")
14
+    removeDeprecated <- function(..., singleCell) new("CogapsParams", ...)
15
+    removeDeprecated(...)
13 16
 }
14 17
 
15 18
 setMethod("show", signature("CogapsParams"),
... ...
@@ -110,6 +113,10 @@ function(object, whichParam, value)
110 113
         else
111 114
             object@distributed <- value
112 115
     }
116
+    else if (whichParam %in% c("singleCell"))
117
+    {
118
+        warning(whichParam, " has been deprecated, this parameter will be ignored")
119
+    }
113 120
     else
114 121
     {
115 122
         slot(object, whichParam) <- value