plot_heatmap: Omic Heatmap

View source: R/plot_heatmap.R

plot_heatmapR Documentation

Omic Heatmap

Description

This function visualizes a probe by sample matrix as a heatmap.

Usage

plot_heatmap(
  dat,
  group = NULL,
  covar = NULL,
  dist = "pearson",
  p = 2L,
  top = NULL,
  filter_method = "pairwise",
  center = FALSE,
  hclustfun = "complete",
  pal_group = "npg",
  pal_covar = "Blues",
  pal_tiles = "RdBu",
  title = "Omic Heatmap"
)

Arguments

dat

Omic data matrix or matrix-like object with rows corresponding to probes and columns to samples.

group

Optional character or factor vector of length equal to sample size. Alternatively, a data frame or list of such vectors, optionally named.

covar

Optional continuous covariate of length equal to sample size. Alternatively, a data frame or list of such vectors, optionally named.

dist

Distance measure to be used. Supports all methods available in dist, Rfast::Dist, and vegdist, as well as those implemented in the bioDist package. See Details.

p

Power of the Minkowski distance.

top

Optional number (if > 1) or proportion (if < 1) of top probes to be used for t-SNE.

filter_method

String specifying whether to apply a "pairwise" or "common" filter if top is non-NULL.

center

Center each probe prior to computing distances?

hclustfun

The agglomeration method to be used for hierarchical clustering. Supports all methods available in hclust.

pal_group

String specifying the color palette to use if group is non-NULL, or a vector of such strings with length equal to the number of vectors passed to group. Options include "ggplot", all qualitative color schemes available in RColorBrewer, and the complete collection of ggsci palettes. Alternatively, a character vector of colors with length equal to the cumulative number of levels in group.

pal_covar

String specifying the color palette to use if covar is non-NULL, or a vector of such strings with length equal to the number of vectors passed to covar. Options include the complete collection of viridis palettes, as well as all sequential color schemes available in RColorBrewer. Alternatively, a character vector of colors representing a smooth gradient, or a list of such vectors with length equal to the number of continuous variables to visualize.

pal_tiles

String specifying the color palette to use for heatmap tiles. Options include the complete collection of viridis palettes, as well as all sequential and divergent color schemes available in RColorBrewer. Alternatively, a character vector of at least two colors.

title

Optional plot title.

Details

Heatmaps are a common and intuitive way to display the values of an omic data matrix, especially after top probes have been selected for closer investigation. Hierarchical clustering dendrograms cluster both the rows and the columns, revealing latent structure in the data. Annotation tracks atop the figure may be used to investigate associations with phenotypic features.

Available distance measures include: "euclidean", "maximum", "manhattan", "canberra", "minkowski", "cosine", "pearson", "kendall", "spearman", "bray", "kulczynski", "jaccard", "gower", "altGower", "morisita", "horn", "mountford", "raup", "binomial", "chao", "cao", "mahalanobis", "MI", or "KLD". Some distance measures are unsuitable for certain types of data. See dist_mat for more details on these methods and links to documentation on each.

The top argument optionally filters data using either probewise variance (if filter_method = "common") or the leading fold change method of Smyth et al. (if filter_method = "pairwise"). See plot_mds for more details.

Examples

mat <- matrix(rnorm(100 * 10), nrow = 100, ncol = 10)
grp <- rep(c("A", "B"), each = 5)
plot_heatmap(mat, group = grp)


dswatson/bioplotr documentation built on March 3, 2023, 9:43 p.m.