Installation issue with COBRA loading Models?

490 views
Skip to first unread message

Michael O

unread,
Apr 6, 2015, 1:21:33 PM4/6/15
to cobra-...@googlegroups.com
Hello all,
I am having an apparent issue getting COBRA to read and load models while using testAll. solveCobraMILP and other functions involving reading or loading a model seem to be the common

I am running:
MATLAB R2015a (win64) on Windows 7
SBMLToolbox-4.1.0 - This was installed separately from the COBRA toolbox included version; the RunTest.m included with the program will run successfully in Matlab.
libSBML-5.11.0-libxml2-x64 - This was installed separately from the COBRA toolbox included version and is the specific Matlab build/install. I can not find a guide for the testing/verification of the installation of this in matlab.
Gurobi-6.0.2-win64  -Included examples solved as expected.
The version of COBRA Toolbox that I am using was obtained today from the Github repository.

After installation and running initCobraToolbox in matlab, I get the following:

LP solver set to gurobi5 successful
MILP solver set to gurobi5 successful
QP solver set to gurobi5 successful
MIQP solver set to gurobi5 successful
CB map output set to svg successful
-So, no apparent problems noted with Cobra not being able to read models.

Running testALL (and removing lines 62, 64, and 67 in CobraMILP.m, as they are more then likely typos), I get the following:

14 of 22 tests completed successfully.

Tests passed:
testBuildMPS
testDeletionStudy
testElementalBalance
testFBA
testFVA
testMOMA
testMaps
testModelManipulation
testOptKnock
testRobustnessAnalysis
testSampleCbModel
testgpSampler
testTissueModel
testpFBA

Tests not passed:
testGDLS
testGrowthExpMatch
sbmlTestModelToMat
testModels
testSBML
testDifferentLPSolvers
(These two tests below, I believe, will not work without Tomlab, and so are "normal" failures.)
testC13Fitting
testSolvers

The specific errors that I am getting for each failed test (not including the two normally failing tests) are the following:

testGDLS
Undefined function or variable "parameters".

