Skip to content

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

@mquintin

Description

@mquintin

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; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions