plot_heatmap: Plot Heatmap

View source: R/app_heatmap.R

plot_heatmapR Documentation

Plot Heatmap

Description

Generate a heatmap visualization of a features x samples matrix of measurements.

Usage

plot_heatmap(
  tomic,
  feature_var = NULL,
  sample_var = NULL,
  value_var = NULL,
  cluster_dim = "both",
  distance_measure = "dist",
  hclust_method = "ward.D2",
  change_threshold = Inf,
  plot_type = "grob",
  max_display_features = 800,
  x_label = NULL,
  y_label = NULL,
  colorbar_label = NULL
)

Arguments

tomic

Either a tidy_omic or triple_omic object

feature_var

variable from "features" to use as a unique feature label.

sample_var

variable from "samples" to use as a unique sample label.

value_var

which variable in "measurements" to use for quantification.

cluster_dim

rows, columns, or both

distance_measure

variable to use for computing dis-similarity

corr

pearson correlation

dist

euclidean distance

hclust_method

method from stats::hclust to use for clustering

change_threshold

values with a more extreme absolute change will be thresholded to this value.

plot_type

plotly (for interactivity) or grob (for a static ggplot)

max_display_features

aggregate and downsample distinct feature to this number to speed to up heatmap rendering.

x_label

label for x-axis (if NULL then use feature_var)

y_label

label for y-axis (if NULL then use sample_var)

colorbar_label

label for color-bar; default is log2 abundance

Value

a ggplot2 grob

Examples


library(dplyr)

tomic <- brauer_2008_triple %>%
  filter_tomic(
    filter_type = "category",
    filter_table = "features",
    filter_variable = "BP",
    filter_value = c(
      "protein biosynthesis",
      "rRNA processing", "response to stress"
    )
  )

plot_heatmap(
  tomic = tomic,
  value_var = "expression",
  change_threshold = 5,
  cluster_dim = "rows",
  plot_type = "grob",
  distance_measure = "corr"
)

romic documentation built on Sept. 21, 2023, 9:06 a.m.