Boolean network simulations of pair-rule gene expression in the Drosophila blastoderm, accompanying the study:
Clark E. (2017). Dynamic patterning by the Drosophila pair-rule network reconciles long-germ and short-germ segmentation. PLOS Biology. https://doi.org/10.1371/journal.pbio.2002439
Simulations model the regulatory interactions among ten transcription factors (Hairy, Eve, Run, Ftz, Odd, Prd, Slp, En, Cad, Opa) and two abstracted gap inputs (G1, G2) across a 1-D array of cells along the anteroposterior axis.
- uv ≥ 0.1 (recommended runner — handles all dependencies automatically via inline PEP 723 metadata)
- Python ≥ 3.8
Each simulation script declares its own dependencies inline:
# /// script
# requires-python = ">=3.8"
# dependencies = [
# "numpy",
# "matplotlib",
# "imageio-ffmpeg",
# ]
# ///uv run reads this metadata and installs an isolated environment automatically — no manual pip install needed.
# Run any simulation script directly with uv
uv run scripts/templateScriptforSimulations.pyEach script produces an .mp4 animation saved to the project root.
All scripts are in scripts/. The core library is functionsForSimulations.py.
| Script | Description |
|---|---|
templateScriptforSimulations.py |
Control "whole system" simulation (Simulation 10, S10 Movie, Fig 2B) — standard 20-cell array |
templateScriptforSimulations_control_wide.py |
Same control simulation on a wider cell array |
templateScriptforSimulations_eveFastDecay.py |
Modified simulation with faster eve protein decay — standard array |
templateScriptforSimulations_eveFastDecay_wide.py |
Faster eve decay on a wider cell array |
templateScriptforSimulations_ko_wide.py |
Knock-out simulation on a wider cell array |
The simulator uses a two-layer Boolean network (transcript layer + protein layer). Each gene is governed by:
- A control logic function mapping the current protein state vector → transcriptional output (0 or 1).
- A synthesis delay — timesteps of continuous transcription required before protein appears.
- A decay delay — timesteps of continuous silence required before protein disappears.
Network state is updated synchronously at each discrete timestep. Full model details, control logic tables, and parameter values for all 13 Movies referenced in the paper are documented in detailsOfModelsAndSimulations.pdf.
.
├── detailsOfModelsAndSimulations.md # Full model and simulation details (S2 Text)
└── scripts/
├── functionsForSimulations.py # Core Boolean network library
├── templateScriptforSimulations.py
├── templateScriptforSimulations_control_wide.py
├── templateScriptforSimulations_eveFastDecay.py
├── templateScriptforSimulations_eveFastDecay_wide.py
└── templateScriptforSimulations_ko_wide.py