ggml_ot.pl.clustermap#
- ggml_ot.pl.clustermap(distances, labels, *, hier_clustering=True, linkage='complete', title='Clustermap', dist_name='OT Distance', log=False, cmap='Set2', hue_order=None, annotation=False, show=None, save=None, **kwargs)[source]#
Plot a hierarchically-clustered heatmap with sample annotations.
- Parameters:
- distances array-like
Distance matrix of shape
(n_samples, n_samples). If a tensor is provided, it will be converted to a numpy array.- labels array-like
Class label for each sample (used for row/column colour bar).
- hier_clustering bool, default True
Whether to perform hierarchical clustering.
- linkage str, default
"complete" Linkage method passed to
scipy.cluster.hierarchy.linkage().- title str or None, default
"Clustermap" Title displayed above the heatmap.
- dist_name str, default
"OT Distance" Label for the colour-bar.
- log bool, default False
Apply logarithmic colour scaling.
- cmap str or dict, default
"Set2" Colour palette for sample annotations.
- hue_order array-like or None, default None
Custom ordering of class labels for colour mapping.
- annotation bool, default False
Display sample labels on the x-axis.
- show bool or None, default None
Whether to display the plot.
None(default) automatically shows in interactive environments (notebooks, IPython) and suppresses in scripts.True/Falseoverride explicitly.- save str, bool, or None, default None
Whether to save the figure to disk.
None/Falseskip saving.Truesaves tosettings.figdir/clustermap.<figformat>; a str overrides the filename.- **kwargs
Forwarded to
seaborn.clustermap().
- Returns:
seaborn.matrix.ClusterGrid The cluster-grid object (always returned).