pcaEnrichment: Visualize the PCA of Enrichment Values

View source: R/pcaEnrichment.R

pcaEnrichmentR Documentation

Visualize the PCA of Enrichment Values

Description

This function allows to the user to examine the distribution of principal components run on the enrichment values.

Usage

pcaEnrichment(
  input.data,
  dimRed = NULL,
  x.axis = "PC1",
  y.axis = "PC2",
  facet.by = NULL,
  style = c("point", "hex"),
  add.percent.contribution = TRUE,
  display.factors = FALSE,
  number.of.factors = 10,
  palette = "inferno"
)

Arguments

input.data

Single‑cell object (Seurat / SCE) **or** the raw list returned by ['performPCA()'].

dimRed

Name of the dimensional‑reduction slot to pull from a single‑cell object. Ignored when 'input.data' is the list output.

x.axis, y.axis

Character vectors naming the PCs to display (e.g. "PC1").

facet.by

Metadata column to facet plot.

style

"point" (default) or "hex".

add.percent.contribution

Include percent variance explained in axis labels.

display.factors

Draw arrows for the top gene‑set loadings.

number.of.factors

Integer; how many loadings to display if 'display.factors = TRUE'.

palette

Character. Any palette from hcl.pals.

#' @examples GS <- list(Bcells = c("MS4A1", "CD79B", "CD79A", "IGH1", "IGH2"), Tcells = c("CD3E", "CD3D", "CD3G", "CD7","CD8A")) pbmc_small <- SeuratObject::pbmc_small pbmc_small <- runEscape(pbmc_small, gene.sets = GS, min.size = NULL)

pbmc_small <- performPCA(pbmc_small, assay = "escape")

pcaEnrichment(pbmc_small, x.axis = "PC1", y.axis = "PC2", dimRed = "escape.PCA")

Value

A **ggplot2** object.


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