Add assignCompartments: functionality-constrained compartment-assignment MILP#668
Open
edkerk wants to merge 1 commit into
Open
Add assignCompartments: functionality-constrained compartment-assignment MILP#668edkerk wants to merge 1 commit into
edkerk wants to merge 1 commit into
Conversation
…ent MILP MATLAB port of raven-toolbox/assignCompartments' core: a single MILP (built as a COBRA prob and solved via optimizeProb, like gapFillMILP) that places the requested reactions into the compartments named in a GSS while requiring the objective to stay producible. Pathway coherence is emergent -- a reaction is placed against its own top score when the network needs it there. Mono-localization; passive transports (default<->c) added where needed; merges the model to a single compartment first (like predictLocalization), then re-distributes. optimizeProb already sets intTol=1e-9, so the Big-M flux gating does not leak. Returns the compartmentalised model, the per-reaction placement, and the added transports. Validated in MATLAB (tAssignCompartments, 3 tests): functionality overrides the localization score (a confined metabolite keeps a reaction in cytosol against its higher score), the score is respected when transports keep the model functional, and an unreachable growth floor is reported. Gap-fill coupling (universal/z candidates) is deferred to a follow-up.
Function test results239 tests 210 ✅ 59s ⏱️ Results for commit b02f80f. |
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.
assignCompartments — functionality-constrained compartment assignment (MATLAB)
Phase 4 of the assignCompartments work: a MATLAB port of the core assignment MILP, bringing the deterministic, functionality-guaranteeing alternative to
predictLocalizationinto RAVEN.What it does
A single MILP (built as a COBRA
proband solved viaoptimizeProb, likegapFillMILP) places the requested reactions into the compartments named in aGSS(gene scoring structure, as fromparseScores) while requiring the model's objective to stay producible:Because functionality is a hard constraint, a reaction is placed against its own top score when the network needs it there — pathway coherence is emergent, not heuristic. Mono-localization; passive transports (
default ↔ c) are added where needed. The model is merged to a single compartment first (likepredictLocalization), then re-distributed.optimizeProbalready setsintTol = 1e-9, so the Big-M flux gating does not leak ghost flux (the bug that bit the standalone Python tool, which used cobra/optlang's loose default).Validation —
tAssignCompartments(3 tests, pass in MATLAB)m-score;exitFlag = -1).Scope
Core mono-localization assignment with transports. Gap-fill coupling (a
universalcandidate set) is deferred to a follow-up. Returns the compartmentalised model, the per-reaction placement, and the added transports.