Installation

Currently, we do not provide Python wheels for this package and therefore Installing from source is a bit more involved. However, the package is now available on conda-forge and can be installed in a conda environment. First, create an environment with Python (e.g. version 3.7):

conda create --name dfba python=3.7

Next, activate the environment using

conda activate dfba

and install dfba using

conda install -c conda-forge dfba

You can then use the software within the environment on the examples in the repository as well as your own DFBA models.

The quickest way to run the software without building anything locally is from the provided Docker image. There are several ways to do this; we suggest using the following command to run Example 1 from the root of this repsitory:

docker run -it -v ${PWD}:/opt/examples davidtourigny/dfba python3 examples/example1.py

Provided Docker is installed correctly, the first time you run this command the latest image will be pulled from dockerhub (unless you have previously pulled or built it yourself using the instructions at the bottom of this page). All subsequent runs will use this same image, and you can replace examples/example1.py with the path to a Python script containing your own DFBA model. To access results of each simulation, we recommend including the pandas method to_csv() inside your script in order to write the data frame of results to a csv file (e.g., see Creating and simulating a DFBA model or uncomment lines 107 and 108 in script example1).

Installing from source

Currently this package is compatible with most UNIX-like operating systems. Provided the following Dependencies are installed, the module can be installed using the command:

pip install dfba

Dependencies

  • A version of Python 3.6 or higher is required

  • You need cmake for the build process

  • You will need git to clone this repository to access the scripts and build files

  • You need a working compiler with C++11 support, for example, by installing build-essential on Debian-derived Linux systems

  • GLPK version 4.65 is required or can be installed using build_glpk.sh

  • SUNDIALS version 5.0.0 or higher is required or can be installed using build_sundials.sh

  • pybind11 is required or can be installed using build_pybind11.sh

Be aware that some of these packages have their own dependencies that must therefore be installed also (e.g. GLPK depends on GMP and pybind11 requires pytest).

Alternatively, a Dockerfile is provided for building a Docker image to run the software from an interactive container. The Docker image can be built in one step by issuing the command:

make build

from the root of the repository. It can then be started using:

make run