heatmapEnrichment: Generate a heatmap to visualize enrichment values

View source: R/heatmapEnrichment.R

heatmapEnrichmentR Documentation

Generate a heatmap to visualize enrichment values

Description

This function allows to the user to examine the heatmap with the mean enrichment values by group. The heatmap will have the gene sets as rows and columns will be the grouping variable.

Usage

heatmapEnrichment(
  input.data,
  assay = NULL,
  group.by = NULL,
  gene.set.use = "all",
  cluster.rows = FALSE,
  cluster.columns = FALSE,
  scale = FALSE,
  facet.by = NULL,
  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.use

Selected gene sets to visualize. If "all", the heatmap will be generated across all gene sets.

cluster.rows

Use Euclidean distance to order the row values.

cluster.columns

Use Euclidean distance to order the column values.

scale

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

facet.by

Variable to facet the plot into n distinct graphs.

palette

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

Value

ggplot2 object with heatmap of mean enrichment values

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)
                        
heatmapEnrichment(pbmc_small, 
                  assay = "escape")


ncborcherding/escape documentation built on Aug. 6, 2024, 8:22 p.m.