geyserEnrichment: Visualize Enrichment Distributions Using Geyser Plots

View source: R/geyserEnrichment.R

geyserEnrichmentR Documentation

Visualize Enrichment Distributions Using Geyser Plots

Description

This function allows to the user to examine the distribution of enrichment across groups by generating a geyser plot.

Usage

geyserEnrichment(
  input.data,
  assay = NULL,
  group.by = NULL,
  gene.set,
  color.by = "group",
  order.by = NULL,
  scale = FALSE,
  facet.by = NULL,
  summarise.by = NULL,
  summary.stat = "mean",
  palette = "inferno"
)

Arguments

input.data

Output of escape.matrix or a single‑cell object previously processed by runEscape.

assay

Name of the assay holding enrichment scores when 'input.data' is a single‑cell object. Ignored otherwise.

group.by

Metadata column plotted on the *x*‑axis. Defaults to the Seurat/SCE 'ident' slot when 'NULL'.

gene.set

Character(1). Gene‑set to plot (must exist in the enrichment matrix).

color.by

Aesthetic mapped to point color. Use either *"group"* (default = 'group.by') for categorical coloring or the *name of a gene‑set* (e.g. same as 'gene.set') to obtain a numeric accepted.

order.by

How to arrange the x‑axis: *'"mean"'* – groups ordered by decreasing group mean; *'"group"'* – natural sort of group labels; *'NULL'* – keep original ordering.

scale

Logical; if 'TRUE' scores are centered/scaled (Z‑score) prior to plotting.

facet.by

Optional metadata column used to facet the plot.

summarise.by

Optional metadata column used to summarise data.

summary.stat

Optional method used to summarize expression within each group defined by summarise.by. One of: "mean" (default), "median", "max", "sum", or "geometric".

palette

Character. Any palette from hcl.pals.

Value

A ggplot2 object.

Examples

gs <- list(Bcells = c("MS4A1", "CD79B", "CD79A", "IGH1", "IGH2"),
           Tcells = c("CD3E", "CD3D", "CD3G", "CD7","CD8A"))
           
pbmc <- SeuratObject::pbmc_small |>
  runEscape(gene.sets = gs,
            min.size = NULL)

geyserEnrichment(pbmc, 
                 assay = "escape", 
                 gene.set = "Tcells")


ncborcherding/escape documentation built on June 12, 2025, 1 p.m.