-
Notifications
You must be signed in to change notification settings - Fork 8
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
Migrate to calling igraph method #1
Comments
The igraph/python-igraph#273 This package will be retained only for compatibility with existing code (as the r-igraph function should serve the same purpose). |
Hi, |
See the relevant issues in the "igraph" repository. I only know that @vtraag has been working on this for many months as adding leidenalg to igraph has been a large project that requires changes to the core igraph C libraries. My understanding is that is close but please be patient. Open-source developers are very busy and often maintaining projects that are no longer their main work. This issue serves primarily to remind myself to update this package to reflect this changes when updates to igraph are available. This update cannot be submitted to CRAN until the igraph version of leiden_community is already on CRAN. Originally, I considered migrating from calling python with |
I agree and will also wait for this. |
I just finished the implementation of the Leiden algorithm in the R interface, see PR igraph/rigraph#399. Feel free to pull that and test further. The implementation in |
Thanks for the update @vtraag, I'm sure this took a lot of effort to implement. I will need to wait for the That information is very helpful. In that case, we can migrate this package to call To clarify, the issue on Seurat is about whether to change the default behaviours (which will disrupt a lot of code from novice users). I think their Louvain clustering function uses weights but the Leiden algorithm call I added originally did not (although this |
@vtraag Thanks for your work. I am trying to compile it under Win10. But right now it's not clear to me where I should get the cigraph and the rigraph codes. Could you tell me? |
@SamGG I think that compilation under Win 10 might be more challenging (I have not done that for the R interface yet). Under other platforms, I believe you should be able to pull it and compile it using
which refers to PR igraph/rigraph#399. |
Thanks for your feedback. Yes, Win10 is not easy, but that's my workhorse. Hopefully, MSYS2 is quite helpful and ease a lot of tasks. No problem to compile cigraph, but I got this error when executing "make" in the rigraph folder.
Any idea? |
@SamGG Can I propose to discuss this on the igraph community forum? This might be more generally useful to people, and otherwise it is only found in an (otherwise unrelated) issue. |
Just a note here that igraph/rigraph#399 has been merged into the development branch of the 'igraph' R package. I will migrate to calling this where necessary. We should be able to test installing it off GitHub before it's on CRAN. |
I've had some issues setting up the development version of igraph but I've managed to compile and install it now in R 4.0.2. The main issue was linking to libraries on Mac OS 10.15 Catalina. I've got a local install for testing the igraph functions and comparing the performance to calling python leidenalg with reticulate. To clarify, I misunderstood before: "igraph_community_leiden" is the C file running Leiden within igraph. The R function "cluster_leiden" will be tested for calling Modularity or CPM cost functions when appropriate. I think it is safe to assume a performance benefit here. A quick test run is promising!
|
"cluster_leiden" from igraph is now supported in the development version of the "leiden" R package. See the updated vignette for details: https://htmlpreview.github.io/?https://github.com/TomKellyGenetics/leiden/blob/dev/doc/benchmarking.html Note this requires cloning igraph and installing from source. Once the development version of "igraph" is installed you can check this with.
If the help page for cluster_leiden is available, then you can build the vignettes here:
This will not be necessary when igraph is updated on CRAN. When it is, I will release leiden version 0.4.0 to support compatibility for it while continuing to have extended functions available in Python. Further details from local testing as it may be hard to install with remote dependencies on Successful install:
Successful tests:
Successful checks:
|
@vtraag Great work on updating Python leidenalg and integrating leiden into igraph. Do you have any idea when the next version of R-igraph will be released on CRAN? |
We are working on it. Hopefully it will be released in a couple of weeks, but I can't make any promises. |
Ok a few minor issues with building igraph on Mac OS Catalina from source on the Otherwise, it's working great. Thanks for developing a great package. Multiplex graphs are now supported in both the "multiplex" branch (which depends not on the dev version of igraph) and the "dev" branch (which does). If I have time to write a vignette for multiplex graphs these will likely be releases 0.3.6 and 0.4.0 respectively on R (before and after igraph is updated).
-REALVERSION=1.2.5
-VERSION=1.2.5
+REALVERSION=1.2.6.9001
+VERSION=1.2.6.9001 None of the other changes were necessary to install the CRAN version 1.2.6. The version number here means that updating CRAN packages will not install another version when the development version is already installed (until version 1.2.7 or later which supports The remaining issues below are presumably problems with my set up to compile the C igraph core from source (rather than downloading pre-compiled libraries for Mac from CRAN). I have similar errors on a Linux server but this also seems to be missing dependencies (I don’t have sudo access to install them). This is okay as I can test “cluster_leiden” on my Mac. |
Further requirements to install the “dev” version.
If a build fails you can start over with this, removing compiled files and starting fresh.ca
Note: I can install from GitHub in this environment with
Installing the
You can locate them with:
Here is my
I also installed flex gmp bison glpk llvm and libgfortran with "brew" and add these to my
Here is a summary of the environment
New versions of roxygen2 may return errors. A workaround is using older versions and calling I found this wasn't necessary with the latest version if the header, libraries, and dlls for dependencies were found. Successful install
Successful tests
Successful test of
Tests dev version of igraph:Testing commit 4b036df
|
Thanks for the extensive reporting @TomKellyGenetics!
Right, good point, I will look into this.
This is rather odd. Indeed, the version is incorrect (as you already pointed out), but it does have
There is some confusion about the |
I may have misunderstood which branch to use. I tried both but neither worked at the time. In hindsight the version number may have thrown me off (and I already had version 1.2.5 installed from CRAN so I assumed the new version was needed). I've checked here and you're right that both branches now support https://github.com/igraph/rigraph/blob/dev/R/community.R Presumably now that I've fixed the dependencies to compile on Mac, it would install with devtools from remote as well as the local directory. |
I've forked the remote and increased the version number for testing (as it won't install a lower version). I can install It successfully increases the version number and I can call the help on the function which displays. It won't run the function though which is odd since I can see it in the NAMESPACE. I had to run
I'm running R 4.0.2 on Mac and R 3.6.1 on Linux but I think it works on either version. Anyway I've got it under control on my Mac for now and I think the precompiled release on CRAN wouldn't be affected by this issue. |
This may be way the CRAN version 1.2.6 of igraph was installed instead. When building another package, depedencies are installed. Here it recognises thath the development version is installed (as I've increased the version number of igraph from 1.2.5 to 1.2.6.9001).
|
A new development version is now available that uses correct version numbering, you should be able to install it using |
R igraph 1.2.7 was just released, containing the Leiden algorithm implementation. |
This version is now on CRAN with release: https://github.com/TomKellyGenetics/leiden/releases/tag/0.4.2 |
An implementation in the igraph C library is being developed. Once this can be called in https://github.com/igraph/r-igraph then this version can be used instead of calling https://github.com/vtraag/leidenalg in python from reticulate.
igraph/igraph#1259
This will improve performance for igraph objects and retain compatibility with code that calls leiden in R.
The text was updated successfully, but these errors were encountered: