View source: R/splitEnrichment.R
splitEnrichment | R Documentation |
Visualize the distribution of gene set enrichment scores across groups using violin plots. When 'split.by' contains exactly two levels, the function draws split violins for easy group comparison within each 'group.by' category. If 'split.by' has more than two levels, standard dodged violins are drawn instead.
splitEnrichment(
input.data,
assay = NULL,
split.by = NULL,
group.by = NULL,
gene.set.use = NULL,
order.by = NULL,
facet.by = NULL,
scale = TRUE,
palette = "inferno"
)
input.data |
Output of |
assay |
Name of the assay holding enrichment scores when 'input.data' is a single‑cell object. Ignored otherwise. |
split.by |
A metadata column used to split or color violins. Must contain at least two levels. If it contains more than two, dodged violins are used. |
group.by |
Metadata column plotted on the *x*‑axis. Defaults to the Seurat/SCE 'ident' slot when 'NULL'. |
gene.set.use |
Character(1). Name of the gene set to display. |
order.by |
How to arrange the x‑axis: *'"mean"'* – groups ordered by decreasing group mean; *'"group"'* – natural sort of group labels; *'NULL'* – keep original ordering. |
facet.by |
Optional metadata column used to facet the plot. |
scale |
Logical; if 'TRUE' scores are centred/scaled (Z‑score) prior to plotting. |
palette |
Character. Any palette from |
A [ggplot2] object.
gs <- list(Bcells = c("MS4A1", "CD79B", "CD79A", "IGH1", "IGH2"),
Tcells = c("CD3E", "CD3D", "CD3G", "CD7","CD8A"))
pbmc <- SeuratObject::pbmc_small |>
runEscape(gene.sets = gs, min.size = NULL)
splitEnrichment(input.data = pbmc,
assay = "escape",
split.by = "groups",
gene.set.use = "Tcells")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.