HDF5ArraySeed-class {HDF5Array} | R Documentation |
HDF5ArraySeed is a low-level helper class for representing a pointer to an HDF5 dataset.
Note that an HDF5ArraySeed object is not intended to be used directly.
Most end users will typically create and manipulate a higher-level
HDF5Array object instead. See ?HDF5Array
for
more information.
## --- Constructor function --- HDF5ArraySeed(filepath, name, as.sparse=FALSE, type=NA) ## --- Accessors -------------- ## S4 method for signature 'HDF5ArraySeed' path(object) ## S4 replacement method for signature 'HDF5ArraySeed' path(object) <- value ## S4 method for signature 'HDF5ArraySeed' dim(x) ## S4 method for signature 'HDF5ArraySeed' dimnames(x) ## S4 method for signature 'HDF5ArraySeed' type(x) ## S4 method for signature 'HDF5ArraySeed' is_sparse(x) ## S4 replacement method for signature 'HDF5ArraySeed' is_sparse(x) <- value ## S4 method for signature 'HDF5ArraySeed' chunkdim(x) ## --- Data extraction -------- ## S4 method for signature 'HDF5ArraySeed' extract_array(x, index) ## S4 method for signature 'HDF5ArraySeed' extract_sparse_array(x, index)
filepath, name, as.sparse, type |
See |
object, x |
An HDF5ArraySeed object or derivative. |
value |
For the For the |
index |
See |
The HDF5ArraySeed class has one direct subclass: Dense_H5ADMatrixSeed.
See ?Dense_H5ADMatrixSeed
for more information.
Note that the implementation of HDF5ArraySeed objects follows the widely adopted convention of transposing HDF5 matrices when they get loaded into R.
Finally note that an HDF5ArraySeed object supports a very limited set of methods:
path()
: Returns the path to the HDF5 file where the dataset
is located.
dim()
, dimnames()
.
type()
, is_sparse()
, chunkdim()
,
extract_array()
, extract_sparse_array()
: These generics
are defined and documented in the DelayedArrray package.
HDF5ArraySeed()
returns an HDF5ArraySeed object.
In order to have access to the full set of operations that are available
for DelayedArray objects, an HDF5ArraySeed object
first needs to be wrapped in a DelayedArray object,
typically by calling the DelayedArray()
constructor on it.
This is what the HDF5Array()
constructor function does.
Note that the result of this wrapping is an HDF5Array object, which is just an HDF5ArraySeed object wrapped in a DelayedArray object.
library(h5vcData) tally_file <- system.file("extdata", "example.tally.hfs5", package="h5vcData") h5ls(tally_file) name <- "/ExampleStudy/16/Coverages" # name of the dataset of interest seed1 <- HDF5ArraySeed(tally_file, name) seed1 path(seed1) dim(seed1) chunkdim(seed1) seed2 <- HDF5ArraySeed(tally_file, name, as.sparse=TRUE) seed2 ## Alternatively: is_sparse(seed1) <- TRUE seed1 # same as 'seed2' DelayedArray(seed1) stopifnot(class(DelayedArray(seed1)) == "HDF5Array")