densityEnrichment: Visualize Mean Density Ranking of Genes Across Gene Sets

View source: R/densityEnrichment.R

densityEnrichmentR Documentation

Visualize Mean Density Ranking of Genes Across Gene Sets

Description

This function allows to the user to examine the mean ranking within the groups across the gene set. The visualization uses the density function to display the relative position and distribution of rank.

Usage

densityEnrichment(
  input.data,
  gene.set.use,
  gene.sets,
  group.by = NULL,
  rug.height = 0.02,
  palette = "inferno"
)

Arguments

input.data

A Seurat object or a SingleCellExperiment.

gene.set.use

Character(1). Name of the gene set to display.

gene.sets

A named list of character vectors, the result of [getGeneSets()], or the built-in data object [escape.gene.sets].

group.by

Metadata column. Defaults to the Seurat/SCE 'ident' slot when 'NULL'.

rug.height

Vertical spacing of the hit rug as a fraction of the y-axis (default '0.02').

palette

Character. Any palette from hcl.pals.

Value

A 'patchwork'/'ggplot2' object.

Examples

gs <- list(Bcells = c("MS4A1", "CD79B", "CD79A", "IGH1", "IGH2"),
           Tcells = c("CD3E", "CD3D", "CD3G", "CD7","CD8A"))
           
pbmc_small <- SeuratObject::pbmc_small
                        
densityEnrichment(pbmc_small, 
                  gene.set.use = "Tcells",
                  gene.sets = gs)


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