Browse code

Resync with DelayedArray 0.15.10

Hervé Pagès authored on 27/09/2020 01:24:50
Showing10 changed files

... ...
@@ -1,5 +1,5 @@
1 1
 Package: bsseq
2
-Version: 1.25.5
2
+Version: 1.25.6
3 3
 Encoding: UTF-8
4 4
 Title: Analyze, manage and store bisulfite sequencing data
5 5
 Description: A collection of tools for analyzing and visualizing bisulfite
... ...
@@ -28,7 +28,7 @@ Imports:
28 28
     DelayedMatrixStats (>= 1.5.2),
29 29
     permute,
30 30
     limma,
31
-    DelayedArray (>= 0.9.8),
31
+    DelayedArray (>= 0.15.10),
32 32
     Rcpp,
33 33
     BiocParallel,
34 34
     BSgenome,
... ...
@@ -235,12 +235,12 @@ BSmooth <- function(BSseq,
235 235
         #       (implicitly) only support in-memory or HDF5Array backends.
236 236
         #       However, we retain it for now (e.g., fstArray backend would
237 237
         #       use this until a dedicated branch was implemented).
238
-        coef_sink <- DelayedArray::RealizationSink(dim(M), type = "double")
238
+        coef_sink <- DelayedArray::AutoRealizationSink(dim(M), type = "double")
239 239
         on.exit(close(coef_sink), add = TRUE)
240 240
         sink_lock <- ipcid()
241 241
         on.exit(ipcremove(sink_lock), add = TRUE)
242 242
         if (keep.se) {
243
-            se.coef_sink <- DelayedArray::RealizationSink(
243
+            se.coef_sink <- DelayedArray::AutoRealizationSink(
244 244
                 dim(M),
245 245
                 type = "double")
246 246
             on.exit(close(se.coef_sink), add = TRUE)
... ...
@@ -200,7 +200,7 @@ getBSseq <- function(BSseq,
200 200
 
201 201
 # Move to BSseq-utils?
202 202
 strandCollapse <- function(BSseq, shift = TRUE, BPPARAM = bpparam(),
203
-                           BACKEND = getRealizationBackend(),
203
+                           BACKEND = getAutoRealizationBackend(),
204 204
                            dir = tempfile("BSseq"), replace = FALSE,
205 205
                            chunkdim = NULL, level = NULL,
206 206
                            type = c("double", "integer")) {
... ...
@@ -216,9 +216,9 @@ strandCollapse <- function(BSseq, shift = TRUE, BPPARAM = bpparam(),
216 216
     }
217 217
     # Register 'BACKEND' and return to current value on exit.
218 218
     # TODO: Is this strictly necessary?
219
-    current_BACKEND <- getRealizationBackend()
220
-    on.exit(setRealizationBackend(current_BACKEND), add = TRUE)
221
-    setRealizationBackend(BACKEND)
219
+    current_BACKEND <- getAutoRealizationBackend()
220
+    on.exit(setAutoRealizationBackend(current_BACKEND), add = TRUE)
221
+    setAutoRealizationBackend(BACKEND)
222 222
     # Check compatability of 'BPPARAM' with 'BACKEND'.
223 223
     if (!.areBackendsInMemory(BACKEND)) {
224 224
         if (!.isSingleMachineBackend(BPPARAM)) {
... ...
@@ -30,7 +30,7 @@
30 30
 # TODO: Make optional the collapsing of colData?
31 31
 # TODO: Document (and warn) that coef and se.coef aren't collapsed?
32 32
 collapseBSseq <- function(BSseq, group, BPPARAM = bpparam(),
33
-                          BACKEND = getRealizationBackend(),
33
+                          BACKEND = getAutoRealizationBackend(),
34 34
                           dir = tempfile("BSseq"), replace = FALSE,
35 35
                           chunkdim = NULL, level = NULL,
36 36
                           type = c("double", "integer")) {
... ...
@@ -52,9 +52,9 @@ collapseBSseq <- function(BSseq, group, BPPARAM = bpparam(),
52 52
     }
53 53
     # Register 'BACKEND' and return to current value on exit.
54 54
     # TODO: Is this strictly necessary?
55
-    # current_BACKEND <- getRealizationBackend()
56
-    # on.exit(setRealizationBackend(current_BACKEND), add = TRUE)
57
-    # setRealizationBackend(BACKEND)
55
+    # current_BACKEND <- getAutoRealizationBackend()
56
+    # on.exit(setAutoRealizationBackend(current_BACKEND), add = TRUE)
57
+    # setAutoRealizationBackend(BACKEND)
58 58
     # Check compatability of 'BPPARAM' with 'BACKEND'.
59 59
     if (!.areBackendsInMemory(BACKEND)) {
60 60
         if (!.isSingleMachineBackend(BPPARAM)) {
... ...
@@ -57,7 +57,7 @@
57 57
     #       minfi:::.highestType(x)
58 58
     x_types <- vapply(x, DelayedArray::type, character(1L))
59 59
     ans_type <- typeof(do.call("c", lapply(x_types, vector)))
60
-    sink <- DelayedArray::RealizationSink(
60
+    sink <- DelayedArray::AutoRealizationSink(
61 61
         dim = c(length(ans_rowRanges), sum(vapply(x, ncol, integer(1L)))),
62 62
         type = ans_type)
63 63
     on.exit(close(sink))
... ...
@@ -267,11 +267,11 @@
267 267
         #       (implicitly) only support in-memory or HDF5Array backends.
268 268
         #       However, we retain it for now (e.g., fstArray backend would use
269 269
         #       this until a dedicated branch was implemented).
270
-        M_sink <- DelayedArray::RealizationSink(
270
+        M_sink <- DelayedArray::AutoRealizationSink(
271 271
             dim = ans_dim,
272 272
             type = "integer")
273 273
         on.exit(close(M_sink), add = TRUE)
274
-        Cov_sink <- DelayedArray::RealizationSink(
274
+        Cov_sink <- DelayedArray::AutoRealizationSink(
275 275
             dim = ans_dim,
276 276
             type = "integer")
277 277
         on.exit(close(Cov_sink), add = TRUE)
... ...
@@ -388,9 +388,9 @@ read.bismark <- function(files,
388 388
     stopifnot(isTRUEorFALSE(strandCollapse))
389 389
     # Register 'BACKEND' and return to current value on exit.
390 390
     # TODO: Is this strictly necessary?
391
-    current_BACKEND <- getRealizationBackend()
392
-    on.exit(setRealizationBackend(current_BACKEND), add = TRUE)
393
-    setRealizationBackend(BACKEND)
391
+    current_BACKEND <- getAutoRealizationBackend()
392
+    on.exit(setAutoRealizationBackend(current_BACKEND), add = TRUE)
393
+    setAutoRealizationBackend(BACKEND)
394 394
     # Check compatability of 'BPPARAM' with 'BACKEND'.
395 395
     if (!.areBackendsInMemory(BACKEND)) {
396 396
         if (!.isSingleMachineBackend(BPPARAM)) {
... ...
@@ -62,7 +62,7 @@ BSmooth(BSseq,
62 62
   \linkS4class{HDF5Array}, for example.
63 63
 
64 64
   The choice of realization backend is controlled by the \code{BACKEND}
65
-  argument, which defaults to the current value of \code{DelayedArray::\link{getRealizationBackend}()}.
65
+  argument, which defaults to the current value of \code{DelayedArray::\link{getAutoRealizationBackend}()}.
66 66
 
67 67
   \code{BSmooth} supports the following realization backends:
68 68
 
... ...
@@ -134,7 +134,7 @@ slots for representing smoothed data. This class is an extension of
134 134
       matrices (the latter two can only be combined if all objects have the
135 135
       same rowRanges). The default, \code{BACKEND = NULL}, corresponds to using
136 136
       \link[base]{matrix} objects. See
137
-      \code{?DelayedArray::\link{setRealizationBackend}} for alternative
137
+      \code{?DelayedArray::\link{setAutoRealizationBackend}} for alternative
138 138
       backends.}
139 139
 
140 140
     \item{\code{strandCollapse(BSseq, shift = TRUE)}}{
... ...
@@ -175,7 +175,7 @@
175 175
 \section{Realization backends}{
176 176
   The \code{read.bismark()} function creates a \linkS4class{BSseq} object with two assays, \code{M} and \code{Cov}.
177 177
   The choice of \emph{realization backend} controls whether these assays are stored in-memory as an ordinary \link[base]{matrix} or on-disk as a \linkS4class{HDF5Array}, for example.
178
-  The choice of realization backend is controlled by the \code{BACKEND} argument, which defaults to the current value of \code{DelayedArray::\link{getRealizationBackend}()}.
178
+  The choice of realization backend is controlled by the \code{BACKEND} argument, which defaults to the current value of \code{DelayedArray::\link{getAutoRealizationBackend}()}.
179 179
 
180 180
   \code{read.bismark()} supports the following realization backends:
181 181
 
... ...
@@ -48,7 +48,7 @@ test_that("Backends work when using SerialParam parallelisation backend", {
48 48
 
49 49
 test_that(
50 50
     "Expected parallelisation backends work with in-memory realization backend", {
51
-        setRealizationBackend(NULL)
51
+        setAutoRealizationBackend(NULL)
52 52
 
53 53
         bsseq_serial_param <- BSmooth(bsseq_test, BPPARAM = SerialParam())
54 54
         bsseq_multicore_param <- BSmooth(