ehrapy.plot.missing_values_dendrogram(adata, method='average', filter=None, max_cols=0, max_percentage=0, orientation=None, figsize=None, fontsize=16, label_rotation=45, categoricals=False)[source]#

Fits a scipy hierarchical clustering algorithm to the given AnnData object’s var and visualizes the results as a scipy dendrogram.

The default vertical display will fit up to 50 columns. If more than 50 columns are specified and orientation is left unspecified the dendrogram will automatically swap to a horizontal display to fit the additional variables.

  • adata (AnnData) – AnnData object object containing all observations.

  • method (str) – The distance measure being used for clustering. This parameter is passed to scipy.hierarchy.

  • filter (str | None) – The filter to apply to the dendrogram. Should be one of “top”, “bottom”, or None. Defaults to None .

  • max_cols (int) – The max number of columns from the AnnData object to include.

  • max_percentage (float) – The max percentage fill of the columns from the AnnData object.

  • figsize (tuple | None) – The size of the figure to display.

  • fontsize (float) – The figure’s font size.

  • orientation (str | None) – The way the dendrogram is oriented.

  • label_rotation (float) – What angle to rotate the text labels to. .

  • categoricals (bool) – Whether to include “ehrapycat” columns to the plot.


The plot axis.


>>> import ehrapy as ep
>>> adata =
>>>, filter="bottom", max_cols=15, max_percentage=0.999)