Learn R Programming

inDAGO (version 1.0.0)

HeatmapExp: HeatmapExp

Description

Plot a heatmap of the top variable genes across samples.

Usage

HeatmapExp(
  x,
  ColorPanel,
  scale,
  cutree_rows,
  cutree_cols,
  cluster,
  show_names,
  NumGenes
)

Value

A "pheatmap" object containing the heatmap and clustering information.

Arguments

x

Numeric matrix of log-CPM values (genes × samples), e.g., from edgeR::cpm().

ColorPanel

Character. Name of a continuous palette from the paletteer package.

scale

Character. Scaling mode for heatmap: "row", "column", or "none".

cutree_rows

Integer. Number of clusters for rows (genes).

cutree_cols

Integer. Number of clusters for columns (samples).

cluster

Character. One of "both", "row", "column", or "none" to specify clustering.

show_names

Character. One of "both", "row", "column", or "none" to show row/col names.

NumGenes

Integer. Number of top-variance genes to include in the heatmap.

Details

This function selects the highest-variance genes from a log-CPM matrix, transposes the data, and renders a heatmap with customizable clustering, scaling, and color palettes using pheatmap.

  1. Compute per-gene variance and select the top "NumGenes".

  2. Transpose the subsetted matrix so samples are rows.

  3. Apply the specified color palette (n = 50) via paletteer::paletteer_c().

  4. Determine clustering and name-display options from "cluster" and "show_names".

  5. Render the heatmap with "pheatmap::pheatmap()", saving to a temporary file to suppress autosave.