{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Creating and simulating a DFBA model\n", "This tutorial demonstrates how to build and simulate a DFBA model corresponding to the growth of a single strain of _Escherichia coli_ (based on the iJR904 genome-scale model) under aerobic and anaerobic conditions with glucose and xylose as limiting carbon substrates. \n", "\n", "This notebook was adapted with minor changes from the [dfba documentation](https://dynamic-fba.readthedocs.io/en/latest/example1.html)." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from os.path import dirname, join, pardir\n", "\n", "from cobra.io import read_sbml_model\n", "\n", "from dfba import DfbaModel, ExchangeFlux, KineticVariable" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. Dfba model\n", "A model will be build as the following ODE system:\n", "\\begin{align}\n", " \\frac{dX}{dt} &= v_{BM}X \\\\\n", " \\frac{dC_j}{dt} &= v_jX\n", "\\end{align}\n", "\n", "where $X$ is the Biomass (_gDW_); $v$ is the flux of a exchange reaction $j$ (_mmol/gDW/h_) or the exchange biomass reaction $BM$ (_g/gDW/h_, to measure growth). \n", "\n", "First off, specify the path for loading file containing genome-scale metabolic model as [cobra.Model](https://cobrapy.readthedocs.io/en/latest/building_model.html) object and set GLPK as LP solver of choice. After that, instantiate the object of class `DfbaModel` with the cobrapy model." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "path_to_model = join(pardir, \"sbml-models\", \"iJR904.xml.gz\")\n", "fba_model = read_sbml_model(path_to_model)\n", "fba_model.solver = \"glpk\"\n", "dfba_model = DfbaModel(fba_model)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "