p <- SCpubr::do_ExpressionHeatmap(sample.atac,
features = markers$gene_long,
assay = "chromvar",
flip = FALSE,
cluster = TRUE,
slot = "scale.data",
enforce_symmetry = TRUE,
features.order = markers$gene_long,
groups.order = list("Groups" = rev(c("Astro-like", "Cycling", "OPC-like", "RE"))),
legend.title = "Motif Score",
max.cutoff = 0.8,
min.cutoff = -0.4,
font.size = 20,
legend.length = 15,
legend.width = 0.5,
legend.framecolor = "grey50",
legend.tickcolor = "white",
legend.framewidth = 0.2,
legend.tickwidth = 0.2,
axis.text.face = "plain") +
ggplot2::labs(x = "Motif",
y = "Cell type") +
ggplot2::theme(axis.title.y.left = ggplot2::element_text(hjust = 0.5))
p$data$gene <- unname(vapply(p$data$gene, function(x){stringr::str_split(x, "-")[[1]][3]}, FUN.VALUE = character(1)))
p$data$gene <- factor(p$data$gene, levels = c(markers$gene_short))