This modeling framework integrates Ordinary Differential Equation models with constraint-based metabolic network models, using various Flux Balance Analysis functionalities implemented in COBRApy.
The code is made available under the GNU General Public License (see LICENSE) at no warranty and is under further development at https://gitlab.com/asuccurro/dfba-ode-framework. Access to the developer version can be requested by writing to asuccurro AT gmail DOT com.
This code corresponds to the version v1.0, used for simulating Escherichia coli sub-population dynamics in the work "Emergent sub-population behavior uncovered with a community dynamic metabolic model of Escherichia coli diauxic growth" by Succurro, Segrè, Ebenhöh, 2019.
Here I provide the framework code (under code/python/) and the macros (under macros/succurro_et_al_2018/) used to obtain the Figures of the manuscript referenced above. The code is made available under the GNU General Public License (see LICENSE) at no warranty.
Please refer to the Jupyter notebook for interactive examples to learn how to use the framework for your own analysis. A software metapaper is in preparation.
Load the binder environment, when asked to select the kernel choose python 2. Click on EColiSubPop.ipynb and play around.
This code requires some external open-source packages.
Be sure to have at least one LP solver (default and opensource is glpk/cglpk) installed before installing CobraPy (you can always uninstall CobraPy and install again)
In Ubuntu distributions this means e.g.:
sudo apt-get install glpk-utils
If however you follow the recommended installation istructions using the conda package management system, glpk can be installed through the channel conda-forge in the environment rather than system-wide.
To install instead a Gurobi solver (not needed) please refer to:
Gurobi is installed globally by running
sudo python setup.py install
In virtualenv then you will need to locate Gurobi path.
The easiest way to prepare the environment to run DAPHNE is through conda. Please follow the official instructions to install conda in your OS.
Once conda is installed, you can create and setup the new environment as:
conda create -n daphnePy2 python=2.7 numpy matplotlib scipy scikit-learn seaborn pip
conda activate daphnePy2
conda install -c conda-forge glpk
pip install cobra==0.8.2
The file moma.py from COBRApy has to be slightly modify to return a copy of the model:
cp filescobra/moma.py $YOURANACONDAPATH/envs/daphnePy2/lib/python2.7/site-packages/cobra/flux_analysis/
You are now ready to run simulations in DAPHNE!
If you don't have virtual environment, you can install it with one of the following commands:
apt-get install python-virtualenv
yum install python-virtualenv
pip install virtualenv
cd yourprojectfolder
virtualenv -p /usr/bin/python2.7 pubvenv
Then activate virtualenv and install the requirements:
source pubvenv/bin/activate
pip install -r req_pubvenv.txt
The command to leave the virtualenv is:
deactivate
The file moma.py from COBRApy has to be slightly modify to return a copy of the model:
cp filescobra/moma.py pubvenv/lib/python2.7/site-packages/cobra/flux_analysis/
In virtualenv you need to locate Gurobi path (usually is saved in $GUROBI_HOME) and run pip like:
pip install $GUROBI_HOME
Please note that some simulations might be CPU intensive. More detailed information will be updated.
Simulates single E. coli model (--runsingle --runecgl) shifting from glucose to acetate metabolism using either pFBA (default) or MOMA (-M) to solve the FBA problem. The experimental condition is batch growth on 15 mM glucose (--runglucose).
source ./fig1_enjalbert2015_fig2a.sh
This script uses the outputs of the previous simulation. Simulates exponential growth on glucose or acetate and obtains the flux differences as proxy for gene expression.
source ./fig2_enjalbert2015_geneexp.sh
Simulates batch growth of two E. coli populations (--runconsortium) on 15 mM glucose (--runglucose), starting with 100% glucose consumers (--ratioecgl "1.0"). One simulation does not allow population shift, the other introduces noise-level population shift (--phitransition --psitransition --phioffset 0.04 --psioffset 0.04).
source ./fig3_enjalbert2015_fig2a.sh
Simulates batch growth of two E. coli populations (--runconsortium) on 15 mM glucose and 4 mM acetate (--runfedlowacetate) or 15 mM glucose and 32 mM acetate (--runfedhighacetate), starting with 100% (--ratioecgl "1.0") or 75% (--ratioecgl "0.75") glucose consumers. Transition from one population to the other is modeled with Hill kinetics:
psio=0.04
phio=0.04
kpsi=30.0
kphi=5.0
vpsi=0.2
vphi=0.2
-e '0.9' --phitransition --psitransition --kmtransphi "${kphi}" --kmtranspsi "${kpsi}" --vmaxpsi "${vpsi}" --vmaxphi "${vphi}" --phioffset "${phio}" --psioffset "${psio}"
source ./fig4_enjalbert2015_fig6a_fig6c.sh
Simulates the switch experiments. First runs mother cultures in M9G (--runglucose) and M9GA (--runmixedacetate) conditions. Then runs daughter cultures and computes lag time using a simplified ODE model and sampling the starting population ratio from the mother cultures.
source ./fig5_enjalbert2015_fig4.sh
Simulates batch and fed-batch experiments from Varma and Palsson, 1994. Produces Rsq plots (agreement.py macro) and the flux check plots (analyseFluxes.py macro) as well.
source ./figS1-S2_varma1994_fig7_fig10.sh
(Accessing the simulation output files of Fig. 1) produce the flux check plots for Enjalbert et al, 2015, batch condition with glucose only.
source ./figS3_enjalbert2015.sh
source ./figS5_enjalbert_3models.sh
Simulate the conditions from Enjalbert et al, 2015, varying the initial biomass ratio of the two subpopulations.
source figS6_varyInitialRatio.sh
Simulate high acetate condition from Enjalbert et al, 2015, starting with the same initial biomass value and population ratio as the low acetate condition or as in the manuscript.
source figS7_highacetate.sh
source ./figS8a-d_lagtimescans.sh
source ./figS8e-h_paramscanlag_run.sh
source ./figS5_transitionRatesRsq.sh
source ./extrafig_odescans.sh