Browse code

Adding batchBackground parameter to function signature

Yuan authored on 13/01/2022 05:28:38
Showing 1 changed files

... ...
@@ -154,6 +154,7 @@ setMethod("decontX", "SingleCellExperiment", function(x,
154 154
                                                       batch = NULL,
155 155
                                                       background = NULL,
156 156
                                                       bgAssayName = NULL,
157
+                                                      bgBatch = NULL,
157 158
                                                       maxIter = 500,
158 159
                                                       delta = c(10, 10),
159 160
                                                       estimateDelta = TRUE,
... ...
@@ -182,6 +183,7 @@ setMethod("decontX", "SingleCellExperiment", function(x,
182 183
     z = z,
183 184
     batch = batch,
184 185
     countsBackground = countsBackground,
186
+    batchBackground = bgBatch,
185 187
     maxIter = maxIter,
186 188
     convergence = convergence,
187 189
     iterLogLik = iterLogLik,
... ...
@@ -234,6 +236,7 @@ setMethod("decontX", "ANY", function(x,
234 236
                                      z = NULL,
235 237
                                      batch = NULL,
236 238
                                      background = NULL,
239
+                                     bgBatch = NULL,
237 240
                                      maxIter = 500,
238 241
                                      delta = c(10, 10),
239 242
                                      estimateDelta = TRUE,
... ...
@@ -257,6 +260,7 @@ setMethod("decontX", "ANY", function(x,
257 260
     z = z,
258 261
     batch = batch,
259 262
     countsBackground = countsBackground,
263
+    batchBackground = bgBatch,
260 264
     maxIter = maxIter,
261 265
     convergence = convergence,
262 266
     iterLogLik = iterLogLik,
... ...
@@ -339,6 +343,7 @@ setMethod(
339 343
                      z = NULL,
340 344
                      batch = NULL,
341 345
                      countsBackground = NULL,
346
+                     batchBackground = NULL,
342 347
                      maxIter = 200,
343 348
                      convergence = 0.001,
344 349
                      iterLogLik = 10,
... ...
@@ -369,6 +374,7 @@ setMethod(
369 374
   runParams <- list(
370 375
     z = z,
371 376
     batch = batch,
377
+    batchBackground = batchBackground,
372 378
     maxIter = maxIter,
373 379
     delta = delta,
374 380
     estimateDelta = estimateDelta,
... ...
@@ -398,6 +404,7 @@ setMethod(
398 404
   ## Generate batch labels if none were supplied
399 405
   if (is.null(batch)) {
400 406
     batch <- rep("all_cells", nC)
407
+    batchBackground <- rep("all_cells", ncol(countsBackground))
401 408
   }
402 409
   runParams$batch <- batch
403 410
   batchIndex <- unique(batch)