athena.metrics.graph.graph module

Summary

Functions:

modularity

Computes the modularity of the sample graph.

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 instance

  • spl (str) – str Spl for which to compute the metric

  • community_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) – float

  • key_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