opencobra / cobratoolbox

The COnstraint-Based Reconstruction and Analysis Toolbox. Documentation:
https://opencobra.github.io/cobratoolbox
Other
252 stars 317 forks source link

potential issue in parseSolverParameters.m #1480

Open Kretaks opened 5 years ago

Kretaks commented 5 years ago

Please include a short description of problem here I tried to execute gapFind.m function and error about SWITCHES came up, I narrowed it down to parseSolverParameters.m function to line s 31-32. Those lines do not return values I expect.

I hereby confirm that I have:

(Note: You may replace [ ] with [X] to check the box)

tpfau commented 5 years ago

Could you post the full error message along with the function call that caused the issue?

Kretaks commented 5 years ago

[allGaps, rootGaps, downstreamGaps] = gapFind(model);

SWITCH expression must be a scalar or a character vector.

Error in solveCobraMILP (line 118) switch solver

Error in gapFind (line 195) solution = solveCobraMILP(gapFindMILPproblem,parameters);

tpfau commented 5 years ago

Did you initialize the toolbox before running gapFind via initCobraToolbox? And: do you have a working MILP solver installed?

Kretaks commented 5 years ago

toolbox is initialized and I have gurobi solver I rewrote changeCobraSolver('gurobi','all') Now it gives: [allGaps, rootGaps, downstreamGaps] = gapFind(model, 'true'); Index exceeds matrix dimensions.

Error in gapFind (line 198) metsProduced = solution.full((n_v+n_wij_IR+n_wij_R+1):(n_v+n_wij_IR+n_wij_R+n_xnp),1);

tpfau commented 5 years ago

What model are you using?

Kretaks commented 5 years ago

image

Rhodotorula glutinis

Kretaks commented 5 years ago

I reverted my model to original upper and lower bounds and now it resolves (previously I had them at experimental data)

tpfau commented 5 years ago

Did you test, whether your bound changes made the model infeasible? This could be a reason for gapFill to fail as it requires a feasible model as input.

Kretaks commented 5 years ago

It seems that I had multiple objective functions set as 1. Now I changed them so only one is set as 1 and it works