athena.metrics.graph.graph module¶
Reference¶
-
modularity
(so, spl, community_id, graph_key='knn', resolution=1, key_added=None, inplace=True)[source]¶ Computes the modularity of the sample graph.
- Parameters
so (
SpatialOmics
) – SpatialOmics instancespl (
str
) – str Spl for which to compute the metriccommunity_id (
str
) – str column that specifies the community membership of each observation. Must be categorical.graph_key (
str
) – str Specifies the graph representation to use in so.G[spl]resolution (
float
) – floatkey_added – str Key added to spl
inplace – bool Whether to add the metric to the current SpatialOmics instance or to return a new one.
- Return type
None
- Returns
SpatialOmics if inplace=True, else nothing.
References: networkx