ridgeEnrichment: Visualize Enrichment Distributions Using Ridge Plots

View source: R/ridgeEnrichment.R

ridgeEnrichmentR Documentation

Visualize Enrichment Distributions Using Ridge Plots

Description

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

Usage

ridgeEnrichment(
  input.data,
  gene.set.use,
  assay = NULL,
  group.by = NULL,
  color.by = "group",
  order.by = NULL,
  scale = FALSE,
  facet.by = NULL,
  add.rug = FALSE,
  palette = "inferno"
)

Arguments

input.data

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

gene.set.use

Character(1). Name of the gene set to display.

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 *y*‑axis. Defaults to the Seurat/SCE 'ident' slot when 'NULL'.

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 centred/scaled (Z‑score) prior to plotting.

facet.by

Optional metadata column used to facet the plot.

add.rug

Logical. Draw per-cell tick marks underneath each ridge.

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)

ridgeEnrichment(pbmc, assay = "escape",
                gene.set.use = "Tcells",
                group.by = "groups")


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