opencobra / cobratoolbox

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

problem with optknock #1283

Closed Abhinav9843 closed 6 years ago

Abhinav9843 commented 6 years ago

I am facing problem using OptKnock

I hereby confirm that I have:

(Note: You may replace [ ] with [X] to check the box) I am trying to use run the following command on matlab with cobra toolbox.

There seems to be aproblem with optKnock. If I run the example code from the cobra protocol

model = readCbModel('ecoli_core_model.mat'); model = changeRxnBounds(model, {'EX_o2(e)', 'EX_glc(e)'}, [0 -20], 'l'); selectedRxns = {model.rxns{ [1, 3:5, 7:8, 10, 12, 15:16, 18, 40:41, 44, 46, 48:49, 51, 53:55, 57, 59:62, 64:68, 71:77, 79:83, 85:86, 89:95]}};

options.targetRxn = 'EX_lac-D(e)'; options.vMax = 1000; options.numDel = 5; options.numDelSense = 'L'; constrOpt.rxnList = {'Biomass_Ecoli_core_N(w/GAM)-Nmet2', 'ATPM'}; constrOpt.values = [0.05, 8.39]; constrOpt.sense = 'GE'; optKnockSol = OptKnock(model, selectedRxns, options, constrOpt);

I get the following error messages

Undefined function or variable 'solver'.

Error in solveCobraMILP (line 210) switch solver

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

please help me..

tpfau commented 6 years ago

Which version are you using? Could you provide the details from generateSystemConfigReport() and changeCobraSolver()

Abhinav9843 commented 6 years ago

I am using the latest version of git (2.18.0) 64-bit version of Git for Windows.

and generateSystemConfigReport()

