nichesphere.tl.compute_network_stats

nichesphere.tl.compute_network_stats#

nichesphere.tl.compute_network_stats(G, signed=True)#

Compute standard centrality statistics for a (signed) NetworkX graph.

Calculates betweenness centrality, PageRank (unweighted), and total degree centrality, as well as degree centrality split into positive-edge degree and negative-edge degree.

Parameters:

G (nx.Graph) – Graph with numeric edge weights (positive = enriched co-localization or communication, negative = depleted).

Returns:

nw_stats – DataFrame indexed by node with columns: betweenness, degree, pagerank, degree_positive, degree_negative.

Return type:

pd.DataFrame