Question About MMT Code for Building modelStorage

19 views
Skip to first unread message

Nicholas Y

unread,
Feb 3, 2026, 4:43:44 PMFeb 3
to COBRA Toolbox
Hi,

I have a question regarding the `buildModelStorage` function in the Microbiome Modeling Toolbox code for `mgPipe`.

My question concerns the part in the file:

cobratoolbox/src/analysis/multiSpecies/microbiomeModelingToolbox/mgPipe
/buildModelStorage.m

in lines 47-94, when getting the list of active exchange metabolites.

I noticed that in line 48, the COBRA model is loaded, and at line 80, FVA is run to determine which exchange reactions can carry flux. However, when I look at the code, I do not see any diet constraints being applied to the model before FVA is run.

Therefore, I was wondering, is there a specific diet that is used to run this FVA to determine the active exchange metabolites? Or does the code intentionally use whatever exchange bounds the model happens to have when it is loaded?

I noticed that some of the AGORA2 models have exchange bounds of (-1000, 1000) by default. However, there is nothing that guarantees the input model would have all its exchange bounds set to (-1000, 1000). For example, if I were to use a custom model where the exchange bounds were all set to (-0.1, 1000) in the .mat file, would it run FVA with the bounds set to (-0.1, 1000)?

If that is the case, is that the intended behavior or is this a potential bug? If I am using custom models that were saved with custom diet constraints applied to them, should I ensure all exchange bounds are set to (-1000, 1000) in all models in the model directory before running mgPipe?

Thank you for your time and insights!

Best regards,
Nicholas Yousefi

Almut Heinken

unread,
Feb 17, 2026, 5:48:46 PM (9 days ago) Feb 17
to cobra-...@googlegroups.com
Hi Nicholas,
the purpose of determining which exchange reactions can carry flux in the first half of buildModelStorage is to exclude metabolites that can never be produced by any microbes from the later simulations to save time. As the tool is intended to be used with AGORA2 with standard constraints on, this indeed assumes that all exchanges are open. If this is not the case and any diet is implemented, then metabolites that cannot be produced on this diet would not be predicted later. In any case, the exchanges are opened in the second half of buildModelStorage so any diet constraints will be removed then. The diet is later implemented on the community as a whole and should not be on the individual microbes. I see your point that still having diet constraints on at the beginning of the function might cause issues though. I will consider opening the exchanges at the beginning of the function.
I hope that makes things clearer.
Best regards,
Almut

--

---
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/3f70ae15-df2a-45dc-95bd-a71c2b05075bn%40googlegroups.com.

Nicholas Y

unread,
Feb 22, 2026, 4:46:56 PM (4 days ago) Feb 22
to COBRA Toolbox
Hi Almut,

Thank you for your response! Yes, that clarifies things.

Best regards,
Nicholas

Reply all
Reply to author
Forward
0 new messages