Code to replicate analyses and figures of A. Cionca, C.H.M. Chan, & D. Van De Ville, Community detection for directed networks revisited using bimodularity, Proc. Natl. Acad. Sci. U.S.A. 122 (35) e2500571122, https://doi.org/10.1073/pnas.2500571122 (2025).
C. elegans data can be accessed on WormAtlas.org under "Neuronal Connectivity II: by L.R. Varshney, B.L. Chen, E. Paniagua, D.H. Hall and D.B. Chklovskii" (see Varshney et al., 2011 for more information).
The environment can be easily installed using pip install -r requirements.txt, or alternatively with a new conda environment:
conda create -n bimodularity python==3.11.8
conda activate bimodularity
pip install -r requirements.txtNote that compatiblity is ensured for python 3.11.8 - you may have to play with dependencies when using other versions.
The Bimodularity-Figures.ipynb notebook:
- generates the canonical graphs,
- loads the C. elegans data,
- computes the bimodularity analyses,
- and creates all the figures in the article.
The Bimodularity-Supplementary.ipynb notebook:
- creates all the supplementary figures in the article.
Both notebooks are self-sufficient and should run when using the run all command.