Function to generate a correlation heatmap. Includes dendrogram and clustering of the data.
# S3 method for class 'correlation.heatmap'
plot(
DEprot.object,
correlation.method = "pearson",
sample.subset = NULL,
which.data = "imputed",
palette = viridis::mako(100, direction = -1),
correlation.scale.limits = c(0, 1),
exclude.diagonal = FALSE,
dendrogram.position = "left",
dendrogram.color = "black",
dendrogram.linewidth = 0.5,
display.values = TRUE,
values.color = NULL,
values.decimals = 2,
values.font.size = 2,
values.transparency = 1,
plot.title = paste0("**", stringr::str_to_title(correlation.method), " correlation**"),
plot.subtitle = NULL,
clustering.method = "complete"
)
An object of class DEprot
.
String indicating the clustering method to use to generate the correlation matrix. Possible options: 'pearson', 'spearman', 'kendall'. Default: "pearson"
.
Vector indicating the name of the columns (column.id
in the metadata table) to use/subset for the correlation. Default: NULL
(no subsetting).
String indicating which type of counts should be used. One among: 'raw', 'normalized', 'norm', 'imputed', 'imp'. Default: "imputed"
.
Vector of colors corresponding to the palette to use for the heatmap color scale. Default: viridis::mako(100, direction = -1)
.
Two-elements vector to indicate lower and higher limits, respectively, to apply to the correlation coefficient color scale. Default: c(0,1)
.
String indicating the position of the dendrogram. One among: "top", "bottom", "left", "right". Default: "left"
.
String indicating the color of the dendrogram lines. Default: "black"
.
Numeric value indicating the line.width of the dendrogram. Default: "black"
.
Logical value indicating whether the correlation coefficient should be displayed for each cell. Default: TRUE
.
String indicating the color to use for the correlation coefficient labels. Default: "NULL"
: colors will be assigned automatically depending on the background contrast, white for dark colors and black for light ones.
Numeric value indicating the number of decimals at which round the correlation coefficient labels. Default: 2
.
Numeric value indicating the font size of the correlation coefficient labels. Default: 2
.
Numeric value between 0-1 indicating the transparency (alpha) of the correlation coefficient labels. Default: 1
, full color.
String indicating the main title of the plot. Default: paste(stringr::str_to_title(correlation.method), "correlation")
.
String indicating the subtitle of the plot. Default: NULL
.
String indicating the clustering method to use. The value should be (an unambiguous abbreviation of) one among: 'ward.D', 'ward.D2', 'single', 'complete', 'average' (= UPGMA), 'mcquitty' (= WPGMA), 'median' (= WPGMC) or 'centroid' (= UPGMC).
A DEprot.correlation
with the correlation heatmap in ggplot format.