grassp.tl.dendrogram_cherry_pairs

grassp.tl.dendrogram_cherry_pairs#

dendrogram_cherry_pairs(dendrogram_data)[source]#

Return all candidate merge pairs from the dendrogram, expanding ties.

For each flat region (group of leaves all merging at the same height), all pairwise combinations are returned — not just the binary cherry that scipy happened to construct first. This ensures that triplets or quadruplets of equidistant clusters are tested exhaustively rather than in an arbitrary linkage order.

Parameters:
dendrogram_data dict

The dict stored in adata.uns[f"dendrogram_{groupby}"], as produced by paga_dendrogram().

Return type:

list[tuple[str, str]]

Returns:

list[tuple[str, str]] (category_name_a, category_name_b) tuples for each candidate pair.