Given a weighted adjacency matrix, generate a cluser-to-cluster graph based on a similarity-matrix of connected cells. Generate the minimum spanning tree on the cluster-to-cluster graph. Use one of the max dist clusters from this graph, unless: The cluster is given, then proceed to find the root cell The root cell is given, then use its cluster
FindRootCluster( cluster_labels, flat_embedding, dist_graph, dist_flat, reverse = FALSE )
cluster_labels | the cluster label for each cell |
---|---|
flat_embedding | rows are cells and columns are coordinates in n-col space |
dist_graph | distances on a connected graph |
dist_flat | flat distance matrix for all cells |
reverse | a boolean variable whether to take the root cluster based on minimum dispersion on the flat embedding |
a list containing:
a weighted upper-triangular adjacency matrix for the clusters based on avg pseudotime between their cells
an igraph object on the clusters, with a minimum spanning tree
index of the root cluster
an igraph mst object