Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solver status turning infeasible when trying to optimize #24

Open
BrunoMiguelPereira opened this issue Oct 13, 2020 · 3 comments
Open

Comments

@BrunoMiguelPereira
Copy link

I am trying to integrate both transcriptomic and metabolomic data into an E.coli model (Escherichia coli str. K-12 substr. MG1655, model iML1515). However, when using gim3e function, the solver becomes infeasible after the first slim_optimize, the one to obtain the penalty_bound_constraint.

I have changed the solver to cplex and the error that i get is:
cplex.exceptions.errors.CplexSolverError: CPLEX Error 1225: Numeric entry is not a double precision number (NaN).

This error comes from this line (144 if not mistaken):

model.objective = objective

However the origin of the error comes from:

# Penalty bound constraint
    penalty_obj = model.slim_optimize()

When trying to optimize the model after resetting the objective function, the solver status changes to infeasible, making variable penalty_obj equal to nan and so the constraint that is built after gets this value as an upper_bound.

My inputs are the ones requested:

  1. a cobra model;
  2. an expression profile obtained from the class ExpressionProfile with the model gene names as lines and conditions as columns;
  3. a dictionary of medium metabolites. Metabolites names' matches the ones in the model.

I have already tried a less complex model, expression profile and fewer metabolites.

I uploaded a zip with 3 files:

  • info : a pickle file that contains 3 variables, the metabolomic data, and two expression profiles (the first one is the complete data and the second matches the first 200 entries);
  • iML1515: the model;
  • test.py : a simple python script that allows to reproduce the error. The model and info files should be in the directory. Pickle and cobra should be python packages in the environment aswell as the latest driven version (matched the devel branch on github).

Notes: Cplex solver was used but if the attempt to reproduce is done with glpk the infeasible error still happens. The python version was 3.8.5.

integrating_omics.zip

@Midnighter
Copy link
Member

Thank you for the detailed description. I will take a look at the zip that you provided. In general, nobody has worked on driven in a while so I wouldn't necessarily expect it to work out of the box.

@BrunoMiguelPereira
Copy link
Author

No problem, thank you for taking my problem into account. I know this probably does not make much sense but if the original metabolites are removed from the model (via remove_metabolites()) and only the "TM_" ones remain, the solver is able to find a solution.

@robertobarg
Copy link

I've a similar issue coding a branch-and-price algorithm.
On model modification the exception 1225 is thrown, but changing some coefficients of the objective function creating the model avoid the error.
Unfortunately I need other values for that coefficients in the objective function.
So, it should not be a bug in my code.
I do not find any solution in the Cplex documentation.

I've asked a question with more details on stackoverflow: https://stackoverflow.com/questions/76627803/prevent-cplex-setting-to-nan-coefficients-of-problem-variables-exception-1225-i

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants