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 = "point",
  add.percent.contribution = TRUE,
  display.factors = FALSE,
  number.of.factors = 10,
  palette = "inferno"
)

Arguments

input.data

PCA from performPCA.

dimRed

Name of the dimensional reduction to plot if data is a single-cell object.

x.axis

Component to plot on the x.axis.

y.axis

Component set to plot on the y.axis.

facet.by

Variable to facet the plot into n distinct graphs.

style

Return a "hex" bin plot or a "point"-based plot.

add.percent.contribution

Add the relative percent of contribution of the selected components to the axis labels.

display.factors

Add an arrow overlay to show the direction and magnitude of individual gene sets on the PCA dimensions.

number.of.factors

The number of gene.sets to display on the overlay.

palette

Colors to use in visualization - input any hcl.pals.

Value

ggplot2 object with PCA distribution

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")


ncborcherding/escape documentation built on Dec. 1, 2024, 8:12 a.m.