---------------------------------- SYSTEM CONFIGURATION REPORT ----------------------------------

  _____   _____   _____   _____     _____     |
 /  ___| /  _  \ |  _  \ |  _  \   / ___ \    |   COnstraint-Based Reconstruction and Analysis
 | |     | | | | | |_| | | |_| |  | |___| |   |   The COBRA Toolbox - 2018
 | |     | | | | |  _  { |  _  /  |  ___  |   |
 | |___  | |_| | | |_| | | | \ \  | |   | |   |   Documentation:
 \_____| \_____/ |_____/ |_|  \_\ |_|   |_|   |   http://opencobra.github.io/cobratoolbox
                                              | 

Checking if git is installed ... Done. Checking if the repository is tracked using git ... Done. Checking if curl is installed ... Done. Checking if remote can be reached ... Done. Initializing and updating submodules (this may take a while)... Done. Adding all the files of The COBRA Toolbox ... Done. Define CB map output... set to svg. TranslateSBML is installed and working properly. Configuring solver environment variables ...

  • [----] ILOG_CPLEX_PATH: --> set this path manually after installing the solver ( see instructions )
  • [*---] GUROBI_PATH: C:\gurobi800\win64\matlab
  • [----] TOMLAB_PATH: --> set this path manually after installing the solver ( see instructions )
  • [----] MOSEK_PATH: --> set this path manually after installing the solver ( see instructions ) Done. Checking available solvers and solver interfaces ... Done. Setting default solvers ... Done. Saving the MATLAB path ... Done.
  • The MATLAB path was saved in the default location.

Summary of available solvers and solver interfaces

                Support           LP     MILP      QP    MIQP     NLP
----------------------------------------------------------------------
gurobi          active              1       1       1       1       -
ibm_cplex       active              0       0       0       -       -
tomlab_cplex    active              0       0       0       0       -
glpk            active              1       1       -       -       -
mosek           active              0       -       0       -       -
matlab          active              1       -       -       -       1
cplex_direct    active              0       0       0       0       -
dqqMinos        active              0       -       -       -       -
pdco            active              1       -       1       -       -
quadMinos       active              0       -       -       -       -
qpng            passive             -       -       1       -       -
tomlab_snopt    passive             -       -       -       -       0
gurobi_mex      legacy              0       0       0       0       -
lindo_old       legacy              0       -       -       -       -
lindo_legacy    legacy              0       -       -       -       -
lp_solve        legacy              1       -       -       -       -
opti            legacy              0       0       0       0       0
----------------------------------------------------------------------
Total           -                   5       2       3       1       1

MATLAB Version: 9.2.0.538062 (R2017a) MATLAB License Number: FreeForAll Operating System: Microsoft Windows 10 Home Single Language Version 10.0 (Build 17134) Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode

MATLAB Version 9.2 (R2017a) Simulink Version 8.9 (R2017a) Aerospace Blockset Version 3.19 (R2017a) Aerospace Toolbox Version 2.19 (R2017a) Antenna Toolbox Version 2.2 (R2017a) Audio System Toolbox Version 1.2 (R2017a) Automated Driving System Toolbox Version 1.0 (R2017a) Bioinformatics Toolbox Version 4.8 (R2017a) Communications System Toolbox Version 6.4 (R2017a) Computer Vision System Toolbox Version 7.3 (R2017a) Control System Toolbox Version 10.2 (R2017a) Curve Fitting Toolbox Version 3.5.5 (R2017a) DO Qualification Kit Version 3.3 (R2017a) DSP System Toolbox Version 9.4 (R2017a) Data Acquisition Toolbox Version 3.11 (R2017a) Database Toolbox Version 7.1 (R2017a) Datafeed Toolbox Version 5.5 (R2017a) Econometrics Toolbox Version 4.0 (R2017a) Embedded Coder Version 6.12 (R2017a) Filter Design HDL Coder Version 3.1.1 (R2017a) Financial Instruments Toolbox Version 2.5 (R2017a) Financial Toolbox Version 5.9 (R2017a) Fixed-Point Designer Version 5.4 (R2017a) Fuzzy Logic Toolbox Version 2.2.25 (R2017a) Global Optimization Toolbox Version 3.4.2 (R2017a) HDL Coder Version 3.10 (R2017a) HDL Verifier Version 5.2 (R2017a) IEC Certification Kit Version 3.9 (R2017a) Image Acquisition Toolbox Version 5.2 (R2017a) Image Processing Toolbox Version 10.0 (R2017a) Instrument Control Toolbox Version 3.11 (R2017a) LTE System Toolbox Version 2.4 (R2017a) MATLAB Coder Version 3.3 (R2017a) MATLAB Compiler Version 6.4 (R2017a) MATLAB Compiler SDK Version 6.3.1 (R2017a) MATLAB Distributed Computing Server Version 6.10 (R2017a) MATLAB Report Generator Version 5.2 (R2017a) Mapping Toolbox Version 4.5 (R2017a) Model Predictive Control Toolbox Version 5.2.2 (R2017a) Model-Based Calibration Toolbox Version 5.2.1 (R2017a) Neural Network Toolbox Version 10.0 (R2017a) OPC Toolbox Version 4.0.3 (R2017a) Optimization Toolbox Version 7.6 (R2017a) Parallel Computing Toolbox Version 6.10 (R2017a) Partial Differential Equation Toolbox Version 2.4 (R2017a) Phased Array System Toolbox Version 3.4 (R2017a) Polyspace Bug Finder Version 2.3 (R2017a) Polyspace Code Prover Version 9.7 (R2017a) Powertrain Blockset Version 1.1 (R2017a) RF Blockset Version 6.0 (R2017a) RF Blockset Version 6.0 (R2017a) RF Toolbox Version 3.2 (R2017a) Risk Management Toolbox Version 1.1 (R2017a) Robotics System Toolbox Version 1.4 (R2017a) Robust Control Toolbox Version 6.3 (R2017a) Signal Processing Toolbox Version 7.4 (R2017a) SimBiology Version 5.6 (R2017a) SimEvents Version 5.2 (R2017a) Simscape Version 4.2 (R2017a) Simscape Driveline Version 2.12 (R2017a) Simscape Electronics Version 2.11 (R2017a) Simscape Fluids Version 2.2 (R2017a) Simscape Multibody Version 5.0 (R2017a) Simscape Power Systems Version 6.7 (R2017a) Simulink 3D Animation Version 7.7 (R2017a) Simulink Code Inspector Version 3.0 (R2017a) Simulink Coder Version 8.12 (R2017a) Simulink Control Design Version 4.5 (R2017a) Simulink Design Optimization Version 3.2 (R2017a) Simulink Design Verifier Version 3.3 (R2017a) Simulink Desktop Real-Time Version 5.4 (R2017a) Simulink PLC Coder Version 2.3 (R2017a) Simulink Real-Time Version 6.6 (R2017a) Simulink Report Generator Version 5.2 (R2017a) Simulink Test Version 2.2 (R2017a) Simulink Verification and Validation Version 3.13 (R2017a) Spreadsheet Link Version 3.3.1 (R2017a) Stateflow Version 8.9 (R2017a) Statistics and Machine Learning Toolbox Version 11.1 (R2017a) Symbolic Math Toolbox Version 7.2 (R2017a) System Identification Toolbox Version 9.6 (R2017a) Trading Toolbox Version 3.2 (R2017a) Vehicle Network Toolbox Version 3.3 (R2017a) Vision HDL Toolbox Version 1.4 (R2017a) WLAN System Toolbox Version 1.3 (R2017a) Wavelet Toolbox Version 4.18 (R2017a)

Default shell :
Version of shell : '--version' is not recognized as an internal or external command, operable program or batch file. Architecture : PCWIN64 MATLAB folder : C:\Program Files\MATLAB\R2017a COBRA Toolbox root : C:\Users\Abhinav Das\cobratoolbox git version : git version 2.18.0.windows.1 curl version : curl 7.55.1 (Windows) CBT_LP_SOLVER : gurobi CBT_MILP_SOLVER : gurobi CBT_QP_SOLVER : gurobi CBT_MIQP_SOLVER : gurobi CBT_NLP_SOLVER : matlab GUROBI_PATH : C:\gurobi800\win64\matlab ILOG_CPLEX_PATH :
TOMLAB_PATH :
MOSEK_PATH :

----------------------------------- END OF CONFIGURATION REPORT -----------------------------------

and

changeCobraSolver() Defined solvers are: CBT_LP_SOLVER: gurobi CBT_MILP_SOLVER: gurobi CBT_QP_SOLVER: gurobi CBT_MIQP_SOLVER: gurobi CBT_NLP_SOLVER: matlab

please help me.

tpfau commented 6 years ago

It seems, like in your original call, the toolbox was not intialized. Could you run your code again? If the error appears again, please run initCobraToolbox() before your script.

laurentheirendt commented 6 years ago

May you post these support issues in our forum for a faster turnaround? Thanks. 👍