error running OptKnock with TOMLAB_CPLEX

30 views
Skip to first unread message

Eugenio Gil

unread,
May 5, 2020, 3:32:25 AM5/5/20
to COBRA Toolbox
Hi everyone,

So far I have used the gurobi solver succesfully to run optKnock and optGene on several models, but I'm having errors trying the same scripts with tomlab_cplex.

Currently, I'm trying the scripts provided with this paper. Files here.

The first error I came across with was the following:

Undefined function or variable 'updateStruct'.

Error in solveCobraMILP (line 439)
        tomlabProblem = updateStruct(tomlabProblem.MIP.cpxControl,solverParams);

Error in OptKnock (line 207)
    optKnockSol = solveCobraMILP(bilevelMILPproblem,'printLevel',verbFlag);

Error in Supplementary_Material_SM2 (line 196)
KnockSolution=OptKnock(model,selectedRxnList,options,constrOpt);


I tried looking for a file updateStruct in my cobratoolbox folder, and only found one called updateSructData, so I changed line 439 of solveCobraMILP, but then got a new error:

Reference to non-existent field 'probType'.

Error in tomRun (line 159)
   optType    = Prob.probType;

Error in solveCobraMILP (line 464)
        Result = tomRun('cplex', tomlabProblem);

Error in OptKnock (line 207)
    optKnockSol = solveCobraMILP(bilevelMILPproblem,'printLevel',verbFlag);

Error in Supplementary_Material_SM2 (line 196)
KnockSolution=OptKnock(model,selectedRxnList,options,constrOpt);

I'm surprised that I didn't experience any errors when using the Gurobi solver. Any pointers how to fix these issues with tomlab_cplex?

Thanks in advance,


COBRAconfigReport.log

Ronan M.T. Fleming

unread,
May 5, 2020, 6:37:15 AM5/5/20
to COBRA Toolbox
Hi,
that bug has been fixed previously
https://github.com/opencobra/cobratoolbox/issues/1449
are you using an older version of the cobra toolbox?
Regards,
Roann
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "COBRA Toolbox" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cobra-toolbo...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/cobra-toolbox/9e4ea34a-be83-43f2-a0b3-44627593789b%40googlegroups.com.



--
--
Mr. Ronan MT Fleming B.V.M.S. Dip. Math. Ph.D.
----------------------------------------------------------------------------
Assistant Professor,
Division of Systems Biomedicine and Pharmacology,
Leiden Academic Centre for Drug Research,
Faculty of Science,
Leiden University.
https://www.universiteitleiden.nl/en/staffmembers/ronan-fleming
&
H2020 Project Coordinator,
Systems Medicine of Mitochondrial Parkinson’s Disease,
http://sysmedpd.eu
&
Adjunct Lecturer,
School of Medicine,
National University of Ireland, Galway.
----------------------------------------------------------------------------
Peer-reviewed publications: https://goo.gl/FZPG23
Mobile: +353 873 413 072
Skype: ronan.fleming
----------------------------------------------------------------------------
(This message is confidential and may contain privileged information.
It is intended for the named recipient only. If you receive it in
error please notify me and permanently delete the original message and
any copies.)

Eugenio Gil

unread,
May 5, 2020, 7:25:37 AM5/5/20
to COBRA Toolbox
Thank you Ronan,

Changing Line 439 to tomlabProblem.cpxControl = updateStructData(tomlabProblem.MIP.cpxControl,solverParams); as suggested in the link did solve my problems and now it seems to be running properly.

I believe my Cobra version is quite recent. I downloaded it not more than 2 months ago, and when running the log report it says "The COBRA Toolbox - 2020".

Best,
Eugenio Gil
> To unsubscribe from this group and stop receiving emails from it, send an email to cobra-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages