Skip to content

Phase 1: Python package skeleton on the GECKO 4 ecModel - #3

Merged
edkerk merged 5 commits into
masterfrom
feat/py-phase1-skeleton
Sep 25, 2026
Merged

edkerk merged 5 commits into
masterfrom
feat/py-phase1-skeleton

Conversation

@edkerk

@edkerk edkerk commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

First of a staggered series porting this analysis from GECKO 2 / MATLAB to
GECKO 4 / Python. This PR lands no analysis yet — only the foundation the
later phases build on — so it is safe to read quickly.

What changed

  • legacy_matlab/ — the MATLAB pipeline, its models and its results move
    there wholesale. Nothing is deleted; every path is a rename.
  • models/ — the GECKO 4 ecYeastGEM.yml and the conventional
    yeast-GEM.yml it derives from, both from GECKO develop4 at cbc4ca33.
    models/PROVENANCE.md records the source commit, the blob hash and how to
    verify it.
  • src/overflow/ — config.py (paths, reaction IDs, parsed conditions),
    adapter.py (geckopy adapter, model loading), biomass.py (the yeast-GEM
    component layout raven-toolbox needs).
  • tests/ — 24 tests, all passing.
  • CI on Python 3.11/3.12/3.13.

Feasibility gate

Before writing any of this I checked that the GECKO 4 model can support these
chemostats at all, by building each condition end to end. All five reach their
measured dilution rate:

Condition D [1/h] reached enzymes raised enzymes freed
CN4 0.10 0.10015 36 33
CN22 0.10 0.10100 27 26
CN38 0.10 0.10100 33 26
CN75 0.10 0.10100 26 25
hGR 0.29 0.29290 43 39

Two findings from that gate that shape the later phases:

  1. Growth is stoichiometrically capped at almost exactly D. The
    conventional GEM reaches 0.1001 at the measured glucose uptake — there is
    no slack. Anything that costs the model a little carbon makes the condition
    infeasible rather than merely slower.
  2. Stock flexibilize_enz_concs is not sufficient, stalling at 0.056 for
    CN4. What works is the original's own scheme: a per-enzyme minimum-usage
    pre-pass followed by iterative freeing of the top limiting enzyme. Phase 3
    ports that rather than substituting geckopy's.

Model coverage against the GECKO 2 model

The swap is close to lossless: 813 of the old model's 816 enzymes are retained,
331 are new, and measured proteins that are model enzymes go from 590 to 695.
Only 2 measured enzymes are lost.

Notes for review

  • sigma = 1 in model_adapter.toml, matching the original's
    getModelParameters.m; the enzyme constraints come from measurements rather
    than an assumed saturation.
  • The package reads data/ and models/ relative to the repository root, so
    it is meant to be used from a checkout rather than installed standalone.

The GECKO 2 pipeline, the models it built and the results it produced are
kept for reference. The Python pipeline replacing it needs the top-level
code/, models/ and results/ paths.
Both from GECKO develop4 at cbc4ca33, built with GECKO 4.0.0b1 and
RAVEN 3.0.0b1. PROVENANCE.md records the source commit and blob hash,
and the two model properties the pipeline has to override: NGAM ships
pinned at 0.7 and the protein pool at the distributed default.
config.py names the reaction IDs and parses the measured conditions,
including the per-condition replicate column prefixes -- hGR's columns
are named CN_hGR_*, unlike every other condition. biomass.py supplies
the yeast-GEM component layout that raven-toolbox's sumBioMass and
scaleBioMass arithmetic needs, plus the polymerization costs.
The model tests pin what the pipeline relies on -- enzyme count, usage
reactions drawing from the pool, molecular weights in Da, the pinned
NGAM -- so that replacing the model file cannot change them silently.
@edkerk
edkerk merged commit 44c1307 into master Sep 25, 2026
3 checks passed
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