Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix: objective reaction not adhering to upper bound #18

Open
mquintin opened this issue Aug 29, 2019 · 1 comment
Open

Bug fix: objective reaction not adhering to upper bound #18

mquintin opened this issue Aug 29, 2019 · 1 comment

Comments

@mquintin
Copy link
Member

mquintin commented Aug 29, 2019

Bug description: In FBACell.run, the upper bound on the biomass reaction is set to be equivalent to the rate that would fill the current cell. This overrides the limit set in the model file, which we may want to limit. For example, I discovered this when trying knockouts of every reaction, and the model that knocks out the "growth" reaction still grew.

Sorry for not making this change myself, turns out my local code base is kind of screwy since I didn't properly migrate to the github repo. Could one of you please make the following changes?

Step 1: Modify FBACell.run(model[]) to change the part that says
/************************* SET MAX BIOMASS *****************************/
((FBAModel)models[i]).setObjectiveUpperBound((cParams.getMaxSpaceBiomass() - (Utility.sum(biomass) + Utility.sum(deltaBiomass))) / (biomass[i] * cParams.getTimeStep()));
to
/************************* SET MAX BIOMASS *****************************/

double bioUB = ((FBAModel)models[i]).getBaseUB()[((FBAModel)models[i]).getBiomassReaction()];

double capacityUB = (cParams.getMaxSpaceBiomass() - (Utility.sum(biomass) + Utility.sum(deltaBiomass))) / (biomass[i] * cParams.getTimeStep());

((FBAModel)models[i]).setObjectiveUpperBound(Math.min(bioUB, capacityUB));

Step 2: Add getBaseUB() to FBAModel
public double[] getBaseUB() { return baseUB; }

@jeremymchacon
Copy link
Contributor

This should be fixed in my "signal bugfix" pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants