Wraps gplots::heatmap.2() with complete-linkage/Euclidean clustering, a
diverging RdBu palette sized to the data range, row side-colors from
cutree() cluster assignment, and column side-colors derived from
annotation's group column — then writes the result straight to file
as a png (the function has no return value; it is called for this side
effect).
Usage
plot_heatmap(
mat,
annotation,
level,
group,
n_clust = 5,
width = 24,
height = 24,
units = "cm",
res = 100,
keysize = 0.9,
file,
...
)Arguments
- mat
Numeric matrix to cluster and plot (e.g. output of
get_mat_log2area()).- annotation
Annotation data frame; must contain the
levelandgroupcolumns (levelmatchesmat's column names,groupcolors them).- level
Column (string) in
annotationmatchingmat's columns.- group
Column (string) in
annotationused to color columns.- n_clust
Number of row clusters to cut the dendrogram into.
- width, height, units, res
Passed to
grDevices::png().- keysize
Passed to
gplots::heatmap.2().- file
Output png file path.
- ...
Additional arguments passed to
gplots::heatmap.2().
Examples
if (FALSE) { # \dontrun{
plot_heatmap(mat_log2area, annotation, level = "Sample", group = "Condition",
file = file.path("4_figures", "hm_pep_all_log2area_br_nonscaled.png"))
} # }