
Make an interactive clustering dendrogram colored by experimental variable
Source:R/dendro.R
interactive_clustering_dendrogram.RdA plotly counterpart to clustering_dendrogram(): the branch
geometry is derived from the same hclust() tree, and the leaves are
placed as markers colored by an experimental variable. Sample names sit on
the x-axis (rotated, with plotly reserving the label margin), and hovering a
leaf reveals the sample name and its group value.
Usage
interactive_clustering_dendrogram(
plotmatrix,
experiment,
colorby = NULL,
cor_method = "pearson",
cluster_method = "ward.D",
plot_title = "",
palette = NULL,
palette_name = COLORBLIND_PALETTE_NAME,
hidden_groups = character(0),
source = NULL
)Arguments
- plotmatrix
Expression/ other data matrix
- experiment
Annotation for the columns of plotmatrix
- colorby
Column name in
experimentspecifying how leaves should be colored- cor_method
Correlation method, passed to cor() (default: pearson).
- cluster_method
Clustering method, passed to hclust() (default: ward.D).
- plot_title
Plot title
- palette
Palette of colors, one for each unique value derived from
colorby.- palette_name
Valid R color palette name
Values of
colorbyto exclude: their samples are dropped and the tree is recomputed on the remainder, while the groups stay in the legend (aslegendonly) so they can be toggled back on.- source
A plotly event source string, used to route legend-click (
plotly_restyle) events back to a Shiny session.