This function will output the corresponding feature module for a specified vector of genes from a celda_CG or celda_G celdaModel. features must match the rownames of sce.

featureModuleLookup(
  sce,
  features,
  altExpName = "featureSubset",
  exactMatch = TRUE,
  by = "rownames"
)

# S4 method for SingleCellExperiment
featureModuleLookup(
  sce,
  features,
  altExpName = "featureSubset",
  exactMatch = TRUE,
  by = "rownames"
)

Arguments

sce

A SingleCellExperiment object returned by celda_G, or celda_CG, with the matrix located in the useAssay assay slot. Rows represent features and columns represent cells.

features

Character vector. Identify feature modules for the specified feature names. feature must match the rownames of sce.

altExpName

The name for the altExp slot to use. Default "featureSubset".

exactMatch

Logical. Whether to look for exactMatch of the gene name within counts matrix. Default TRUE.

by

Character. Where to search for features in the sce object. If set to "rownames" then the features will be searched for among rownames(sce). This can also be set to one of the colnames of rowData(sce). Default "rownames".

Value

Numeric vector containing the module numbers for each feature. If the feature was not found, then an NA value will be returned in that position. If no features were found, then an error will be given.

Examples

data(sceCeldaCG) module <- featureModuleLookup(sce = sceCeldaCG, features = c("Gene_1", "Gene_XXX"))
#> Warning: The following features were not present in 'x': Gene_XXX