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 groupby attribute levels regarding the rep embedding.

Parameters
  • data (MultimodalData, UnimodalData, or AnnData object) – Single cell expression data.

  • graph_key (str, optional, "dendrogram") – Keyword in data.uns that stores the dendrogram configurations calculated by pegasus.calc_dendrogram function.

  • 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 a Figure object if True; return None otherwise.

  • 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

  • Figure object – A matplotlib.figure.Figure object containing the dot plot if return_fig == True

Examples

>>> pg.plot_dendrogram(data)
>>> pg.plot_dendrogram(data, graph_key="custom_dendrogram", label_rotation=90)