Issue with ibm_cplex contradiction and inconsistent BMF Calculation in COBRA Toolbox

65 views
Skip to first unread message

Li Jinxia

unread,
Apr 3, 2025, 1:16:07 AMApr 3
to COBRA Toolbox
Hi everybody,

I am very excited to join this group and have the opportunity to learn and discuss Constraint-Based Metabolic Reconstruction with all of you. I truly appreciate this community's collaborative spirit!  

I am a first-year Ph.D. student and I am just starting to learn metabolic model restruction. The software version I am using is IBM CPLEX 1210 and MATLAB 2020b. While initializing the COBRA Toolbox using initCobraToolbox, I found that the ILOG_CPLEX environment variable is detected, but the "Summary of available solvers and solver interfaces" does not show ibm_cplex. Additionally, running [solverOK, solverInstalled] = changeCobraSolver(solverName, solverType, printLevel, validationLevel) did not report any issues (details are in the attached WBMM_Solver_test.html). I also ran the testAll function to check the core functionality, but found several instances where the error "ibm_cplex is a required solver for the test and not available on your system" occurred (details are in the attached testAll.html). The contradictions are too confusing and I am unsure whether ibm_cplex is available in my analysis?  

Furthermore, while following the procedure outlined in MethodSection3 from the GitHub repository (2020_WholeBodyModelling in cobratoolbox.papers), I encountered an issue with the calculated male Basal Metabolic Flux (BMF) using Harvey_1_03c. The value I obtained is 100 times larger than the expected result. I have followed the code and demo data precisely, but the results still differ (details are in the attached testAll.html). I checked the constraints carefully, in line with the pipeline, so it was very tricky for me.

Has anyone else encountered the similar issues? I would be truly grateful if someone could provide some guidance!  

Best regards,
Jinxia Li


Ines Thiele

unread,
Apr 3, 2025, 5:44:01 AMApr 3
to cobra-...@googlegroups.com
Dear Jinxia,

I assume that you saw our response to your inquiry a few days back. 

I run the tutorial with both Harvey 1_03c and 1_03d
MATLAB2020b, Windows, Cplex1210
And I obtained comparable results to the tutorial.

Could you please double check the Whole_body_objective_rxn upper bound in your model?

My best guess is that you may have skipped running line 184 
male = changeRxnBounds(male,'Whole_body_objective_rxn',1,'b');

Leaving the rxn with the latest constrain set in line 161
male = changeRxnBounds(male,'Whole_body_objective_rxn',100,'u');

That could explain the 100 times difference.

Best regards,
Ines & Filippo 
------
Ines Thiele, PhD
Professor in Systems Biomedicine
Director, Digital Metabolic Twin Centre
Principal Investigator, APC Microbiome Ireland 
Principal Investigator, Ryan Institute
Principal Investigator, Galway Neuroscience Centre

University of Galway
School of Medicine
School of Biological and Chemical Sciences | Microbiology, 
Orbsen Building | Galway, Ireland

thielelab.eu,
GoogleScholarProfile,
Follow me on LinkedIn

CONFIDENTIALITY.  The content of this email (including any attachment(s)), is/are confidential and may be privileged and is intended for the addressee only. Any reader of this message who is not the intended recipient is notified that any dissemination, distribution or copying of this communication is prohibited. If you receive this communication in error, please notify me immediately and please also delete all copies from your computer system. Thank you for your co-operation.


--

---
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 visit https://groups.google.com/d/msgid/cobra-toolbox/3c245ef3-8d72-488a-91e3-377ca3ff355fn%40googlegroups.com.

Li Jinxia

unread,
Apr 6, 2025, 10:58:04 PMApr 6
to COBRA Toolbox
Dear professor Ines,

Thank you very much for your prompt response. I apologize for the delayed reply, as we are currently observing the Qingming holiday here in China.

I have double-checked the upper bound for the Whole_body_objective_rxn (as shown in the attached image) and have updated it: male = changeRxnBounds(male, 'Whole_body_objective_rxn', 1, 'b');

However, I am still quite puzzled and wondering if there could be any other factors, such as additional code or solver configurations, that might be causing this issue.reaction_bound.png

I would greatly appreciate your guidance on this.

Best regards,  
Jinxia
test.html

Daniel Fässler

unread,
Apr 7, 2025, 5:01:12 AMApr 7
to COBRA Toolbox
Hi all,

I had a quick check and I run the tutorial with with Harvey 1_03c and 1_03d and MATLAB2021a, Windows, Cplex129.
I obtained the same result as Jinxia. However, when going back to an older version of the cobratoolbox I obtained the same result as Ines & Filippo.
After investigating I noticed that in line 89 in optimizeWBModel.m param.minNorm is wrongly set to zero (at least in my matlab version):
...........
if ~isfield('param','minNorm')
    param.minNorm = 0;
end
.........

The single quotes (') should probably be removed (as param is a 1x2 struct)?  Instead:
...........
if ~isfield(param,'minNorm')
    param.minNorm = 0;
end
.........


This matters because later, at line 135:

if ~isfield(param,'solveWBMmethod')
    if param.minNorm~=0
        param.solveWBMmethod = 'QP';
    else
        param.solveWBMmethod = 'LP';
    end
end


Since param.minNorm was wrongly set to zero, param.solveWBMmethod is set to 'LP'. This value then persists until line 239:
switch param.solveWBMmethod
    case 'LP'

So the vector obtained is from the LP solution instead from the QP solution in the current cobratoolbox. After changing line 89 and making sure to be in:

    case 'QP'
        solution = optimizeCbModel(model, model.osenseStr, param.minNorm, allowLoops, param);

I’m getting a non-optimal QP solution (solution.stat = 3, origStatText = 'Unknown CPLEX Status value').
This suggests that other functions might need to be fixed, though I can’t identify them at the moment.

Could you Ines/Filippo please check if I might be mistaken? Thank you very much and best wishes,

Daniel

Li Jinxia

unread,
Apr 7, 2025, 11:41:10 PMApr 7
to COBRA Toolbox
Dear Daniel,

I would like to sincerely thank you for taking the time to test and provide feedback. Your effort is greatly appreciated.  

If possible, I would be very grateful if you could share the old version of the COBRA Toolbox with me.

Thank you again for your support, and I wish you all the best in your work and endeavors.  

Warm regards,
Jinxia

Ines Thiele

unread,
Apr 8, 2025, 3:30:01 AMApr 8
to cobra-...@googlegroups.com, Toolbox COBRA
Thanks Daniel for identifying the typo.

We will correct this asap.

Best Ines


Sent from my iPhone

On 8 Apr 2025, at 04:41, Li Jinxia <ljin...@gmail.com> wrote:

Dear Daniel,
Reply all
Reply to author
Forward
0 new messages