pegasus.plot_dendrogram
- pegasus.plot_dendrogram(data, graph_key='dendrogram', panel_size=(10, 6), label_rotation=45, label_fontsize=10, orientation='top', color_threshold=None, return_fig=False, dpi=300.0, **kwargs)[source]
Generate a dendrogram on hierarchical clustering result
The metric in use is a Connection Specific Index (CSI) matrix ([Suo18], [Bass13]) built from the correlations between
groupbyattribute levels regarding therepembedding.- Parameters
data (
MultimodalData,UnimodalData, orAnnDataobject) – Single cell expression data.graph_key (
str, optional,"dendrogram") – Keyword indata.unsthat stores the dendrogram configurations calculated bypegasus.calc_dendrogramfunction.panel_size (
Tuple[float, float], optional, default:(10, 6)) – The size (width, height) in inches of figure.label_rotation (
float, optional, default:45) – The rotation angle of labels.label_fontsize (
int, optional, default:10) – The font size of labels.orientation (
str, optional, default:top) – The direction to plot the dendrogram. Available options are:top,bottom,left,right. See scipy dendrogram documentation for explanation.color_threshold``float`` (
None) – Threshold for coloring clusters. See scipy dendrogram documentation for explanation.optional (
300.0) – Threshold for coloring clusters. See scipy dendrogram documentation for explanation.default (
300.0) – Threshold for coloring clusters. See scipy dendrogram documentation for explanation.return_fig (
bool, optional, default:False) – Return aFigureobject ifTrue; returnNoneotherwise.dpi``float`` (
300.0) – The resolution in dots per inch.optional – The resolution in dots per inch.
default – The resolution in dots per inch.
- Return type
Optional[Figure]- Returns
Figureobject – Amatplotlib.figure.Figureobject containing the dot plot ifreturn_fig == True
Examples
>>> pg.plot_dendrogram(data) >>> pg.plot_dendrogram(data, graph_key="custom_dendrogram", label_rotation=90)