{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from time import time\n", "from random import Random\n", "\n", "from cameo.strain_design.heuristic import ReactionKnockoutOptimization\n", "from cameo import load_model\n", "from cameo.strain_design.heuristic.objective_functions import biomass_product_coupled_yield\n", "\n", "from cameo.flux_analysis.simulation import fba\n", "import inspyred" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [], "source": [ "model = load_model(\"../tests/data/iJO1366.xml\")\n", "of = biomass_product_coupled_yield(model.reactions.Ec_biomass_iJO1366_core_53p95M,\n", " model.reactions.EX_succ_lp_e_rp_,\n", " model.reactions.EX_glc_lp_e_rp_)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [], "source": [ "ko = ReactionKnockoutOptimization(model=model, objective_function=of, \n", " simulation_method=fba, heuristic_method=inspyred.ec.GA)\n", "ko.representation.remove(\"ATPM\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false, "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Starting optimization at Mon, 18 May 2015 00:11:31\n" ] }, { "data": { "text/html": [ " \n", " \n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Using saved session configuration for http://localhost:5006/\n", "To override, pass 'load_from_config=False' to Session\n" ] }, { "data": { "text/html": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ " 0%" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#progress-bar-f77b971e-30f0-4031-ab52-fd1b0b25dd4e').val('100')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#perc-progress-bar-f77b971e-30f0-4031-ab52-fd1b0b25dd4e').html('0%')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#progress-bar-f77b971e-30f0-4031-ab52-fd1b0b25dd4e').val('200')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#perc-progress-bar-f77b971e-30f0-4031-ab52-fd1b0b25dd4e').html('0%')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#progress-bar-f77b971e-30f0-4031-ab52-fd1b0b25dd4e').val('300')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#perc-progress-bar-f77b971e-30f0-4031-ab52-fd1b0b25dd4e').html('1%')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#progress-bar-f77b971e-30f0-4031-ab52-fd1b0b25dd4e').val('400')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#perc-progress-bar-f77b971e-30f0-4031-ab52-fd1b0b25dd4e').html('1%')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#progress-bar-f77b971e-30f0-4031-ab52-fd1b0b25dd4e').val('500')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#perc-progress-bar-f77b971e-30f0-4031-ab52-fd1b0b25dd4e').html('1%')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "ko.run(max_evaluations=30000, n=1, mutation_rate=0.15, indel_rate=0.185)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "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.9" } }, "nbformat": 4, "nbformat_minor": 0 }