You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! Thank you so much for such an awesome package. I don't know how you came up with this stuff, but God bless you for it!
I constructed the following heatmap, but upon saving it to both png and pdf format, I realized that the annotation_textbox did not scale with the rest of heatmap. I was wondering if you knew how to fix this. Also, is there a way to remove the slice names when splitting the heatmap?
Hello! Thank you so much for such an awesome package. I don't know how you came up with this stuff, but God bless you for it!
I constructed the following heatmap, but upon saving it to both png and pdf format, I realized that the annotation_textbox did not scale with the rest of heatmap. I was wondering if you knew how to fix this. Also, is there a way to remove the slice names when splitting the heatmap?
Heatmap Plotting Function (from Scillus Package):
` plot_heatmap <- function(dataset,
markers,
sort_var = c('seurat_clusters'),
anno_var,
anno_colors,
hm_limit = c(-2, 0, 2),
hm_colors = c("#4575b4","white","#d73027"),
n = 8,
row_split = NULL,
left_annotation = NULL,
variable_annotation_side = "right",
row_font_size = 12) {
} `
Code to Create Heatmap:
`
row_anno <- rowAnnotation(Module = anno_empty(border = F, width = max_text_width(unlist(hub_genes_list), gp = gpar(fontsize = 8)) + unit(4, "mm")))
row_subsections <- lengths(genes_in_modules)
row_chunks <- rep(seq(1:length(row_subsections)), row_subsections)
row_split = data.frame(row_chunks)
row_split$row_chunks <- rep(module_order, row_subsections)
heatmap_annotation_full <- rowAnnotation(
Hub_Genes = anno_textbox(align_to = row_chunks,
text = plyr::rename(hub_genes_list, replace = c(seq(1:20)) %>% magrittr::set_names(names(hub_genes_list))),
background_gp = gpar(fill = "white", col = "grey"),
gp = gpar(col = "black", fontsize = 6),
add_new_line = TRUE,
side = "left"),
Module = anno_block(gp = gpar(fill = names(hub_genes_list))),
show_annotation_name = FALSE)
png(filename = "Output Files/Metacells/Images/Module Gene Expression Heatmap.png", width = 15, height = 12, units = "in", res = 720)
plot_heatmap(dataset = metacell,
markers = scaled_genes,
sort_var = c("Cell_Subtype", "Pseudotime"),
anno_var = c("Cell_Subtype", "Fine_Status"),
anno_colors = list(cell_type_cols,
status_cols),
hm_limit = c(quantile(metacell@assays$RNA@scale.data, 0.02),
0,
quantile(metacell@assays$RNA@scale.data, 0.98)),
hm_colors = c("blue","white","red"),
row_split = row_split,
left_annotation = heatmap_annotation_full,
variable_annotation_side = "right",
row_font_size = 6)
dev.off()
`
p.pdf
The text was updated successfully, but these errors were encountered: