objective function pairwise model

92 views
Skip to first unread message

Sofi Z

unread,
Mar 6, 2023, 4:46:53 PM3/6/23
to COBRA Toolbox
Dear community,

I have a pairwise model with two organisms and when optimising the model as such: fbatestconstraints = optimizeCbModel(community,'max');  I get very different growth rates for one organism with each run (either 0.2 or 0.03) while the growth rate stays the same for the other organism. This occurs without changing any of the constraints.What reasons could there be for this and is it related to what objective function is maximised?

I have set the objective function as such
biomasses = {'growth_rate1','growth_rate2'}for the individual species objectives, when creating the pairwise mode.

What obejctives are maximised when I run
fbatestconstraints = optimizeCbModel(community,'max') ? Is it the community obejective being maximised at the same time as both of the individual species objectives? Or is only one species objective maximised at a time?

Thank you in advance,

Sophie 

Almut Heinken

unread,
Mar 10, 2023, 5:07:22 AM3/10/23
to cobra-...@googlegroups.com
Dear Sophie,
could you clarify how you set up the model exactly? Did you create a community biomass function or maximize both BOFs simultaneously?
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 on the web visit https://groups.google.com/d/msgid/cobra-toolbox/97ec40d6-672a-4d2c-a803-224da7090a35n%40googlegroups.com.

Sofi Z

unread,
Mar 10, 2023, 6:14:59 AM3/10/23
to COBRA Toolbox
Dear Almut,

I have created the pairwise model defining the biomasses as such: biomasses = {'growth_rate1','growth_rate2'} and then applied constraints on the created pairwise model using community = changeRxnBounds(...) and then optimised this model using fbatestconstraints = optimizeCbModel(community,'max'). Maybe I have overlooked this but I could not find any information on what is being optimised if the procedure described here is carried out so I don't know if both species are optimised simultaneously. How do I create a community biomass function? 

Best wishes,

Sophie 

Almut Heinken

unread,
Mar 10, 2023, 7:22:56 AM3/10/23
to cobra-...@googlegroups.com
Dear Sophie,
could you post the exact code that you ran?
Thanks,
Almut

Sofi Z

unread,
Mar 10, 2023, 9:19:46 AM3/10/23
to COBRA Toolbox
Dear Almut,

The code for the creation of the pairwise model:

initCobraToolbox
modPath = [pwd filesep 'current model']
modelList = {'model1','model2'}
biomasses = {'growth_rate1','growth_rate2'}
joinModelsPairwiseFromList(modelList, modPath,'biomasses',biomasses);

Code for running FBA:

initCobraToolbox
communitymodel = readCbModel('pairedModel_model1.xml_model2.xml.mat');
communityvalues = [0 0 0 0 0 0...]
communityconstraints = ["EX_s_1470[u]","EX_s_0003[u]","EX_s_0022[u]",....]
community = changeRxnBounds(communitymodel,communityconstraints,communityvalues,'l');
fbatest = optimizeCbModel(community,'max');  (a)
fbatest = optimizeCbModel(community,'max');  (b)
fbatest = optimizeCbModel(community,'max');  (a)
fbatest = optimizeCbModel(community,'max');  (a)
fbatest = optimizeCbModel(community,'max');  (a)
fbatest = optimizeCbModel(community,'max');  (b)


The (a) and (b) are not part of the code. I have run this: fbatest = optimizeCbModel(community,'max'); several times and there are two possible outcome flux distributions a and b that are different to each other and I have indicated the outcome (either a or b) in the brackets. So for example I optimise it the first time and it shows me the distribution a and then I run it again without changing anything and it shows me the flux distribution b.

Best wishes,

Sophie

Sofi Z

unread,
Mar 14, 2023, 1:28:21 PM3/14/23
to COBRA Toolbox
Dear Almut,

I think the obejctive function of the model that is listed first, when the pairwise model is joined, is being maximised. Because when I join the models as such:
modelList = {'model1','model2'}
the growth rate of species one is 0.0034 and of species two is either 0.02 or 0.222
and when I join the model as such:
modelList = {'model2','model1'}
the growth rate of species one is 0 and of species two is 0.23 (In this case I still get two different possible flux distributions, but not different growth rates.

Could you confirm if this is true and how can I make it maximise for both species at the same time or create a community objective?

Best wishes,

Sophie

Almut Heinken

unread,
Mar 14, 2023, 1:45:02 PM3/14/23
to cobra-...@googlegroups.com
Dear Sohpie,
with the pairwise modeling module, growth ratios between the species are not fixed so there are multiple possible trade-offs between them. You can plot all of these by using the Pareto optimality function from the tutorial. If you want to have a community objective function, you need to use mgPipe, but in that case, you need to predefine the relative abundances.
Best regards,
Almut

Reply all
Reply to author
Forward
0 new messages