Skip to content

[FEA] Record Leiden/Louvain modularity in uns #473

@jpintar

Description

@jpintar

Right now, the modularity achieved in Leiden clustering is being thrown away here:

(and similarly for Louvain further down in line 292).

Would you consider recording it in adata.uns["leiden"] instead?

I am aware that there will eventually be a scanpy.metrics.modularity function, which might get a corresponding implementation here, but as I comment in the associated discussion, saving the already computed modularity is basically free, and could potentially be quite useful (e.g. when one is computing multiple clusterings of the same data, perhaps varying the resolution parameter, or the number of nearest neighbours, and comparing the results).

I'd be happy to write a small PR for this, if you agree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions