Wrapper for Seurat::AddModuleScore(). Calculates module scores for feature expression programs in single cells.

runMS(
  object,
  genelist,
  assay = DefaultAssay(object),
  scale = T,
  score.key = "MS",
  size = autoPointSize(ncol(object)),
  ncore = 10,
  raster = F,
  rescale = F,
  verbose = T,
  winsorize.quantiles = c(0, 1),
  return.plots = T,
  search = F,
  reduction = "umap",
  ...
)

Arguments

object

Seurat object

genelist

Named list of genesets.

assay

Assay used for expression matrix.

scale

scale module scores. Default is T.

score.key

Expression program prefix. default is "MS".

size

UMAP point size.

ncore

Number of workers for parallelized implementation. Default is 10.

raster

Convert points to raster format, default is FALSE.

rescale

rescale values from 0 to 1. Default is FALSE.

verbose

Print progress. Default is TRUE.

winsorize.quantiles

Rescale values to lie between lower and upper bound quanitle. Default = c(0,1).

return.plots

Logical to compute and return plots in results list. Default is TRUE.

search

Search for symbol synonyms for features in features that don't match features in object? Searches the HGNC's gene names database; see UpdateSymbolList for more details. Default is FALSE.

reduction

reduction slot used for visualized data. Default is "umap".

...

additional parameters passed to geom_point(...)

Value

list of results along with ggplot handles visualizing class predictions overlaid on UMAP.

See also

AddModuleScore

Author

Nicholas Mikolajewicz

Examples


# get genesets
verhaak.df <- geneSets[["Verhaak_CancerCell_2010"]]
verhaak.list <- wideDF2namedList(verhaak.df)

gsc.df <- geneSets[["Richards_NatureCancer_2021_sc"]]
gsc.list <- wideDF2namedList(gsc.df)

neftel.df <- geneSets[["GBM_Hs_Neftel2019"]]
neftel.list <- wideDF2namedList(neftel.df)

verhaak.list <- lapply(verhaak.list, toupper)
gsc.list <- lapply(gsc.list, toupper)
neftel.list <- lapply(neftel.list, toupper)

# classify cells based on provided genesets
v.auc <- runMS(object = so.query, genelist = verhaak.list)
#> Error in GetAssayData(object = object): object 'so.query' not found
v.auc$plot.max.score
#> Error in eval(expr, envir, enclos): object 'v.auc' not found

g.auc <- runMS(object = so.query, genelist = gsc.list)
#> Error in GetAssayData(object = object): object 'so.query' not found
g.auc$plot.max.score
#> Error in eval(expr, envir, enclos): object 'g.auc' not found

n.auc <- runMS(object = so.query, genelist = neftel.list)
#> Error in GetAssayData(object = object): object 'so.query' not found
n.auc$plot.max.score
#> Error in eval(expr, envir, enclos): object 'n.auc' not found