squidpy
squidpy copied to clipboard
understand centrality scores
Hi,
Thank you for this great package. The average clustering in a package is calculated with the following code
clusters = adata.obs[cluster_key].values
nx.algorithms.cluster.average_clustering(graph, clusters)
or in file: https://github.com/scverse/squidpy/blob/e77237c62dcad0efb4b8840f281466cc2a578f33/src/squidpy/gr/_nhood.py#L281
But if I use subgraph, like nx.algorithms.cluster.average_clustering(graph.subgraph(clusters)) to calculate, the result will be different, and I find the second result easier to interpret.
I'm not an expert on this, should it be modified here? Or maybe I misunderstood something?
Any explanationwould be greatly appreciated!