In [1]:
import logging

In [2]:
logging.basicConfig(level="DEBUG")

In [3]:
from cobra.test import create_test_model


DEBUG:optlang.util:Gurobi python bindings found at /home/moritz/.virtualenvs/cobra/lib/python3.5/site-packages/gurobipy
DEBUG:optlang.util:GLPK python bindings found at /home/moritz/.virtualenvs/cobra/lib/python3.5/site-packages/swiglpk
DEBUG:optlang.util:Mosek python bindings not available.
DEBUG:optlang.util:CPLEX python bindings found at /home/moritz/.virtualenvs/cobra/lib/python3.5/site-packages/cplex
DEBUG:optlang.util:Scipy solver not available
DEBUG:pip._internal.utils.misc:lzma module is not available
DEBUG:pip._internal.vcs:Registered VCS backend: git
DEBUG:pip._internal.vcs:Registered VCS backend: hg
DEBUG:pip._internal.vcs:Registered VCS backend: svn
DEBUG:pip._internal.vcs:Registered VCS backend: bzr

In [4]:
from cobra.flux_analysis import single_gene_deletion

In [5]:
model = create_test_model("textbook")

In [6]:
genes = ['b0008', 'b0114', 'b2276', 'b1779']

In [7]:
model.solver = "cplex"

In [8]:
logging.getLogger().setLevel(logging.DEBUG)

In [9]:
%time single_gene_deletion(model, method="linear room", gene_list=genes, processes=1)


CPU times: user 308 ms, sys: 0 ns, total: 308 ms
Wall time: 307 ms
Out[9]:
growth status
ids
(b1779) 5.034815e+00 optimal
(b2276) 5.475871e+00 optimal
(b0114) 1.224159e+00 optimal
(b0008) 3.028591e-15 optimal

In [10]:
model.solver = "gurobi"

In [11]:
%time single_gene_deletion(model, method="linear room", gene_list=genes, processes=1)


CPU times: user 271 ms, sys: 0 ns, total: 271 ms
Wall time: 265 ms
Out[11]:
growth status
ids
(b1779) 5.034815 optimal
(b2276) 5.475871 optimal
(b0114) 1.224159 optimal
(b0008) 0.000000 optimal

In [12]:
model.solver = "glpk"

In [13]:
model.solver.configuration.timeout = 20

In [14]:
%time single_gene_deletion(model, method="linear room", gene_list=genes, processes=1)


DEBUG:optlang.glpk_interface:Status undefined. GLPK status code returned by glp_simplex was 1
CPU times: user 205 ms, sys: 4.99 ms, total: 210 ms
Wall time: 203 ms
Out[14]:
growth status
ids
(b1779) 5.034815e+00 optimal
(b2276) 5.475871e+00 optimal
(b0114) 1.224159e+00 optimal
(b0008) -5.857507e-17 optimal

In [ ]: