Title: | beachmat bindings for HDF5-backed matrices |
---|---|
Description: | Extends beachmat to support initialization of tatami matrices from HDF5-backed arrays. This allows C++ code in downstream packages to directly call the HDF5 C/C++ library to access array data, without the need for block processing via DelayedArray. Some utilities are also provided for direct creation of an in-memory tatami matrix from a HDF5 file. |
Authors: | Aaron Lun [aut, cre] |
Maintainer: | Aaron Lun <[email protected]> |
License: | GPL-3 |
Version: | 1.3.1 |
Built: | 2024-07-23 02:43:11 UTC |
Source: | https://github.com/bioc/beachmat.hdf5 |
Initialize C++ representations of HDF5-backed matrices based on their HDF5Array representations.
## S4 method for signature 'H5SparseMatrixSeed' initializeCpp(x, ..., memorize = FALSE) ## S4 method for signature 'HDF5ArraySeed' initializeCpp(x, ..., memorize = FALSE)
## S4 method for signature 'H5SparseMatrixSeed' initializeCpp(x, ..., memorize = FALSE) ## S4 method for signature 'HDF5ArraySeed' initializeCpp(x, ..., memorize = FALSE)
x |
A HDF5Array seed object. |
... |
Further arguments, ignored. |
memorize |
Logical scalar specifying whether to load the matrix data in |
An external pointer that can be used in any tatami-compatible function.
Aaron Lun
library(HDF5Array) y <- matrix(runif(1000), ncol=20, nrow=50) z <- as(y, "HDF5Array") ptr <- initializeCpp(z)
library(HDF5Array) y <- matrix(runif(1000), ncol=20, nrow=50) z <- as(y, "HDF5Array") ptr <- initializeCpp(z)
Load a HDF5-backed matrix into memory as an external pointer to a tatami-compatible representation.
This differs from the (default) behavior of initializeCpp
, which only loads slices of the matrix on request.
loadIntoMemory(x, force.integer = FALSE)
loadIntoMemory(x, force.integer = FALSE)
x |
A HDF5Array-derived matrix or seed object. |
force.integer |
Whether to force floating-point values to be integers to reduce memory consumption. |
An external pointer that can be used in tatami-based functions.
Aaron Lun
library(HDF5Array) y <- matrix(runif(1000), ncol=20, nrow=50) z <- as(y, "HDF5Array") ptr <- loadIntoMemory(z)
library(HDF5Array) y <- matrix(runif(1000), ncol=20, nrow=50) z <- as(y, "HDF5Array") ptr <- loadIntoMemory(z)