A collegue of mine recently suggested to try the louvain algorithm for clustering multiplex cytometry data. However, implementations of louvain are kind of rare in R. To my knowledge the only stand-alone implementation is included in the igraph package. So far i tried to use the adjacency matrix that the umap function returns (uwot package) to create a graph using igraphs graph_from_adjacency_matrix function. I can run the louvain algorithm on the graph, but the result is always a few thousand clusters with a hand-full if cells. changing the resolution parameter does not change anything.

If i remember correctly, Seurats findClusters function uses louvain, however i don't want to use PCA reduction before clustering, which is requiered in Seurat to find clusters.

Does anybody know of a different implementation of louvain or leiden algorithm that or an easier way to use igraphsfunctions? I obviously don't have to use the matrix umap returned, but what would be a better approach to make my data "louvain-able"?


1 Answer 1


Both conda and PyPI have leiden clustering in Python which operates via iGraph

conda install -c conda-forge leidenalg

pip install leiden-clustering

Used via

import leidenalg as la
import igraph as ig

Example output

enter image description here

The docs are here. You will not need much Python to use it.

There is an entire Leiden package in R-cran here

Python implements Rs Leiden package here,

conda install -c conda-forge r-leiden

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.