centrality score

Compute degree, average and closeness centralities of the spatial graph.

Parameters

cluster_key: str Key by which to compute neighbouhood enrichment scores.


Web view

centrality_score_screenshot centrality_score_screenshot

Python equivalent

import squidpy as sq

sq.gr.spatial_neighbors(adata)
sq.gr.centrality_scores(adata, cluster_key="cell type")
sq.pl.centrality_scores(adata, cluster_key="cell type", figsize=(20, 5), s=500)