HELP: Error in 'Optknock' using 'Ibm Cplex' solver (academic)

58 views
Skip to first unread message

alvipa

unread,
Feb 25, 2019, 4:58:13 AM2/25/19
to COBRA Toolbox
Hello, 

I'm using in Linux OS Matlab R2016b (64 bits) and IBM Cplex solver (academic version) and I get this runtime error from CPLEX when I try to launch optknock (I've tried FBA and FVA and I don't get any errors in that case). 

load('model.mat');
changeCobraSolver('ibm_cplex', 'all');
 
%% Select reactions to be explorer 
[transRxns,nonTransRxns] = findTransRxns(model,true);
[tmp,ATPMnumber] = ismember(rxn_atpm, nonTransRxns);
[tmp,BioMassnumber] = ismember(rxn_biomass, nonTransRxns);
nonTransRxnsLength = length(nonTransRxns);
 
%% Candidate reactions to be knocked out
selectedRxns = {nonTransRxns{[1:ATPMnumber-1,ATPMnumber+1:BioMassnumber-1,BioMassnumber+1:nonTransRxnsLength]}}:
 
%% Optnock options
options.targetRxn = rxn_target;
options.vMax = 1000;
options.numDel = 3;
options.numDelSense = 'L';
constrOpt.rxnList = {rxn_biomass};
constrOpt.values = [0.2];
constrOpt.sense = 'GE';
 

%% Launch Optknock
optKnockSol = OptKnock(model, selectedRxns, options, constrOpt);
 

>> optKnockSol = OptKnock(model, selectedRxns, options, constrOpt);
   0
Error using cplexlink1280
CPLEX Error  1003: Bad argument to Callable Library routine.
Error in Cplex/subsasgn
Error in solveCobraMILP (line 326)
        cplexlp.Param.output.writelevel.Cur = cobraParams.printLevel;
Error in OptKnock (line 207)
    optKnockSol = solveCobraMILP(bilevelMILPproblem,'printLevel',verbFlag); 



I have no idea what's going on. I have printed on screen the value of the 'printLevel' parameter and I get the following:

>> cplexlp.Param.output.writelevel.Cur = cobraParams.printLevel
     
ans=
     
   Cplex handle
     
   Properties:
      Model: [1x1 struct]
      Param: [1x1 struct]
      DisplayFunc: @disp

     

Any help is very appreciated

Thank in advance!


Thomas Pfau

unread,
Feb 25, 2019, 8:32:00 AM2/25/19
to cobra-...@googlegroups.com
Hi,

Did you change the solveCobraMILP file? Because the referenced line line 325 on the github repository, and for all I can see this should work according to the api (and does work in the tests).

Best

Thomas

--

---
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.
For more options, visit https://groups.google.com/d/optout.


Reply all
Reply to author
Forward
0 new messages