scatterEnrichment: Generate a density-based scatter plot

View source: R/scatterEnrichment.R

scatterEnrichmentR Documentation

Generate a density-based scatter plot

Description

This function allows to the user to examine the distribution of 2 gene sets along the x.axis and y.axis. The color gradient is generated using the a density estimate. See ggpointdensity) for more information.

Usage

scatterEnrichment(
  input.data,
  assay = NULL,
  x.axis = NULL,
  y.axis = NULL,
  scale = FALSE,
  facet.by = NULL,
  style = "point",
  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.

x.axis

Gene set to plot on the x.axis.

y.axis

Gene set to plot on the y.axis. group.by parameter or use the gene.set name if wanting to apply a gradient palette.

scale

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

facet.by

Variable to facet the plot into n distinct graphs.

style

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

palette

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

Value

ggplot2 object with a scatter plot of selected gene.sets

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)
                        
scatterEnrichment(pbmc_small, 
                  assay = "escape",
                  x.axis = "Tcells",
                  y.axis = "Bcells")


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