View source: R/do_ExpressionHeatmap.R
do_ExpressionHeatmap | R Documentation |
This function generates a heatmap with averaged expression values by the unique groups of the metadata variables provided by the user.
do_ExpressionHeatmap(
sample,
features,
group.by = NULL,
assay = NULL,
cluster = TRUE,
features.order = NULL,
groups.order = NULL,
slot = "data",
legend.title = "Avg. Expression",
na.value = "grey75",
legend.position = "bottom",
legend.width = 1,
legend.length = 20,
legend.framewidth = 0.5,
legend.tickwidth = 0.5,
legend.framecolor = "grey50",
legend.tickcolor = "white",
legend.type = "colorbar",
font.size = 14,
font.type = "sans",
axis.text.x.angle = 45,
enforce_symmetry = FALSE,
min.cutoff = NA,
max.cutoff = NA,
diverging.palette = "RdBu",
diverging.direction = -1,
sequential.palette = "YlGnBu",
sequential.direction = 1,
number.breaks = 5,
use_viridis = FALSE,
viridis.palette = "G",
viridis.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"
)
sample |
|
features |
|
group.by |
|
assay |
|
cluster |
|
features.order |
|
groups.order |
|
slot |
|
legend.title |
|
na.value |
|
legend.position |
|
legend.length , legend.width |
|
legend.framewidth , legend.tickwidth |
|
legend.framecolor |
|
legend.tickcolor |
|
legend.type |
|
font.size |
|
font.type |
|
axis.text.x.angle |
|
enforce_symmetry |
|
min.cutoff , max.cutoff |
|
diverging.palette |
|
diverging.direction |
|
sequential.palette |
|
sequential.direction |
|
number.breaks |
|
use_viridis |
|
viridis.palette |
|
viridis.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 |
|
A ggplot2 object.
# Check Suggests.
value <- SCpubr:::check_suggests(function_name = "do_ExpressionHeatmap", 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"))
# Define list of genes.
genes <- rownames(sample)[1:10]
# Default parameters.
p <- SCpubr::do_ExpressionHeatmap(sample = sample,
features = genes,
viridis.direction = -1)
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()`.")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.