Browse code

extract_block() was replaced with read_block() in DelayedArray 0.7.15

Peter Hickey authored on 28/06/2018 16:12:40
Showing2 changed files

... ...
@@ -51,9 +51,9 @@ makeClusters <- function(hasGRanges, maxGap = 10^8) {
51 51
     bb <- (b - 1L) %% nrow(pos_grid) + 1L
52 52
     # NOTE: unname() is necessary because M and Cov may carry colnames
53 53
     sdata <- data.frame(
54
-        pos = DelayedArray:::extract_block(pos, pos_grid[[bb]]),
55
-        M = unname(DelayedArray:::extract_block(M, grid[[b]])),
56
-        Cov = unname(DelayedArray:::extract_block(Cov, grid[[b]])))
54
+        pos = read_block(pos, pos_grid[[bb]]),
55
+        M = unname(read_block(M, grid[[b]])),
56
+        Cov = unname(read_block(Cov, grid[[b]])))
57 57
     # Ensure 0 < M < Cov to avoid boundary issues (only relevant at loci with
58 58
     # non-zero coverage, so doesn't matter what M is for these loci).
59 59
     sdata[["M"]] <- pmin(pmax(sdata[["M"]], 0.01), pmax(sdata[["Cov"]] - 0.01))
... ...
@@ -133,10 +133,7 @@ blockApplyWithRealization <- function(x, FUN, ..., sink = NULL, x_grid = NULL,
133 133
         }
134 134
         x_viewport <- x_grid[[b]]
135 135
         sink_viewport <- sink_grid[[b]]
136
-        block <- DelayedArray:::extract_block(x, x_viewport)
137
-        if (!is.array(block)) {
138
-            block <- DelayedArray:::.as_array_or_matrix(block)
139
-        }
136
+        block <- read_block(x, x_viewport)
140 137
         attr(block, "from_grid") <- x_grid
141 138
         attr(block, "block_id") <- b
142 139
         block_ans <- FUN(block, ...)