do_SCEnrichmentHeatmap() | Single-cell enrichment heatmaps

Single-cell enrichment heatmaps display enrichment scores at individual cell resolution. Similar to do_SCExpressionHeatmap but for gene set scores instead of individual genes.


Basic usage

gene_lists <- list(
  "IPC.like"      = c("CDC25C", "KIF18B", "KIF14", "CENPE"),
  "Cilia.like" = c("DNAAF1", "ADGB", "CFAP61", "CFAP157"),
  "OPC.like" = c("KCNQ5", "MEOX2", "MBP", "SNTG1"),
  "Mesenchymal.like" = c("S100A1", "MGP", "TNNT1", "H2AFJ")
)

p <- SCpubr::do_SCEnrichmentHeatmap(sample = sample,
                                    input_gene_list = gene_lists)
p


Add metadata tracks

p <- SCpubr::do_SCEnrichmentHeatmap(
  sample          = sample,
  input_gene_list = gene_lists,
  metadata        = c("Annotation", "subtype")
)
p


Scoring methods

Use flavor = "Seurat" or flavor = "UCell" to toggle different scoring methods.


Subsampling

p <- SCpubr::do_SCEnrichmentHeatmap(sample = sample,
                                    input_gene_list = gene_lists,
                                    subsample = 5)
p


Return enriched object

result <- SCpubr::do_SCEnrichmentHeatmap(sample = sample,
                                         input_gene_list = gene_lists,
                                         return_object = TRUE)

p <- result$plot
sample_enriched <- result$object

Parameter reference

Note

For parameters shared across many functions (color palettes, typography, legend styling), see Shared features.

Core parameters

Parameter Description Default
input_gene_list Named list of gene signatures

Scoring method

Parameter Description Default
flavor "Seurat" or "UCell" "Seurat"
nbin Bins for Seurat scoring 24
ctrl Control genes per bin 100
ncores CPU cores for UCell 1

Metadata tracks

Parameter Description Default
metadata Metadata columns to display NULL
metadata.colors Named list of colors NULL

Layout

Parameter Description Default
proportional.size Equal space per group TRUE
main.heatmap.size Main heatmap proportion 0.95
subsample Max cells per group NA
cluster Cluster gene sets TRUE
return_object Return Seurat object FALSE

See also