This is a generic function which may be useful outside of this package. It
produces a heatmap based on an expression matrix and accompanying
experiment data in the form of a frame, using heatmaply::heatmaply().
Usage
interactive_heatmap(
plotmatrix,
displaymatrix,
sample_annotation,
cluster_rows = TRUE,
cluster_cols = FALSE,
scale = "row",
row_labels,
colors = viridisLite::viridis(100),
cexCol = 0.9,
cexRow = 0.9,
display_numbers = FALSE,
hide_colorbar = FALSE,
grid_gap = 1,
cor_method = "spearman",
cluster_method = "ward.D2",
plot_height = 600,
...
)Arguments
- plotmatrix
Expression/ other data matrix
- displaymatrix
A matrix of values shown on hover, in addition to the (possibly scaled/ transformed) values in
plotmatrix- sample_annotation
A data frame with sample metadata, used to draw column side colors and an accompanying legend
- cluster_rows
Cluster rows?
- cluster_cols
Cluster columns?
- scale
'row', 'column' or none
- row_labels
Vector labels to use for rows
- colors
A vector of colors for the heatmap
- cexCol
Character expansion factor passed to
heatmaply()- cexRow
Character expansion factor passed to
heatmaply()- display_numbers
Boolean, should the (possibly scaled/ transformed) values in
plotmatrixbe displayed on the heatmap cells?- hide_colorbar
Boolean, should the color scale legend be hidden?
- grid_gap
Pixel gap drawn between cells, passed through to
heatmaply(). The default of 1 reads fine for small heatmaps, but on a heatmap with hundreds of rows the gaps can visually dominate and obscure cross-column colour patterns; pass 0 for contiguous cells in that case.- cor_method
Correlation method passed to
calculate_dendrogramwhen clustering rows and/or columns (default: 'spearman'). Match this to the method used by another clustering of the same data (e.g. aComplexHeatmap::Heatmap()call'sclustering_distance_columns) to reproduce its dendrogram topology here.- cluster_method
Clustering method passed to
calculate_dendrogram(default: 'ward.D2'). Match this to another clustering'sclustering_method_columns/-_rowsfor the same reason ascor_method.- plot_height
The total rendered height of the plot in pixels. Passed through to
heatmaply()as itsheightargument, and also used to convert the fixed-pixel annotation row height into the fractionheatmaply()expects. When displayed inside aplotlyOutput(), the latter's ownheightargument should match this value so the container and the widget agree.- ...
Additional arguments passed to
heatmaply(). For example,heatmaply()reorders dendrogram leaves for visual clarity (seriate = "OLO") by default; passseriate = "none"here to keep the plainhclustleaf order instead, matchingComplexHeatmap::Heatmap()'s default display.