Error in solveCobraMILP (line 155)
[solverParams.intTol, solverParams.relMipGapTol, solverParams.timeLimit, ...

Error in GDLS>fluxBalance (line 340)
solBiomass = solveCobraMILP(modelb);

Error in GDLS (line 131)
solution0 = fluxBalance(model,selTargetRxns);

Error in testGDLS (line 26)
[gdlsSolution] = GDLS(model, 'EX_succ(e)', 'minGrowth', 0.05, 'selectedRxns',
selectedRxns, 'maxKO', 5, 'nbhdsz', 3);


testGrowthExpMatch -This will load the model and run through steps 1-3 outlined in the beginning of the file. It will error at step 4 with the following:
Undefined function or variable "parameters".
Error in solveCobraMILP (line 155)
[solverParams.intTol, solverParams.relMipGapTol, solverParams.timeLimit, ...

Error in growthExpMatch (line 167)
    solution = solveCobraMILP(MILPproblem);

Error in testGrowthExpMatch (line 58)
[solution]=growthExpMatch(model, KEGGFilename,'[c]', 1, d.dictionary)
;

testModels - I believe this one is a typo in the m-file, as Matlab wants to load a directory that clearly would not be on my computer. Unfortunately, I am not too clear or very proficient on Matlab and the code itself in the beginning of this m-file to know why it is or isn't using this directory compared to the Cobra Toolbox one and to make sure it is loading the correct one.
Error using cd
Cannot CD to
/home/rfleming/work/sbg-code/cobratoolbox_master/testing/testModels/m_model_collection
(Name is nonexistent or not a directory).

Error in testModels (line 209)
    cd(destFolder)


testSBML
Undefined function or variable 'h'.
Error in convertSBMLToCobra (line 155)
    close(h);

Error in readCbModel>readSBMLCbModel (line 184)
model = convertSBMLToCobra(modelSBML,defaultBound,compSymbolList,compNameList);

Error in readCbModel (line 134)
            model = readSBMLCbModel(fileName,defaultBound,compSymbolList,compNameList);

Error in testSBML (line 17)
testModel = readCbModel('Ec_iJR904.xml');

When I specifically call readCbModel('Ec_iJR904.xml'), I get the following:
Undefined function or variable 'h'.

Error in convertSBMLToCobra (line 155)
    close(h);

Error in readCbModel>readSBMLCbModel (line 184)
model = convertSBMLToCobra(modelSBML,defaultBound,compSymbolList,compNameList);

Error in readCbModel (line 134)
            model = readSBMLCbModel(fileName,defaultBound,compSymbolList,compNameList);


testDifferentLPSolvers
Reference to non-existent field 'S'.

Error in testDifferentLPSolvers (line 53)
[m,n]=size(model.S);


sbmlTestModelToMat
Error using sbmlTestModelToMat (line 35)
Not enough input arguments.


All of these errors seem to be Matlab/Cobra having issues loading models, but I am not sure what the issue specifically is or how best to troubleshoot this. Any help would be appreciated!

Thanks,
Michael

Michael O

unread,
Apr 9, 2015, 5:20:43 PM4/9/15
to cobra-...@googlegroups.com
Hello all,
I have made a few changes to some of the files that seemed to have corrected some of the issues.
My current pass/fail is as follows:

 Tests passed:
testBuildMPS
testDeletionStudy
testElementalBalance
testFBA
testFVA
testGDLS
testGrowthExpMatch

testMOMA
testMaps
testModelManipulation
testOptKnock
testRobustnessAnalysis
testSBML

testSampleCbModel
testgpSampler
testTissueModel
testpFBA

Tests not passed:
testC13Fitting
sbmlTestModelToMat
testModels
testDifferentLPSolvers
testSolvers

I made the following changes to get to this point:
initCobraToolbox.m [Failed to load SBML error message. I was apparently getting this and did not see or realize it when I first posted.]
Line 142: TranslateSBML('File Path to Translate SBML');
Had to change to my setup, my SBML file was installed in a separate directory and not within COBRA where it expected it to be.

SolveCobraMILP.m [testGDLS]
Line 83: parameters = ''; is commented out, % needs to be removed to allow the code to run.

convertSBMLToCobra.m [testSBML,testGrowthExpMatch]
This appears to be an issue with showing the loading model indicator (which is variable h)?
Comments (%) removed on Lines 78, 154, 155, 163, 181, 182, 195, 263, 264 allowed to code to run. I might have missed a few in this write up, but removing all comments involving variable h allowed the code to run.

testModels.m [testModels]
Lines 8, 9, 16 need to be changed to your directory containing these files.
Lines 209, 211 - I just put my own directory containing the models here to verify that this worked; I am sure there is a better solution.

Still not working:
sbmlTestModelToMat
I am assuming this might be related to either how my installation process is or the file is not called with the correct inputs during testing?

testDifferentLPSolvers

I first changed line 53 [m,n]=size(model.S); to [m,n]=size(model.A) but ran into problems with how Matlab was setup to display the size of the model. I eventually commented out line 53-56 as they are not actually necessary to run the rest of the code. I then ran into this error:

Error using gurobi
param.lpmethod must be a string, scalar double, or scalar logical

Error in solveCobraLP (line 728)
        resultgurobi = gurobi(LPproblem,param);

Error in testDifferentLPSolvers (line 171)
            solution{i} = solveCobraLP(model,param);

I will probably get around to trying to see what is causing this, but it may be a few days.

Again, any feedback or troubleshooting ideas would be welcome!

Ronan M.T. Fleming

unread,
Apr 13, 2015, 3:10:56 AM4/13/15
to cobra-...@googlegroups.com
Please submit these changes as a pull request.

--

---
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.



--
--
Mr. Ronan MT Fleming B.V.M.S. Dip. Math. Ph.D.
-----------------------------------------------------------------
Senior research associate (EN) == Chercheur (FR),
Principal investigator,
Systems Biochemistry Group,
Luxembourg Centre for Systems Biomedicine,
University of Luxembourg,
Campus Belval,
7, avenue des Hauts-Fourneaux
Esch-sur-Alzette,
Luxembourg,
L-4362.
-----------------------------
Mobile:  +352 621 175 112
Office: +352 466 644 5528
Skype: ronan.fleming
wwwen.uni.lu/lcsb/research/systems_biochemistry
-----------------------------------------------------------------

(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.)

Bulat Zagidullin

unread,
May 19, 2015, 10:56:48 AM5/19/15
to cobra-...@googlegroups.com
Hi Michael,

Thank you very much for providing the solutions you have already found - I am having very similar issues with COBRA installation and your pointers helped me quite a bit. I do have a couple more questions, would you have a look at them?

1) in testModels.m [testModels]
Lines 8, 9, 16 need to be changed to your directory containing these files.
Lines 209, 211 - I just put my own directory containing the models here to verify that this worked; I am sure there is a better solution.
where did you get the .xml files for originFolder function? In current master branch I can find only .mat files in testModels directory. I tried to make testModels by manually creating an xml_model_collection folder under TestModels, downloaded there .xml files from KEGG, named them accordingly and used the newly created directory as originFolder. Still does not work.

2) did you have any success with making sbmlTestModelToMat and testDifferentLPSolvers work? I am also using gurobi and I have same error messages.

cheers
Bulat
Reply all
Reply to author
Forward
0 new messages