do_EnrichmentHeatmap {SCpubr} | R Documentation |
Create enrichment scores heatmaps.
Description
This function computes the enrichment scores for the cells using AddModuleScore and then aggregates the scores by the metadata variables provided by the user and displays it as a heatmap, computed by Heatmap.
Usage
do_EnrichmentHeatmap(
sample,
input_gene_list,
features.order = NULL,
groups.order = NULL,
cluster = TRUE,
scale_scores = TRUE,
assay = NULL,
slot = NULL,
reduction = NULL,
group.by = NULL,
verbose = FALSE,
na.value = "grey75",
legend.position = "bottom",
use_viridis = FALSE,
viridis.palette = "G",
viridis.direction = 1,
legend.framewidth = 0.5,
legend.tickwidth = 0.5,
legend.length = 20,
legend.width = 1,
legend.framecolor = "grey50",
legend.tickcolor = "white",
legend.type = "colorbar",
font.size = 14,
font.type = "sans",
axis.text.x.angle = 45,
enforce_symmetry = FALSE,
nbin = 24,
ctrl = 100,
flavor = "Seurat",
legend.title = NULL,
ncores = 1,
storeRanks = TRUE,
min.cutoff = NA,
max.cutoff = NA,
pt.size = 1,
plot_cell_borders = TRUE,
border.size = 2,
return_object = FALSE,
number.breaks = 5,
sequential.palette = "YlGnBu",
diverging.palette = "RdBu",
diverging.direction = -1,
sequential.direction = 1,
flip = FALSE,
grid.color = "white",
border.color = "black",
plot.title.face = "bold",
plot.subtitle.face = "plain",
plot.caption.face = "italic",
axis.title.face = "bold",
axis.text.face = "plain",
legend.title.face = "bold",
legend.text.face = "plain"
)
Arguments
sample |
|
input_gene_list |
|
features.order |
|
groups.order |
|
cluster |
|
scale_scores |
|
assay |
|
slot |
|
reduction |
|
group.by |
|
verbose |
|
na.value |
|
legend.position |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
legend.framewidth , legend.tickwidth |
|
legend.length , legend.width |
|
legend.framecolor |
|
legend.tickcolor |
|
legend.type |
|
font.size |
|
font.type |
|
axis.text.x.angle |
|
enforce_symmetry |
|
nbin |
|
ctrl |
|
flavor |
|
legend.title |
|
ncores |
|
storeRanks |
|
min.cutoff , max.cutoff |
|
pt.size |
|
plot_cell_borders |
|
border.size |
|
return_object |
|
number.breaks |
|
sequential.palette |
|
diverging.palette |
|
diverging.direction |
|
sequential.direction |
|
flip |
|
grid.color |
|
border.color |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face |
|
Value
A ggplot2 object.
Examples
# Check Suggests.
value <- SCpubr:::check_suggests(function_name = "do_EnrichmentHeatmap", passive = TRUE)
if (isTRUE(value)){
# Consult the full documentation in https://enblacar.github.io/SCpubr-book/
# Define your Seurat object.
sample <- readRDS(system.file("extdata/seurat_dataset_example.rds", package = "SCpubr"))
# Genes have to be unique.
genes <- list("A" = rownames(sample)[1:5],
"B" = rownames(sample)[6:10],
"C" = rownames(sample)[11:15])
# Default parameters.
p <- SCpubr::do_EnrichmentHeatmap(sample = sample,
input_gene_list = genes,
nbin = 1,
ctrl = 10)
p
} else if (base::isFALSE(value)){
message("This function can not be used without its suggested packages.")
message("Check out which ones are needed using `SCpubr::state_dependencies()`.")
}