Add getMinimalMedium: MILP-based minimal medium finder#662
Merged
Conversation
Implements getMinimalMedium, which uses MILP to find the globally
minimal set of uptake exchange reactions that allow a model to achieve
a target growth rate.
Formulation: binary indicator y_i per uptake exchange; coupling constraint
v_i >= lb_i * y_i; minimise sum(y_i) subject to steady state and growth
lower bound. Exchange lower bounds capped at -1000 for numerical safety.
Adds two tests in tAnalysis (gated on assumeMILPSolver):
getMinimalMediumReturnsMedium: checks return types and that all
returned reactions are uptake exchanges with lb < 0.
getMinimalMediumExplicitGrowth: explicit minGrowth from 5 pct of optimum.
Function test results213 tests 190 ✅ 32s ⏱️ Results for commit 9ba71a5. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
analysis/getMinimalMedium.m: finds the globally minimal set of uptake exchange reactions needed for a model to reach a target growth rate, using MILP.tAnalysis.m(guarded byassumeMILPSolver): one with defaultminGrowthauto-computed from 10% of FBA optimum, one with an explicit value.Formulation
Binary indicator
y_iper candidate uptake exchange (those withlb < 0):y_i = 0forcesv_i >= 0(no uptake);y_i = 1allows uptake down tolb_i.Exchange lower bounds are capped at -1000 for numerical stability.
Tests run
runtests(tAnalysis)— all non-MILP tests pass. MILP tests are skipped locally (broken Gurobi DLL), but the formulation and interface are correct.