Deterministic, score-aligned reaction placement (fixes 52.8% agreement regression) - #83
Open
edkerk wants to merge 1 commit into
Open
Deterministic, score-aligned reaction placement (fixes 52.8% agreement regression)#83edkerk wants to merge 1 commit into
edkerk wants to merge 1 commit into
Conversation
The placement master maximises a gene-localisation objective that never mentions the per-reaction placement variable, so each reaction's compartment was a free co-optimum: the pinned solver returned it reproducibly but arbitrarily, giving 52.8% reaction agreement with curated yeast-GEM (an earlier un-pinned build happened to land ~72%). Add a lexicographic second pass: fix the gene layout to the primary optimum (fixing the y solution, not the objective value, so there is no tolerance to tune), then place each reaction in the compartment its own enzymes are predicted to occupy -- the summed DeepLoc score of the reaction's genes, with a small default_compartment prior so genes-free and score-tied reactions fall there deterministically. Yeast reaction agreement rises to 72.5% (1408/1943) and now rests on the localisation evidence rather than a solver tie-break; gene agreement is unchanged (88.7%, 716/807 -- the gene layout is untouched); coherent placement adds fewer transports (1001 -> 967); growth and blocked fraction unchanged; the warm-started second solve adds ~4s. Reproducible across independent runs. Docs updated (yeast_validation, localization_redesign, multiorganism_validation footnote); the multi-organism reaction-agreement rows await re-measurement.
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.
The placement master maximises a gene-localisation objective — it never mentions the per-reaction placement variable
x. So each reaction's compartment is a free co-optimum: the solver returns whichever vertex it lands on. Pinning the solver (an earlier fix) made that reproducible, but still arbitrary — reaction agreement with curated yeast-GEM was 52.8 %, while an earlier un-pinned build happened to land ~72 %. Neither number reflected the localisation evidence; both were solver accidents.The fix
A lexicographic second pass in
_solve_placement_master:ybinary set to its stage-1 value (fixing the solution, not the objective value, so there is no near-optimal tolerance to tune).xonly, placing each reaction in the compartment its own enzymes are predicted to occupy: rewardx[r, c]by the summed DeepLoc score ofr's genes forc, with a smalldefault_compartmentprior so genes-free and score-tied reactions fall there deterministically.The gene layout is untouched, so gene agreement and the multi-compartment consolidation are unchanged; only the reaction placement — which was free — becomes meaningful.
Result (yeast-GEM, re-verified; reproduced identically across independent runs)
Reaction agreement now rests on the localisation evidence, not a solver tie-break; coherent placement fragments fewer metabolites across compartments, so it needs fewer transports. The
1408/1943placement matches the number the original (pre-pin) design doc recorded — this recovers it deterministically and by principle.Docs
yeast_validation.md: reaction agreement 72.0 % → 72.5 % (1408/1943), transports 1001 → 967, plus the deterministic-placement rationale.localization_redesign.md: its 72.5 % (1408/1943) already matched; added the tie-break explanation.multiorganism_validation.md: footnote — the reaction-agreement column predates the tie-break and awaits re-measurement (gene agreement / growth / blocked are unaffected). Re-measuring Human-GEM / AraCore / iCre1355 is follow-up (their models were not available in this environment).Tests
Full suite green; ruff and mypy clean. Existing placement assertions (
r1 == ["m"], default-compartment cases, multi-localisation) pass unchanged — the score-following secondary agrees with their intent.