Learn R Programming

inDAGO (version 1.0.0)

CorrPlotHeatmaply: CorrPlotHeatmaply

Description

Create an interactive correlation heatmap of top variable genes using Heatmaply.

Usage

CorrPlotHeatmaply(x, Color, type, cluster, scale, show_names, NumGenes)

Value

A Plotly object (heatmaply) representing the interactive correlation heatmap.

Arguments

x

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

Color

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

type

Character. Correlation method passed to "Hmisc::rcorr()": "pearson", "spearman", or "kendall".

cluster

Character or logical. Clustering option for dendrogram: "both", "row", "column", or "none".

scale

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

show_names

Character. One of "both", "row", "column", or "none" to display row/column labels.

NumGenes

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

Details

This function selects the highest-variance genes from a log-CPM matrix, computes pairwise correlation coefficients (and p-values) with "Hmisc::rcorr()", and renders an interactive correlation heatmap via "heatmaply::heatmaply_cor()", using clustering and scaling options derived from "pheatmap" call.

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

  2. Subset the matrix and compute correlations (and p-values) via "Hmisc::rcorr()".

  3. Generate a temporary static heatmap with "pheatmap" to extract dendrograms.

  4. Render an interactive heatmap with "heatmaply::heatmaply_cor()", passing in color, clustering, scaling, tick-label visibility, and point size based on -log10(p-value).