vtraag / louvain-igraph

Implementation of the Louvain algorithm for community detection with various methods for use with igraph in python.
GNU General Public License v3.0
246 stars 46 forks source link

Matching seurat's louvain clustering #51

Closed liliblu closed 4 years ago

liliblu commented 4 years ago

I am new to graph based clustering algorithms and I was hoping you could help me out. I want to use this package to try to match the louvain clustering used in an R pacakge called seurat. They use modularity optimizer (http://www.ludowaltman.nl/slm/). They say: "the Modularity Optimizer also provides an implementation of the well-known Louvain algorithm for large-scale community detection developed by Blondel, Guillaume, Lambiotte, and Lefebvre (2008). An extension of the Louvain algorithm with a multilevel refinement procedure, as proposed by Rotta and Noack (2011), is implemented as well"

I am not sure which of the partitioners you have provided (if any) match the implementation described above, could you provide any insight? Or point me towards resources about louvain clustering methods?

I appreciate any help you can provide. Thanks for the great package!

vtraag commented 4 years ago

@liliblu sorry for the late reply!

This package provides the Louvain algorithm, as described by Blondel, Guillaume, Lambiotte, and Lefebvre (2008). The modularity optimizer from http://www.ludowaltman.nl/slm/ is an in improvement of the Louvain algorithm, which is called the Smart Local Moving algorithm. Together with the authors of that algorithm, we recently created the Leiden algorithm, which is a further improvement, being both faster and better than the original Louvain algorithm. The Leiden algorithm is available as a Python package leidenalg.

I believe you can also use the Leiden algorithm in seurat, but I am not too familiar with that package, so I can't help you with that.

liliblu commented 4 years ago

No problem! Thank you so much for the guidance, that clears it up really well. I am definitely incorporating leidenalg, it's working great! Thanks again.