How miplabch/bimodularity works
Project Type and Purpose
• This is a data‐analysis/research toolkit (not a web app). Its purpose is to replicate the figures and analyses from the PNAS paper on bimodularity in directed networks.
• Key indicators: two Jupyter notebooks that generate figures, Python scripts for computational modules, and a “data” directory with C. elegans connectivity files.
File Structure
Top level:
• README.md, LICENSE, CITATION.cff – documentation and licensing
• requirements.txt – environment dependencies
• Bimodularity–Figures.ipynb, Bimodularity–Supplementary.ipynb – orchestration notebooks
• bimod_plots.py – plotting utilities
• graph_examples.py – canonical graph construction
• dgsp.py – core bimodularity analysis functions
• data/ – numerical and CSV data inputs
• graph_examples.py and bimod_plots.py reference data and dgsp.py
• No deployment scripts—this runs locally in Python 3.11.8.
Extract Insights from the README
• Environment setup: pip/conda for Python 3.11.8
• Notebook roles: Figures notebook handles main article figures; Supplementary notebook handles extra figures.
• Data sources: WormAtlas C. elegans connectivity files.
Main Components
a. Data Layer
– data/celegans_graph.csv, .npy, etc.
– Possibly external data source (WormAtlas) as a reference
b. Computational Modules
– dgsp.py (bimodularity computations)
– graph_examples.py (builds example graphs)
– bimod_plots.py (plotting routines)
c. Orchestration Layer
– Jupyter notebooks (Figures and Supplementary)
• They import modules, load data, run analyses, output figures
d. Environment & Dependencies
– Python 3.11.8 runtime
– Third‐party libraries (numpy, pandas, networkx, matplotlib, etc. from requirements.txt)
e. Outputs
– Generated figure files (e.g., PNG/SVG) embedded in notebooks
– Potential saved analysis results (e.g., .npy benchmark arrays)
Relationships and Data Flow
• Notebooks → import modules (dgsp, graph_examples, bimod_plots)
• Modules → read raw data from data/
• graph_examples → generate canonical graphs → pass to dgsp
• dgsp → compute bimodularity metrics → pass results to bimod_plots
• bimod_plots → render figures → notebooks display/save them
• Third‐party libraries support all modules
Architectural Patterns & Principles
• Modular Pipeline: separate concerns (data loading, computation, visualization)
• Orchestration via notebooks: high‐level workflow scripts
• Reproducibility: explicit requirements.txt and environment versions
• No external services—purely local computation