realize: Realize a DelayedArray object

Description Usage Arguments Details Value See Also Examples

Description

Realize a DelayedArray object in memory or on disk. Get or set the realization backend for the current session with getRealizationBackend or setRealizationBackend.

Usage

1
2
3
4
5
6
7
8

Arguments

x

The array-like object to realize.

...

Additional arguments passed to methods.

BACKEND

NULL (the default), or a single string specifying the name of the backend. When the backend is set to NULL, x is realized in memory as an ordinary array by just calling as.array on it.

Details

The realization backend controls where/how realization happens e.g. as an ordinary array if set to NULL, as an RleArray object if set to "RleArray", or in an HDF5 file if set to "HDF5Array".

Value

realize(x) returns a DelayedArray object. More precisely, it returns DelayedArray(as.array(x)) when the backend is set to NULL (the default). Otherwise it returns an instance of the class associated with the specified backend (which should extend DelayedArray).

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(HDF5Array)
toy_h5 <- system.file("extdata", "toy.h5", package="HDF5Array")
h5ls(toy_h5)
M1 <- HDF5Array(toy_h5, "M1")
M2 <- HDF5Array(toy_h5, "M2")
M3 <- rbind(log(M1), t(M2))

supportedRealizationBackends()
getRealizationBackend()  # backend is set to NULL
realize(M3)  # realization as ordinary array

setRealizationBackend("RleArray")
getRealizationBackend()  # backend is set to "RleArray"
realize(M3)  # realization as RleArray object

setRealizationBackend("HDF5Array")
getRealizationBackend()  # backend is set to "HDF5Array"
realize(M3)  # realization in HDF5 file

Bioconductor-mirror/DelayedArray documentation built on Aug. 17, 2017, 3:43 p.m.