Problem with fastgapfill in Matlab

179 views
Skip to first unread message

Enuh Blaise

unread,
Jun 1, 2021, 5:15:01 AM6/1/21
to COBRA Toolbox
Hello,

Thank you for adding me to the group. I am a new COBRA user presently using the tool to develop a models for Polyhydroxybutyrate production in halophiles.

I have a draft reconstruction from carveme with some blocked reactions and dead end metabolites, tried to do a fastgapfill in cobra but it gives an error after several hours of running.

I used the code
%%Identification of dead-end and Blocked reactions
deadEndMetabolites = detectDeadEnds(model);
[deadEndMetabolites, rootGaps, downstreamGaps] = gapFind(model, 'true');
blockedReactions = findBlockedReaction(model);

%%Gapfinding in the model
%%Metabolites that cannot be produced or consumed by any of the reactions in the network are referred to asrootGaps
 [allGaps, rootGaps, downstreamGaps] = gapFind(model, findNCgaps, verbFlag);

%%Prepare Gapfilling
[consistModel, consistMatricesSUX, blockedRxns] = prepareFastGapFill(model);


Attached is my systems configuration report and a screenshot of the error. I tried re running the code 2 to 3 more times but got the same error. I dont know what happened. Please I need some help. 


Enuh
2021-05-31_Matlab_Screenshot_Initial_Ccanadensis_Model_Characteristics.png
COBRAconfigReport.log

Kretaks

unread,
Jun 1, 2021, 5:44:16 AM6/1/21
to cobra-...@googlegroups.com
Hey Enuh,

I would suggest you go to the solveCobraLP.m line 943 and put a breakpoint there.
Run the code again and when it stops at that line check what structure LPproblem has. Sense should contain '='. I am guessing your model has wrong values there.
I am guessing there are several ways to fix this. My first try would be deleting model.sense field and test if it works

Hope this helps,
Kristaps

--

---
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/debcf0ae-4777-4b46-99e6-ba5584e4ed75n%40googlegroups.com.

Enuh Blaise

unread,
Jun 2, 2021, 4:44:56 AM6/2/21
to cobra-...@googlegroups.com
Hello Kristaps,

Thank you for your response, I will implement these suggestions and hopefully it works. 

On a fundamental level, what is the cause of this issue, if I may ask, So i could probably generate other possible fixes and try them.

Enuh 

You received this message because you are subscribed to a topic in the Google Groups "COBRA Toolbox" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cobra-toolbox/lPliTAiwgd8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cobra-toolbo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cobra-toolbox/CAMNOk%2BvSU5%2BHDb%3D0CXGmSJqohCYG6L1QJe_3mQ%2B%2B4NCsUKredA%40mail.gmail.com.

Kretaks

unread,
Jun 2, 2021, 4:57:59 AM6/2/21
to cobra-...@googlegroups.com
Hello Enuh,

I would need to see the structure of your model to answer this question.
I suspect sense field is defined incorrectly

Kristaps

Enuh Blaise

unread,
Jun 2, 2021, 5:21:39 AM6/2/21
to cobra-...@googlegroups.com
Hello Kristaps

I have included the structure. Thats how it looks like when directly read from the CarveMe xml output with readCbModel


image.png



Kretaks

unread,
Jun 2, 2021, 5:56:22 AM6/2/21
to cobra-...@googlegroups.com
Hello Enuh,

Can you show a snippet of model.csense field?

Kristaps

Enuh Blaise

unread,
Jun 2, 2021, 6:28:55 AM6/2/21
to cobra-...@googlegroups.com
Hello Christaps

Sure, It is an array of only "E"s

image.png

Enuh

Kretaks

unread,
Jun 2, 2021, 8:38:35 AM6/2/21
to cobra-...@googlegroups.com
Hello Enuh,

Seems like none of my initial ideas about causes of your problem turned out to be correct
There are few google results about gurobi errors similar to yours

for example:

My best guess is that somewhere in prepareFastGapFill.m function model.sense field is created in different length as model.A field and that creates error.
If you could provide your model, I could try to recreate the error you get and try to find a solution

Kristaps

Enuh Blaise

unread,
Jun 2, 2021, 4:57:31 PM6/2/21
to cobra-...@googlegroups.com

Ronan M.T. Fleming

unread,
Jun 2, 2021, 7:05:39 PM6/2/21
to COBRA Toolbox



--
--
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
&
Senior Lecturer,
School of Medicine,
National University of Ireland, Galway.
----------------------------------------------------------------------------
Peer-reviewed publications: https://goo.gl/FZPG23
Mobile:  +353 852 109 806
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.)

Kretaks

unread,
Jun 8, 2021, 2:48:58 AM6/8/21
to cobra-...@googlegroups.com
Hello Enuh,

Sorry that it took so long for me to write this,

Your model contains reactions and metabolites whose names are different from those in the default dictionary file.
For example your model contains met names: "Nicotinamide adenine dinucleotide" while default dictionary file has name NAD
For successful gap fill you should create your own dictionary -> model.metNames to KEGG names

That can be done by parsing your model xml file for met names and their respective KEGG identifiers.
image.png

I hope someone who knows this function better can correct me if I am wrong

Best wishes,
Kristaps

Enuh Blaise

unread,
Jun 8, 2021, 2:09:51 PM6/8/21
to cobra-...@googlegroups.com
Hello Kristaps,

Thank you for your reply. From Dr. Ronan's reply and yours I see there is a problem of file structure. means this could probably be during parsing. I was also thinking maybe there is an incompatibility between gurobi 9.1.1., Matlab 2018b and and cobra v3. I am also trying to vary the versions according to the cobra tutorials to see if it gets solved. While waiting for others response, If i get a fix i will share in the group as well. Thank you once more


Regards
Enuh

Reply all
Reply to author
Forward
0 new messages