readH5AD | R Documentation |
Read raw count matrix from H5AD file. By default, readH5AD
load
specified layer into memory (inMemory = TRUE
). To use LIGER in delayed
mode for handling large datasets, set inMemory = FALSE
to load the
data as a DelayedArray
object. Note that only CSR format is supported
for the matrix.
readH5AD(filename, layer, inMemory = TRUE, obs = FALSE)
readH5ADMem(filename, layer, obs = FALSE)
readH5ADDelay(filename, layer, obs = FALSE)
filename |
Character string, path to the H5AD file. |
layer |
Character string specifying the H5 path of raw count data to be
loaded. Use |
inMemory |
Logical, whether to load the data into memory. Default
|
obs |
Logical, whether to also load the cell metadata from
|
Currently, the only supported H5AD AnnData encoding versions are as follows:
adata.X
, adata.raw.X
, or adata.layers['layer']
-
csr_matrix 0.1.0
adata.obs
and adata.var
- dataframe 0.2.0
Categoricals in a data frame - categorical 0.2.0
If users possess H5AD files encoded with older specification, please either open an issue on GitHub or use R package 'anndata' to manually extract information.
When loaded in memory, a sparse matrix of class dgCMatrix
will
be returned. When loaded in delayed mode, a TENxMatrix
object will be
returned. If obs = TRUE
, a list containing the matrix and the cell
metadata will be returned.
tempH5AD <- tempfile(fileext = '.h5ad')
writeH5AD(pbmc, tempH5AD, overwrite = TRUE)
mat <- readH5AD(tempH5AD, layer = 'X')
delayMat <- readH5AD(tempH5AD, layer = 'X', inMemory = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.