ridgeEnrichment: Visualize enrichment results with a ridge plot

View source: R/ridgeEnrichment.R

ridgeEnrichmentR Documentation

Visualize enrichment results with a ridge plot

Description

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

Usage

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

Arguments

input.data

Enrichment output from escape.matrix or runEscape.

assay

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

group.by

Categorical parameter to plot along the x.axis. If input is a single-cell object the default will be cluster.

gene.set

Gene set to plot (on y-axis).

color.by

How the color palette applies to the graph - can be "group" for a categorical color palette based on the group.by parameter or use the gene.set name if wanting to apply a gradient palette.

order.by

Method to organize the x-axis: "mean" will arrange the x-axis by the mean of the gene.set, while "group" will arrange the x-axis by in alphanumerical order. Using NULL will not reorder the x-axis.

scale

Visualize raw values FALSE or Z-transform enrichment values TRUE.

facet.by

Variable to facet the plot into n distinct graphs.

add.rug

Add visualization of the discrete cells along the ridge plot (TRUE).

palette

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

Value

ggplot2 object with ridge-based distributions of selected gene.set

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)
                        
ridgeEnrichment(pbmc_small, 
                assay = "escape",
                gene.set = "Tcells")
                
ridgeEnrichment(pbmc_small, 
                assay = "escape",
                gene.set = "Tcells", 
                color.by = "Tcells")


ncborcherding/escape documentation built on Nov. 6, 2024, 1:43 p.m.