Skip to contents

Primarily designed for fetching the annotation used for visualization.

Usage

readH5ADObsVar(filename, obsKey, named = TRUE, categoricalAsFactor = TRUE)

Arguments

filename

File path to the H5AD file.

obsKey

The variable name to extract, must use only one character string.

named

Logical, whether to name the vector with cell IDs that came from adata.obs_names. Default TRUE.

categoricalAsFactor

Logical, whether to convert categorical variables to factors. Default TRUE.

Value

A vector of the extracted variable, or a factor if the variable is encoded to be categorical and categoricalAsFactor = TRUE.

See also

Examples

if (FALSE) {
h5adFile <- "path/to/analysis.h5ad"
cluster <- readH5ADObsVar(h5adFile, "leiden")
}