plot_heatmap: Plot heatmap

View source: R/check_batch_effects.R

plot_heatmapR Documentation

Plot heatmap

Description

Plot heatmap with predefined color scheme based on type.

Usage

plot_heatmap(matrix, type, title = NULL)

Arguments

matrix

Matrix. Values to be plotted.

type

Character. Type of heatmap ('pval' for P-values and 'r2' for absolute adjusted r^2).

title

Character. Title of the plot.

Value

Heatmap as Heatmap-class object

Examples

data("se.gene")

res.pca = calculate_mds_pca(se = se.gene,
                            method = "pca")

col.test = c("Age.of.patient",
             "Body.surface.area",
             "Duration.of.psoriasis",
             "Induration",
             "Overall.erythema",
             "Scaling",
             "Sex",
             "scan.date")

res = check_batch_effects(se = se.gene,
                          res.pca = res.pca,
                          col.test = col.test)

# plot P-values
plot_heatmap(matrix = res$pval,
             type = "pval")

# plot absolute adjusted r^2
plot_heatmap(matrix = res$r2,
             type = "r2")

szymczak-lab/QCnormSE documentation built on March 25, 2023, 1:05 p.m.