read10XH5 | R Documentation |
Read count matrix from 10X CellRanger HDF5 file. By default, read10XH5
load scRNA, scATAC or multimodal data 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. The
delayed mode only supports scRNA data for now.
read10XH5(filename, inMemory = TRUE, useNames = TRUE, featureMakeUniq = TRUE)
read10XH5Mem(filename, useNames = TRUE, featureMakeUniq = TRUE)
read10XH5Delay(filename, useNames = TRUE, featureMakeUniq = TRUE)
filename |
Character string, path to the HDF5 file. |
inMemory |
Logical, whether to load the data into memory. Default
|
useNames |
Logical, whether to use gene names as row names. Default
|
featureMakeUniq |
Logical, whether to make gene names unique. Default
|
A sparse matrix when only using older CellRanger output HDF5 file or when only one genome and one modality is detected. When multiple genomes are available, will return a list for each genome. When using multimodal data, each genome will be a list of matrices for each modality. The matrix will be of dgCMatrix class when in memory, or a TENxMatrix object when in delayed mode.
matrix <- read10XH5(
filename = system.file("extdata/ctrl.h5", package = "rliger"),
inMemory = TRUE
)
class(matrix) # Should show dgCMatrix
if (requireNamespace("HDF5Array", quietly = TRUE)) {
matrix <- read10XH5(
filename = system.file("extdata/ctrl.h5", package = "rliger"),
inMemory = FALSE
)
print(class(matrix)) # Should show TENxMatrix
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.