Skip to content

Add pfbaEnzymes, enzyme-aware parsimonious FBA - #439

Merged
edkerk merged 2 commits into
develop4from
feat/pfba-enzymes
Aug 28, 2026
Merged

Add pfbaEnzymes, enzyme-aware parsimonious FBA#439
edkerk merged 2 commits into
develop4from
feat/pfba-enzymes

Conversation

@edkerk

@edkerk edkerk commented Aug 28, 2026

Copy link
Copy Markdown
Member

Ports geckopy's pfba_enzymes (utilities/pfba_enzymes.py) to MATLAB — itself ported from the legacy geckopy package (Carrasco et al., 2023, https://doi.org/10.1128/spectrum.01705-23, geckopy/flux_analysis.py:342-386, pfba_protein). Tracked as SysBioChalmers/raven-gecko-parity#23.

What it does

Enzyme-aware parsimonious FBA: among all flux distributions at (or within a fraction of) the optimal objective, finds the one minimising total enzyme usage (sum(usage_prot_*)) rather than total flux. For ecModels this usually picks the most parsimonious proteome, not just the most parsimonious fluxes.

Implementation note

Fixes the current objective as a constraint using the same "fake metabolite" technique solveLP's own minFlux=1 option already uses internally (append a row to model.S equal to model.c, bounded at fractionOfOptimum * optimal with the same ~1e-6 relative safety margin solveLP itself applies) — reusing an established, already-battle-tested pattern in this codebase rather than introducing a new one.

The one design decision flagged in #23

geckopy's usage reactions are forward-only (lb=0) by construction; if one has been flipped to allow reverse flux, cobra's reverse_variable machinery still minimises |flux| correctly for it. MATLAB has no equivalent automatic variable split. Rather than build one for a case that can't currently arise in any real GECKO 3 ecModel, pfbaEnzymes explicitly rejects a usage_prot_<id> reaction with lb<0 instead of silently building an incorrect objective for it.

Verification

Cross-checked against geckopy's pfba_enzymes on an identical ecTestGEM-based fixture (uniform kcat=10, protein pool Ptot=0.5/f=0.5/sigma=0.5): geckopy reports growth =90 and enzyme_usage=125 exactly, using only usage_prot_P5; pfbaEnzymes.m reproduces the same solution (same enzyme usage pattern, same reactions at zero) up to the deliberate ~1e-6 relative safety margin described above. Added testPfbaEnzymesMinimisesEnzymeUsage_tc0024 to geckoCoreFunctionTests.m, covering the default call, fractionOfOptimum, the rxnId objective override, and the gecko-light guard. Full suite: 24 passed, 0 failed.

Ports geckopy's pfba_enzymes (utilities/pfba_enzymes.py) to MATLAB:
among all flux distributions at (or within a fraction of) the optimal
objective, finds the one minimising total enzyme usage
(sum of usage_prot_* fluxes) rather than total flux.

Fixes the objective as a constraint using the same "fake metabolite"
technique solveLP's own minFlux=1 option already uses internally
(append a row to model.S equal to model.c, bounded at
fractionOfOptimum * optimal with the same 1e-6 relative safety
margin), rather than introducing a new pattern.

usage_prot_<id> reactions with a negative lower bound (reverse flux
enabled) are explicitly rejected: minimising raw flux would not
minimise |flux| for those, unlike geckopy's cobra-based forward/
reverse variable split. Not reachable through any real GECKO 3
ecModel today (usage reactions are forward-only by construction).

Cross-verified against geckopy's pfba_enzymes on an identical
ecTestGEM-based fixture: geckopy reports growth=90 and
enzyme_usage=125 exactly; pfbaEnzymes.m reproduces both up to the
~1e-6 relative safety margin, with the same enzyme usage pattern
(only usage_prot_P5 nonzero). Regression test added to
geckoCoreFunctionTests.m, including the fractionOfOptimum, rxnId
override, and gecko-light-guard paths.
@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Unit test results

25 tests   25 ✅  9s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit b5fff36.

♻️ This comment has been updated with latest results.

# Conflicts:
#	test/unit_tests/geckoCoreFunctionTests.m
@edkerk
edkerk merged commit c50700c into develop4 Aug 28, 2026
2 checks passed
@edkerk
edkerk deleted the feat/pfba-enzymes branch August 28, 2026 08:08
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