Read data from a H5AD file
Arguments
- path
Path to the H5AD file to read
- as
The type of object to return. One of:
"InMemoryAnnData": Read the H5AD file into memory as anInMemoryAnnDataobject"HDF5AnnData": Read the H5AD file as anHDF5AnnDataobject"SingleCellExperiment": Read the H5AD file as aSingleCellExperiment::SingleCellExperimentobject"Seurat": Read the H5AD file as aSeuratObject::Seuratobject
- mode
The mode to open the HDF5 file.
acreates a new file or opens an existing one for read/write.ropens an existing file for reading.r+opens an existing file for read/write.wcreates a file, truncating any existing ones.w-/xare synonyms, creating a file and failing if it already exists.
- ...
Extra arguments provided to the
as_*conversion function for the object specified byas
See also
Other AnnData creators:
AnnData(),
as_AnnData()
Examples
h5ad_file <- system.file("extdata", "example.h5ad", package = "anndataR")
# Read the H5AD as a SingleCellExperiment object
if (requireNamespace("SingleCellExperiment", quietly = TRUE)) {
sce <- read_h5ad(h5ad_file, as = "SingleCellExperiment")
}
# Read the H5AD as a Seurat object
if (requireNamespace("SeuratObject", quietly = TRUE)) {
seurat <- read_h5ad(h5ad_file, as = "Seurat")
}