stereoAlign.metrics.graph_connectivity

stereoAlign.metrics.graph_connectivity(adata, label_key)[source]

Graph Connectivity

Quantify the connectivity of the subgraph per cell type label. The final score is the average for all cell type labels \(C\), according to the equation:

\[\begin{split}GC = \\frac {1} {|C|} \\sum_{c \\in C} \\frac {|{LCC(subgraph_c)}|} {|c|}\end{split}\]

where \(|LCC(subgraph_c)|\) stands for all cells in the largest connected component and \(|c|\) stands for all cells of cell type \(c\).

Parameters

adata:

integrated adata with computed neighborhood graph

label_key:

name in adata.obs containing the cell identity labels

This function can be applied to all integration output types. The integrated object (adata) needs to have a kNN graph based on the integration output.