View source: R/CorrPlotHeatmap.R
CorrPlotHeatmap | R Documentation |
Plot a correlation heatmap of top variable genes across samples.
CorrPlotHeatmap(
x,
scale,
Color,
type,
display,
round_number,
cutree_rows,
cutree_cols,
cluster,
show_names,
NumGenes
)
x |
Numeric matrix of log-CPM values (genes × samples), e.g., from "edgeR::cpm()". |
scale |
Character. Scaling mode for the heatmap: "row", "column", or "none". |
Color |
Character. Name of a continuous palette from the "paletteer" package. |
type |
Character. Correlation method passed to "Hmisc::rcorr()": "pearson", "spearman", or "kendall". |
display |
Character. Which matrix to display: "correlation" (coefficients) or "pvalue". |
round_number |
Integer. Number of decimal places to round displayed numbers. |
cutree_rows |
Integer. Number of clusters to cut for row dendrogram. |
cutree_cols |
Integer. Number of clusters to cut for column dendrogram. |
cluster |
Character. Clustering mode: one of "both", "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. |
This function selects the highest-variance genes from a log-CPM matrix, computes pairwise correlation coefficients (or p-values) with "Hmisc::rcorr()", and renders a heatmap via "pheatmap", with options for clustering, scaling, and number display.
Compute per-gene variance and select the top "NumGenes".
Subset the matrix and compute correlations (and p-values) via "Hmisc::rcorr()".
Choose to display correlation coefficients or p-values, rounded to "round_number".
Determine clustering and label visibility from cluster and "show_names".
Render the heatmap with "pheatmap::pheatmap()", passing in custom distance, color, clustering, and "display" number settings, saving to a temporary file to suppress autosave.
A "pheatmap" object representing the correlation heatmap with clustering.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.