plot_PCcor_heatmap: Plot a heatmap of correlations between PCs and other sample...

View source: R/plot_PCcor_heatmap.R

plot_PCcor_heatmapR Documentation

Plot a heatmap of correlations between PCs and other sample variables

Description

This is a wrapper for ComplexHeatmap::Heatmap, designed to make plotting of PC correlations more automated. It also provides a nicer default color palette than the ComplexHeatmap::Heatmap default.

Usage

plot_PCcor_heatmap(
  PCcor_result,
  filename = NULL,
  plotdims = c(9, 9),
  my_heatmap_cols,
  center_colors_zero = TRUE,
  PC_dendro = FALSE,
  var_dendro = FALSE,
  orientation = "horizontal",
  remove_all_NA_cols = TRUE,
  ...
)

Arguments

PCcor_result

a numeric matrix or data.frame, generally the result of calc_PCcors. Should have annotation variables as columns and PCs as rows.

filename

a character string. If provided, the function outputs a pdf of the plot, named "filename.pdf". If not provided, the function prints to a plotting window.

plotdims

a numeric vector, the size (in inches) of the plotting object (if outputting to a file)

my_heatmap_cols

a vector of color names, typically the result of a call to colorRampPalette. Default is a blue (low) to white (middle) to red (high) palette.

center_colors_zero

logical, whether to center the color scale on 0. Ignored if my_heatmap_cols is specified. Defaults to TRUE.

PC_dendro, var_dendro

logical, whether to include the row and/or columns dendrogram(s). Both default to FALSE.

orientation

character, either "horizontal" or "vertical", specifying the direction to plot the correlations. If "horizontal" (the default), PCs are rows and other variables are columns. If "vertical", PCs are columns and other variables are rows. Partial matches are allowed.

remove_all_NA_cols

logical, whether to remove variables where all the correlation values are NA. Defaults to TRUE.

...

(optional) additional arguments passed to ComplexHeatmap::Heatmap.


BenaroyaResearch/RNAseQC documentation built on July 8, 2023, 2:26 a.m.