phantomas1234 on 0.13.5
phantomas1234 on devel
chore: don't forget to build pa… (compare)
phantomas1234 on 0.13.4
phantomas1234 on devel
chore: use official pypi GH act… (compare)
phantomas1234 on 0.13.3
phantomas1234 on devel
Skip more pickle problems (compare)
phantomas1234 on devel
Skip problematic pickling probl… (compare)
phantomas1234 on 0.13.2
phantomas1234 on devel
fix: set explicitly the auth to… (compare)
carrascomj on fix-twine-upload
fix: set explicitly the auth to… (compare)
carrascomj on fix-twine-upload
carrascomj on fix-twine-upload
fix: use CLI arguments for twin… (compare)
The full error message is as follows:
'---------------------------------------------------------------------------
OptimizationError Traceback (most recent call last)
<ipython-input-5-443fb185c4d9> in <module>()
----> 1 optknock = OptKnock(model, fraction_of_optimum=0.00001, use_nullspace_simplification=False) ## ???
/Users/astridstubbusch/anaconda/envs/py2/lib/python2.7/site-packages/cameo/strain_design/deterministic/linear_programming.pyc in init(self, model, exclude_reactions, remove_blocked, fraction_of_optimum, exclude_non_gene_reactions, use_nullspace_simplification, args, *kwargs)
113 exclude_reactions += [r for r in self._model.reactions if not r.genes]
114
--> 115 self._build_problem(exclude_reactions, use_nullspace_simplification)
116
117 def _remove_blocked_reactions(self):
/Users/astridstubbusch/anaconda/envs/py2/lib/python2.7/site-packages/cameo/strain_design/deterministic/linear_programming.pyc in _build_problem(self, essential_reactions, use_nullspace_simplification)
132 logger.debug("Starting to formulate OptKnock problem")
133
--> 134 self.essential_reactions = find_essential_reactions(self._model).union(self._model.exchanges)
135 if essential_reactions:
136 self.essential_reactions.update(set(get_reaction_for(self._model, r) for r in essential_reactions))
/Users/astridstubbusch/anaconda/envs/py2/lib/python2.7/site-packages/cobra/flux_analysis/variability.pyc in find_essential_reactions(model, threshold)
345 Set of essential reactions
346 """
--> 347 solution = model.optimize(raise_error=True)
348 tolerance = model.solver.configuration.tolerances.feasibility
349 non_zero_flux_reactions = list(
/Users/astridstubbusch/anaconda/envs/py2/lib/python2.7/site-packages/cobra/core/model.pyc in optimize(self, objective_sense, raise_error, **kwargs)
890 objective_sense, original_direction)
891 self.slim_optimize()
--> 892 solution = get_solution(self, raise_error=raise_error)
893 self.objective.direction = original_direction
894 return solution
/Users/astridstubbusch/anaconda/envs/py2/lib/python2.7/site-packages/cobra/core/solution.pyc in get_solution(model, reactions, metabolites, raise_error)
286 legacy solvers.
287 """
--> 288 check_solver_status(model.solver.status, raise_error=raise_error)
289 if reactions is None:
290 reactions = model.reactions
/Users/astridstubbusch/anaconda/envs/py2/lib/python2.7/site-packages/cobra/util/solver.pyc in check_solver_status(status, raise_error)
422 "model was not optimized yet or solver context switched")
423 else:
--> 424 raise OptimizationError("solver status is '{}'".format(status))
425
426
OptimizationError: solver status is 'infeasible' '
fraction_of_optimum
can be the problem. I’ll test it myself, but you are setting the model objective to be a number below the solver precision and that’s usually recipe for disaster. I’ll be back in the office tomorrow and I will try to assess that myself.
MinimalCutSetsEnumerator
still needs a lot work and testing. @KristianJensen probably knows more but he is also writing his thesis right now. As far as I can see from the code it can be a constraint (which you could construct with model.solver.interface.Constraint
etc.) to describe the desired behavior. If you want to calculate EFMs, wouldn't you want to use ShortestElementaryFluxModes
actually?
solution.f
and solution.x_dict
attributes in cobrapy
model = models.bigg.iJO1366
model.solver = 'gurobi'
wt_solution = model.optimize()
model.summary()
growth = wt_solution.fluxes["BIOMASS_Ec_iJO1366_core_53p95M"]
acetate_production = wt_solution.fluxes["EX_ac_e"]
p = phenotypic_phase_plane(model, variables=['BIOMASS_Ec_iJO1366_core_53p95M'], objective='EX_ac_e')
result = p.data_frame
g_range = result['BIOMASS_Ec_iJO1366_core_53p95M']
p_range = result['objective_upper_bound']
plt.plot(g_range, p_range, 'k', color='blue')
optgene = OptGene(model)
result = optgene.run(target=model.reactions.EX_ac_e,
biomass=model.reactions.BIOMASS_Ec_iJO1366_core_53p95M,
substrate=model.metabolites.glc__D_e,
max_evaluations=5000,
plot=False)