cobratoolbox icon indicating copy to clipboard operation
cobratoolbox copied to clipboard

potential issue in parseSolverParameters.m

Open Kretaks opened this issue 5 years ago • 9 comments

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:

  • [X] Tried to solve the issue on my own
  • [ ] Retried to run my code with the latest version of The COBRA Toolbox
  • [X] Checked that a similar issue has not already been opened

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

Kretaks avatar May 31 '19 08:05 Kretaks

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

tpfau avatar May 31 '19 08:05 tpfau

[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);

Kretaks avatar May 31 '19 08:05 Kretaks

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

tpfau avatar May 31 '19 11:05 tpfau

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);

Kretaks avatar May 31 '19 12:05 Kretaks

What model are you using?

tpfau avatar May 31 '19 12:05 tpfau

image

Rhodotorula glutinis

Kretaks avatar May 31 '19 12:05 Kretaks

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

Kretaks avatar May 31 '19 12:05 Kretaks

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.

tpfau avatar May 31 '19 12:05 tpfau

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

Kretaks avatar May 31 '19 13:05 Kretaks