Skip to contents

Run ontology term enrichment testing on differential features for each of the identity classes. Runs fgsea::fgsea() on differential testing results from each identity class.

Usage

EnrichedTerms(
  object,
  terms,
  group.by = NULL,
  assay = NULL,
  var.features = TRUE,
  scoreType = "std",
  direction = c("up", "down", "both"),
  top.n = NULL,
  padj.cutoff = 0.05,
  verbose = TRUE,
  ...
)

Arguments

object

A Seurat object.

terms

Ontology term list. The name of each element in the list should be an ontology term, and the list elements a vector of feature names present in the assay.

group.by

Name of grouping variable to use. If NULL, use the active cell identities.

assay

Name of assay to use. If NULL, use the default assay.

var.features

Restrict the analysis to variable features. When TRUE (the default), differential testing is performed only on the variable features of the assay, so the ranked list scored by fgsea::fgsea() (the enrichment universe) and the term gene sets are evaluated within the same variable-feature space. Requires variable features to be set for the assay (e.g. with FindTopFeatures()).

scoreType

scoreType parameter for fgsea::fgseaSimple(). Options are "std", "pos", "neg" (two-tailed or one-tailed tests).

direction

Which direction of enrichment to retain. "up" (default) keeps terms with positive NES (enriched in the identity class), "down" keeps terms with negative NES (depleted), and "both" retains both and orders terms by abs(NES). When scoreType is "pos" or "neg" only one direction is testable, so set direction accordingly.

top.n

Number of top enriched terms to retain for each set of cells. If NULL, retain all terms.

padj.cutoff

Maximum adjusted p-value for a term to be retained.

verbose

Display messages.

...

Additional arguments passed to Seurat::FindMarkers()

Value

Returns a named list of dataframes. Each element of the list contains a dataframe with the term enrichment results for an identity class.