plot_correlation_heatmap: Plot a Correlation Heatmap

View source: R/plotting_qc.R

plot_correlation_heatmapR Documentation

Plot a Correlation Heatmap

Description

This function creates a heatmap using ComplexHeatmap to display the correlation values in a matrix. The color of each cell in the heatmap is determined by the corresponding correlation value, using a color ramp that ranges from the minimum value color to a maximum value color.

Usage

plot_correlation_heatmap(
  mat,
  min.color = "#FF0000",
  max.color = "#0000FF",
  legend.title = "Pearson Corr.",
  plot.title = "Correlation Matrix"
)

Arguments

mat

A matrix containing the correlation values.

min.color

Character scalar for the hexadecimal color code for the minimum values in the heatmap.

max.color

Character scalar for the hexadecimal color code for the maximum values in the heatmap.

legend.title

Character scalar for title of the legend.

plot.title

Character scalar for title of the plot.

Value

A Heatmap object.

Author(s)

Jared Andrews

Examples

library(CRISPRball)
norm.counts <- read.delim(system.file("extdata", "escneg.count_normalized.txt",
    package = "CRISPRball"
), check.names = FALSE)
norm.counts <- as.matrix(norm.counts[, c(-1, -2)])
norm.counts.log <- log2(norm.counts + 1)
cor.mat <- cor(norm.counts.log)
plot_correlation_heatmap(cor.mat)

j-andrews7/CRISPRball documentation built on Nov. 8, 2024, 2:43 a.m.