-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory Error with Clustering with Leiden algorithm matrix - When to use matrix vs igraph method? #155
Comments
Using a matrix is not a feature of this library. It is entirely specific to the leiden R package, which will convert that matrix to a graph before doing any community detection. Given what the |
Thanks @szhorvat -- just so I understand it correctly, did you mean specifying |
Presumably yes. But you need to discuss this with the packages that implemented these methods. This choice of methods does not come from the leidenalg Python package. |
Thanks Szabolcs. Hopefully someone from Seurat will give some input. |
Probably @TomKellyGenetics could bring some clues. My opinion: maybe it's time to use igraph directly. |
@SamGG the leiden package already does this by default for igraph objects, although limited parameters are supported compared to calling Python. This has been supported for over a year with the 0.4 version.
@szhorvat that’s correct it does (reticulate supports dense matrices but not sparse matrices or igraph objects so igraph objects are passed as an edge list and recreated in Python). This only applies to older versions of the R package for the reasons discussed above so the comment in Seurat documentation is likely no longer relevant for users running igraph 1.2.7 and leiden 0.4.0 or later. |
Thanks for this information and your feedback. |
Thanks all for commenting in my absence! I believe all questions are addressed, so I'm closing this. |
Hi,
Thanks for the tool.
I attempted to cluster 45,000 cells using Leiden algorithm, using default argument
method = "matrix"
. However, I encountered a "memory issue". But. when I changed `method = "igraph", it ran fine.In the help, it mentions to use
igraph
method when we do not want to cast large dataset to dense matrix, so it seems it simply is to deal with large dataset. But, would you mind letting me know if there is other key difference between usingigraph
vsmatrix
methods in terms of the clustering results? And, when should I choose one vs the other?Related post: scverse/scanpy#1053
I have also posted here: satijalab/seurat#7979
Thank you so much for your support!
@denvercal1234GitHub
The text was updated successfully, but these errors were encountered: