TileDBArray: Delayed TileDB arrays

Description Constructing a TileDBArray Available operations Author(s) Examples

View source: R/TileDBArray.R

Description

The TileDBArray class provides a DelayedArray backend for TileDB arrays (sparse and dense).

Constructing a TileDBArray

TileDBArray(x, attr) returns a TileDBArray object given:

Alternatively, x can be a TileDBArraySeed object, in which case attr is ignored.

TileDBArraySeed(x, attr) returns a TileDBArraySeed with the same arguments as described for TileDBArray. If x is already a TileDBArraySeed, it is returned directly without further modification.

DelayedArray(x) returns a TileDBArray object given x, a TileDBArraySeed.

In all cases, two-dimensional arrays will automatically generate a TileDBMatrix, a subclass of the TileDBArray.

Available operations

extract_array(x, index) will return an ordinary array corresponding to the TileDBArraySeed x subsetted to the indices in index. The latter should be a list of length equal to the number of dimensions in x.

type(x) will return a string containing the type of the TileDBArraySeed object x. Currently, only "integer", "logical" and "double"-precision is supported.

is_sparse(x) will return a logical scalar indicating whether the TileDBArraySeed x uses a sparse format in the TileDB backend.

All of the operations described above are also equally applicable to TileDBArray objects, as their methods simply delegate to those of the TileDBArraySeed.

All operations supported by DelayedArray objects are also available for TileDBArray objects.

Author(s)

Aaron Lun

Examples

1
2
3
4
5
6
7
8
9
data <- matrix(rpois(10000, 5), nrow=100, ncol=100)
B <- as(data, "TileDBArray")
B

# Apply typical DelayedArray operations:
as.matrix(B[1:10,1:10])
if (require("BiocParallel")) {
B %*% runif(ncol(B))
}

aaronwolen/testtest documentation built on June 12, 2020, 12:01 a.m.