{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "#Deterministic knockout prediction\n", "\n", "**cameo** also contains state-of-the-art deterministic methods for knockout prediction:\n", "\n", "Burgard, A.P., Pharkya, P., Maranas, C.D. (2003), \"OptKnock: A Bilevel Programming Framework for Identifying Gene Knockout Strategies for Microbial Strain Optimization,\" Biotechnology and Bioengineering, 84(6), 647-657.\n", "\n", "OptKnock uses the following bi-level formulation:\n", "\n", "$$\n", "\\begin{matrix}\n", "maximize & \\mathit{v_{chemical}} & & (\\mathbf{OptKnock}) \\\\\n", "\\mathit{y_j} & & & \\\\\n", "subject~to & maximize & \\mathit{v_{biomass}} & (\\mathbf{Primal}) \\\\\n", "& \\mathit{v_j} & & & & \\\\\n", "\\end{matrix}\\\\\n", "\\begin{bmatrix}\n", "subject~to & \\sum_{j=1}^{M}S_{ij}v_{j} = 0,\\\\ \n", "& v_{carbon\\_uptake} = v_{carbon~target}\\\\ \n", "& v_{apt} \\ge v_{apt\\_main}\\\\ \n", "& v_{biomass} \\ge v_{target_biomass}\\\\ \n", "& v_{j}^{min} \\cdot y_j \\le v_j \\le v_{j}^{max} \\cdot y_j, \\forall j \\in \\boldsymbol{M} \\\\\n", "\\end{bmatrix}\\\\\n", "\\begin{align}\n", " & y_j = {0, 1}, & & \\forall j \\in \\boldsymbol{M} & \\\\\n", " & \\sum_{j \\in M} (1 - y_j) \\le K& & & \\\\\n", "\\end{align}\n", "$$" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from cameo import models\n", "from cameo.strain_design.deterministic.linear_programming import OptKnock" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": true }, "outputs": [], "source": [ "model = models.bigg.iJO1366" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "On initialization, OptKnock will compute essential reaction, blocked reaction (via FVA, it is optional). All of those preprocessing conditions allow OptKnock to run faster by reducing the search space (the number of variables).\n", "\n", "Exchange reactions are also removed from the formulation." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [], "source": [ "optknock = OptKnock(model)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Running OptKnock requires at least two parameters:\n", "\n", "* Target - the flux to maximize - e.g. Exchange of Succinate, EX\\_succ\\_e\\_\n", "* Number of knockouts - K \n", "\n", "OptKnockout will return one solution by default, but *max_results* can be set to another number. It will try to find up to *max_results* unless the problem becomes infeasible, meaning that all solutions have been found." ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPU times: user 13min 50s, sys: 5.44 s, total: 13min 56s\n", "Wall time: 4min 47s\n" ] } ], "source": [ "%time result = optknock.run(2, \"EX_succ_e\", max_results=2)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "result" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python@cameo-env", "language": "python", "name": "cameo-env" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 0 }