Skip to content

Balanced variant choices (LNG_BALANCE_CHOICES, deltasignal specs/101) - #126

Merged
adamjohnwright merged 2 commits into
mainfrom
balance-choices-101
Oct 24, 2026
Merged

adamjohnwright merged 2 commits into
mainfrom
balance-choices-101

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

bind_output_slots binds an output set to an input set only when reference signatures match exactly, so a reaction like "MDM2 forms homo- or heterodimers" (R-HSA-6804741) was emitted as the full input × output cross product. Two of its four copies are unbalanced: p-MDM2 alone makes MDM2:MDM4 (creating MDM4), and MDM4 + p-MDM2 makes the MDM2 dimer (losing MDM4).

balance_choices (in src/variant_emission.py) scores each copy by the proteins its outputs gain plus the proteins its inputs lose. It drops a copy only when a lower-scoring copy exists with the same outputs AND another exists with the same input choice. So an input with no balanced partner keeps its best copy.

Measured (deltasignal specs/101, registered gate as specs/077), arm bal vs canonical defaults:

  • Curator held-out: +30 (34 fixed / 4 broken, p < 1e-4). Mostly IL-4/13: p-STAT6 no longer makes the STAT3 dimer.
  • Curator tuning: −12.
  • Experimental: −4 (2 / 6). No RAF case moves.
  • Worst pathway: ERBB2 −7. EGFR and ERBB3 knockouts no longer feed every ERBB2 heterodimer.
  • The MDM4 knockout case inverts: the freed MDM2 homodimer raises the ligase pool.
  • Gate passes. Adopted by Adam 2026-10-24.

Structure:

  • 38 of 92 pathway tables change.
  • The flag-off build is identical to canonical.

Changes:

  • Flag LNG_BALANCE_CHOICES, default 1.
  • PIPELINE_SETTINGS.md row.
  • Three tests in tests/test_variant_emission.py.

Checks: full suite passes except the known stale test_main_edges_proportional_to_best_matches[...983169], which also fails on main. mypy is clean.

🤖 Generated with Claude Code

adamjohnwright and others added 2 commits October 24, 2026 13:07
…on copies whose protein content does not balance when better-balanced copies exist on both the output and the input side (MDM2 alone made MDM2:MDM4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…0, exp -4, gate passes)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit f2c6a71 into main Oct 24, 2026
4 checks passed
@adamjohnwright
adamjohnwright deleted the balance-choices-101 branch October 24, 2026 20:34
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

Successfully merging this pull request may close these issues.

1 participant