Package 'beachmat.hdf5'

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

Help Index


Initialize HDF5-backed matrices.

Description

Initialize C++ representations of HDF5-backed matrices based on their HDF5Array representations.

Usage

## S4 method for signature 'H5SparseMatrixSeed'
initializeCpp(x, ..., memorize = FALSE)

## S4 method for signature 'HDF5ArraySeed'
initializeCpp(x, ..., memorize = FALSE)

Arguments

x

A HDF5Array seed object.

...

Further arguments, ignored.

memorize

Logical scalar specifying whether to load the matrix data in x into memory, if it has not already been loaded. See checkMemoryCache for details.

Value

An external pointer that can be used in any tatami-compatible function.

Author(s)

Aaron Lun

Examples

library(HDF5Array)
y <- matrix(runif(1000), ncol=20, nrow=50)
z <- as(y, "HDF5Array")
ptr <- initializeCpp(z)

Load a HDF5 matrix into memory

Description

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.

Usage

loadIntoMemory(x, force.integer = FALSE)

Arguments

x

A HDF5Array-derived matrix or seed object.

force.integer

Whether to force floating-point values to be integers to reduce memory consumption.

Value

An external pointer that can be used in tatami-based functions.

Author(s)

Aaron Lun

Examples

library(HDF5Array)
y <- matrix(runif(1000), ncol=20, nrow=50)
z <- as(y, "HDF5Array")
ptr <- loadIntoMemory(z)