import logging
logging.basicConfig(level="DEBUG")
from cobra.io import load_model
DEBUG:optlang.util:Gurobi python bindings not available. DEBUG:optlang.util:GLPK python bindings found at /Users/uridavidakavia/PycharmProjects/venv_cobrapy3_7/lib/python3.7/site-packages/swiglpk DEBUG:optlang.util:Mosek python bindings not available. DEBUG:optlang.util:CPLEX python bindings not available. DEBUG:optlang.util:OSQP python bindings not available. DEBUG:optlang.util:COINOR_CBC python bindings not available. DEBUG:optlang.util:Scipy linprog function found at /Users/uridavidakavia/PycharmProjects/venv_cobrapy3_7/lib/python3.7/site-packages/scipy/optimize/__init__.py
from cobra.flux_analysis import single_gene_deletion
model = load_model("textbook")
INFO:cobra.core.model:The current solver interface glpk doesn't support setting the optimality tolerance.
Scaling... A: min|aij| = 1.000e+00 max|aij| = 1.000e+00 ratio = 1.000e+00 Problem data seem to be well scaled
genes = ['b0008', 'b0114', 'b2276', 'b1779']
model.solver = "cplex"
logging.getLogger().setLevel(logging.DEBUG)
%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
growth | status | |
---|---|---|
ids | ||
(b1779) | 5.034815e+00 | optimal |
(b2276) | 5.475871e+00 | optimal |
(b0114) | 1.224159e+00 | optimal |
(b0008) | 3.028591e-15 | optimal |
model.solver = "gurobi"
%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
growth | status | |
---|---|---|
ids | ||
(b1779) | 5.034815 | optimal |
(b2276) | 5.475871 | optimal |
(b0114) | 1.224159 | optimal |
(b0008) | 0.000000 | optimal |
model.solver = "glpk"
model.solver.configuration.timeout = 20
%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
growth | status | |
---|---|---|
ids | ||
(b1779) | 5.034815e+00 | optimal |
(b2276) | 5.475871e+00 | optimal |
(b0114) | 1.224159e+00 | optimal |
(b0008) | -5.857507e-17 | optimal |