Skip to contents

This function is used to read the h5ad file, a popular file format for storing and sharing single-cell RNA sequencing data. The **anndata** package is needed to use this function.

Usage

readInput_h5ad(h5ad_file, removeSuffix = FALSE, addPrefix = NULL)

Arguments

h5ad_file

H5ad file of sc/snRNA-seq data

removeSuffix

Logical, whether to remove the suffix "-1" when present in all cell barcodes. Default: TRUE.

addPrefix

Character or NULL, add a prefix to the cell barcodes, like Sample ID. It is highly recommended to use a prefix containing letters and/or numbers only, and not starting with numbers. Default: NULL.

Value

A AnnData object containing "X" (a observations x variables data matrix), "obs" (data frame of observations), "var" (data frame of variables) and more. For more details, please check out https://anndata.readthedocs.io/en/latest/generated/anndata.AnnData.html.

Examples

h5ad_file <- system.file("extdata/demo_inputs/h5ad_file/demoData4.h5ad", package = "scMINER") # path to h5ad file
sparseMatrix <- readInput_h5ad(h5ad_file,
                               removeSuffix = FALSE,
                               addPrefix = "demoSample")
#> Reading h5ad file: /private/var/folders/v0/njhqcmrs32xgrjgx2wz8d50r0000gp/T/Rtmpf8JULY/temp_libpath11ae7194479/scMINER/extdata/demo_inputs/h5ad_file/demoData4.h5ad ...
#> Done! The sparse gene expression matrix has been generated: 1000 genes, 100 cells.