Learn R Programming

Seurat (version 3.1.1)

AddModuleScore: Calculate module scores for feature expression programs in single cells

Description

Calculate the average expression levels of each program (cluster) on single cell level, subtracted by the aggregated expression of control feature sets. All analyzed features are binned based on averaged expression, and the control features are randomly selected from each bin.

Usage

AddModuleScore(object, features, pool = NULL, nbin = 24, ctrl = 100,
  k = FALSE, assay = NULL, name = "Cluster", seed = 1,
  search = FALSE, ...)

Arguments

object

Seurat object

features

Feature expression programs in list

pool

List of features to check expression levels agains, defaults to rownames(x = object)

nbin

Number of bins of aggregate expression levels for all analyzed features

ctrl

Number of control features selected from the same bin per analyzed feature

k

Use feature clusters returned from DoKMeans

assay

Name of assay to use

name

Name for the expression programs

seed

Set a random seed

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

...

Extra parameters passed to UpdateSymbolList

Value

Returns a Seurat object with module scores added to object meta data

References

Tirosh et al, Science (2016)

Examples

Run this code
# NOT RUN {
cd_features <- list(c(
  'CD79B',
  'CD79A',
  'CD19',
  'CD180',
  'CD200',
  'CD3D',
  'CD2',
  'CD3E',
  'CD7',
  'CD8A',
  'CD14',
  'CD1C',
  'CD68',
  'CD9',
  'CD247'
))
pbmc_small <- AddModuleScore(
  object = pbmc_small,
  features = cd_features,
  ctrl = 5,
  name = 'CD_Features'
)
head(x = pbmc_small[])
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab