Repository navigation
Releases: CompMetEng/geckopy
Release list
v4.0.0b1
Version realignment: geckopy numbering will be aligned with GECKO (MATLAB),
justifying a jump to 4.x. This is the first release published to PyPI.
- New:
kcat_tuning.evotunefitsec.kcatto measured growth rates and
exchange fluxes with CMA-ES (screen_kcat_leverage,select_tunable_mask,
cmaes_kcat_tuning,tune_prior_penalty_weight), replacing the earlier
ABC-SMC approach.EvotuneResult.corrections()reports a tuning run as a
ranked table of what changed and why, rather than a raw kcat vector. Gated
behind the newevotuneextra. - New:
gather_kcats.review.review_assignmentflags kcat-assignment
problems (repeated values, EC-maximum fallback, implausible magnitude)
worth curating before a tuning run. kcat_sensitivity_analysisrenamed tokcat_tuning, with the CMA-ES
subpackage namedevotunerather thanbayesian— the shipped method is
CMA-ES, not Bayesian inference.flexibilize_enz_concs: the post-loop refinement now uses MATLAB's soft
±0.25% growth band instead of pinning toexp_growthexactly, matching
flexibilizeEnzConcs.m.make_ec_modelno longer splits exchange reactions in the irreversibility
stage, matchingmakeEcModel.m'snonExchRxnsexclusion.get_reactions_from_enzymenow matchesprotein_idcase-insensitively,
matching MATLAB'sstrcmpi.read_dlkcat_outputgained an opt-instrict=Truefail-fast on
unrecognized substrates, matching MATLAB, and now reports drop reasons
separately instead of lumping them together.assign_standard_kcat: a NaN-kcat reaction no longer counts toward a
subsystem's threshold eligibility or gets folded into the subsystem
median; unset kcats now get filled for NaN too, not just literal zeros.parse_okp_outputnow tags provenance with theOKP-prefix MATLAB
applies;merge_kcatsstrips it again before source-priority matching so
tagged rows still rank correctly.set_kcat_for_reactionsnow accepts a per-isozyme kcat list against an
un-suffixed base name (assigned positionally, matching MATLAB), and writes
ec.source = "setKcatForReactions"(MATLAB's actual value) instead of
"manual".ec_fseof: scan floor now anchors to the production target's flux at
biomass-optimum instead of a fixed fraction of the theoretical maximum,
and candidates are restricted to gene-associated, non-standard reactions
before classification — both matchingecFSEOF.m.ec_fva's parallel path now usescobra.util.process_pool.ProcessPool
instead of a hand-rolledmultiprocessing.Pool— fixes a slow Windows
initializer handoff and gives graceful pool teardown. Public signature
unchanged.raven-toolboxdependency switched from agit+...@developpin to the
PyPI>=3.0.0b1release, which carries theconvert_to_irreversible(..., rxns=...)additionmake_ec_modelneeds.- Packaging: the sdist was bundling the entire local
.venv-win
virtualenv (~60MB, including a compiled scipy wheel) because.gitignore
listed.venv/but not.venv-win/, and hatchling's default sdist
selection only reads the top-level.gitignore. release.yml: PyPI publish job enabled (trusted publishing).- README: disambiguation note simplified and repointed at the specific old
geckopyrelease (2.0.2and earlier), now that this project has taken
over the PyPI project name itself.
Full changelog: https://github.com/SysBioChalmers/geckopy/blob/main/CHANGELOG.md
Compare: v0.3.0...v4.0.0b1
v0.3.0
Parity pass against the MATLAB GECKO Toolbox: geckopy's core functions now reproduce every value GECKO's own unit-test suite pins down.
Added
tests/test_gecko_matlab_parity.py— a 1:1 port of GECKO'stest/unit_tests/geckoCoreFunctionTests.m(47 tests, MATLAB test casestc0001–tc0013), run against the sameecTestGEMfixture MATLAB uses. Every expected value is copied verbatim from the MATLAB sources rather than re-derived from geckopy's output, so the file is the executable definition of "geckopy builds the same ecModel as GECKO". It needs no MATLAB to run and coversmakeEcModel(full and light),applyComplexData,setProtPoolSize,getECfromGEM,getECfromDatabase, save/load round-trip,fuzzyKcatMatching,writeDLKcatInput,mergeDLKcatAndFuzzyKcats,selectKcatValue,applyKcatConstraints,getKcatAcrossIsozymes,applyCustomKcats,findMetSmilesand the proteomics-integration chain.
Fixed
make_ec_modelsorts identifiers for full models, as MATLABmakeEcModeldoes (sortIdentifiers, line 203, full models only, before the protein pseudoreactions are appended). geckopy kept the input GEM's reaction order, so a full ecModel came out with the same reactions in a different order from MATLAB's — visible in the saved YAML and in every downstream table that followsec.rxnsorder.write_dlkcat_inputemits rows in reaction order, matching MATLAB's column-majorfind(clearedRedS < 0). numpy'swhereis row-major, so geckopy grouped the DLKcat input by substrate instead of by reaction.EcModel.copy()clones theecsubstructure.cobra.Model.copyrebuilds the network but carries every other attribute over by reference, somodel.copy().ecwas the sameEcDataobject asmodel.ec: writing a kcat, eccode, source, conc or coupling coefficient on the copy silently changed the model it was copied from. The copy'senzymesview was likewise still bound to the original model, so reads and writes throughmodel.enzymeswent to the wrong model.copy()now clonesecand rebindsenzymes, giving the value semantics MATLAB GECKO has throughout.adapterstays a shared reference (project configuration, not model state).copy.deepcopy(model)was already correct and is unchanged.- Reverse (
_REV) reactions keep their EC code, via a fix in raven-toolbox'sconvert_to_irreversible(it now copies annotations, subsystem and notes onto the reverse reaction, as MATLAB'sconvertToIrrevcopieseccodes/rxnMiriams/subSystems/rxnNotes). Without itfill_eccodes_from_gemreturned''for every_REVreaction, fuzzy BRENDA matching found no kcat, and reverse directions were left unconstrained. Requires raven-toolbox at or after that fix. copy.deepcopy(ec_model)(and of anycobra.Model) no longerRecursionErrors on Python 3.14. The cause was in cobra, not geckopy:Reaction.__copy__/__deepcopy__delegated tosuper()as a way to avoid infinitely recursing into themselves, but that trick relies oncopymemoizing an object before recursing into its state, and Python 3.14'scopymodule no longer does so for that code path. Every reaction holds its metabolites and every metabolite holds the reactions it participates in, so the resulting cycle exists in any real model, full ecModels included — deep-copying one recursed until the interpreter's recursion limit gave out. Fixed upstream in cobra 0.31.0 by deleting the overrides; requires cobra at or after 0.31.1.examples/yeast-GEM's adapter config used a rejected pydantic field.model_adapter.tomlsetuniprot.tax_id, butModelParameters's schema (additionalProperties=false) has no such field — it's calledid, and already defaults to the taxonomy id — soModelAdapter.from_folderraised a validation error on this folder unconditionally. A parametrized regression test now runs over everyexamples/subfolder so schema drift like this is caught for any future adapter config too. (#34)
Documentation
- Docstrings across geckopy's source and tests reviewed for clarity and accuracy:
MATLAB-COMPATcomparison paragraphs replaced with plain statements of current behavior, other historical/regression narration dropped, and several docstrings that no longer matched the code corrected. Comment/docstring-only; no functional changes. (#36) protein_pool.py's module docstring no longer claimsprot_pool_exchange's direction diverges from MATLAB pending a "future I/O layer". GECKO MATLAB'smakeEcModel.malready writes the same forward (lb=0,ub=1000) convention as geckopy; the reverse convention only applies to legacy pre-GECKO-4 files, whichload_ec_model.pyalready normalizes on load. (#38)mw.py's staleMATLAB-COMPATcomments removed now thatcalculate_mwmatches GECKO MATLAB's current water-mass constant (18.01528) and mean X-residue mass (118.885), closed upstream as GECKO#459. No behavioral change — the code already computed the now-matching values. (#39)
Internal
- Removed the dead
_run_preprocessstub fromtest_populate_ec: an empty helper (docstring and comments, no body) that was never called. The preprocessing stages it described are already exercised elsewhere. (#37)
Notes
merge_kcatsis n-ary and concatenates surviving rows list by list, so the equivalent of MATLAB'smergeDLKcatAndFuzzyKcats(dlkcat, fuzzy)— which always emits fuzzy rows first regardless of argument order — ismerge_kcats(fuzzy, dlkcat, ...). The deprecatedmerge_dlkcat_and_fuzzy_kcatsalias ismerge_kcats, so it follows the geckopy convention, not MATLAB's signature. Row order has no numerical effect:apply_kcat_listaggregates per reaction.
Full changelog: https://github.com/SysBioChalmers/geckopy/blob/main/CHANGELOG.md
Compare: v0.2.1...v0.3.0
v0.2.1
Bugfix release. make_ec_model no longer mutates the GEM it is given.
Fixed
make_ec_modelleaves the input GEM unchanged. Stages 1–5 (remove_pseudoreaction_gprs,invert_backwards_only_reactions,convert_to_irreversible,expand_model) ran in place on the caller's model, leaving it with_REV/_EXP_reaction splits,prot_pseudometabolites, and stripped pseudoreaction GPRs. The pipeline now works on an internalmodel.copy(), matching MATLAB GECKO'smakeEcModelvalue semantics. (#32)test_loads_sbml_gemon Windows: the test wrote a backslash path into the adapter TOML, which TOML reads as an escape sequence.
Documentation
- README: disambiguation note stating that this geckopy is a from-scratch port of the MATLAB GECKO Toolbox, unrelated to and sharing no code with the separate PyPI
geckopypackage described in Carrasco Muriel et al. (2023).
Internal
- CI: leaner test matrix — full Python range (3.11–3.13) on Linux plus a single Python (3.12) on macOS and Windows, instead of the full 3×3 OS × Python grid. Same OS coverage at roughly half the runner cost. (#31)
- Removed unused test imports flagged by ruff (F401).
Full changelog: https://github.com/SysBioChalmers/geckopy/blob/main/CHANGELOG.md
Compare: v0.2.0...v0.2.1
geckopy 0.2.0
Dependency rename + CI hardening. geckopy now targets raven-toolbox (the renamed raven-python) and runs its test matrix on every pull request.
Changed
- Depend on
raven-toolbox(renamed fromraven-python): all imports are nowraven_toolbox.*, and thepyproject.tomlgit-URL dependency and project URL point atSysBioChalmers/raven-toolbox. (#29) - Use the public
raven_toolbox.manipulation.expand.gpr_to_dnfinstead of the former private_gpr_to_dnf. (#26) - CI: run the test matrix on every pull request, not only PRs into
main/master. - CI: bump GitHub Actions to Node 24 runtimes —
checkout@v5,setup-python@v6,upload-artifact@v7,download-artifact@v8. (#27)
Documentation
- Rewrote
migrating_from_gecko_matlab.mdas a complete reference (#25); moved internal planning notes intodocs/internal/(#28).
Install (PyPI publishing is not yet enabled — see the README):
pip install "geckopy @ git+https://github.com/SysBioChalmers/geckopy.git@v0.2.0"
geckopy 0.1.0a3 (second alpha)
Second public alpha. Layering pass: the bits of geckopy that aren't GECKO-specific moved into raven-python, and gecko-light ecModels are now buildable end-to-end. Repo housekeeping for a discoverable first GitHub release.
(v0.1.0a2 was tagged earlier but its release.yml build failed — hatchling rejected the raven-python @ git+https://... direct reference. v0.1.0a3 carries the same content with the one-line [tool.hatch.metadata] allow-direct-references = true fix.)
Install
pip install \
git+https://github.com/SysBioChalmers/raven-python.git@develop \
git+https://github.com/SysBioChalmers/geckopy.git@v0.1.0a3raven-python is not yet on PyPI; geckopy's PyPI name is currently taken by another project. Both currently install from git.
Highlights
- gecko-light ecModel end-to-end (#20) —
make_ec_model(gecko_light=True)produces a working light ecModel; cobra reactions stay singular and per-isozyme coupling lives inec.rxnsas duplicate rows with a###_counter prefix.apply_kcat_constraintspicks the lowest-cost isozyme per cobra reaction. Newtutorials/light_ecModel/protocol.py+ opt-in Human-GEM smoke test (pytest -m smoke, ~2.5 min). Seedocs/gecko_light_status.md. - YAML I/O + typed
EcDatadelegated to raven-python (#19) —save_ec_model/load_ec_modelare now ~80-LOC wrappers aroundraven_python.io.read_yaml_model/write_yaml_model. SBML ecModel I/O removed (cobra.io.read_sbml_modelis still used for loading the conventional starting GEM).geckopy.EcDatare-exports raven'sEcData. Seedocs/raven_integration.md. ec_fseofre-aligned withraven_python.analysis.fseof(#21) — thin wrapper over raven's regression-based FSEOF; selection moves from MATLAB GECKO's strict monotonicity + top-25 %-by-slope to|correlation| ≥ thresholdwith pFBA per step. Result type is raven'sFSEOFResult; action labels areamplify/knockdown/knockout.get_conc_control_coeffssolver-state guard fix — gates both shadow-price and finite-difference helpers onsol.status == "optimal"; previously accepted infeasible-LP states where glpk returns a non-NaN objective from the binding-constraint rhs.
Removed (breaking from 0.1.0a1)
geckopy.io.sbml.{read,write}_sbml_ec_modeland thegeckopy.iopackage.geckopy.EcFseofResult(useraven_python.analysis.fseof.FSEOFResult).- Top-level
requirements.txt(apip freezesnapshot duplicatingpyproject.toml).
Repo housekeeping (PRs #22, #23, #24)
- MIT
LICENSEtext added at repo root (was only declared inpyproject.toml). - Internal planning docs moved from
docs/todocs/internal/so the user-facing tree only carries reference documentation. [tool.hatch.metadata] allow-direct-references = truesopython -m buildaccepts the raven-python git URL dependency.permissions: contents: writeon the release.yml build job sosoftprops/action-gh-releasecan attach assets without HTTP 403.
Full notes: CHANGELOG.md § 0.1.0a3 + § 0.1.0a2.
geckopy v0.1.0a1 — first public alpha
First public alpha. Every MATLAB GECKO 3.2.5 function used in the standard ecModel build is ported; the yeast-GEM tutorial runs end-to-end. See CHANGELOG.md for the full PR-grouped list of changes.
Install
pip install \
git+https://github.com/SysBioChalmers/raven-python.git@main \
git+https://github.com/SysBioChalmers/geckopy.git@v0.1.0a1geckopy depends on raven-python for shared model-manipulation primitives (expand_model, convert_to_irreversible). Neither is on PyPI yet — both install from GitHub.
Requires Python 3.11 or newer.
What's in this release
- Build an enzyme-constrained model from a conventional GEM + adapter
- Source kcats from BRENDA (fuzzy matching), DLKcat, OpenKineticsPredictor, or manual lists; merge across sources
- Integrate proteomics, fit
sigma, flexibilise enzyme concentrations - Analyse with parallel ecFVA, ecFSEOF, enzyme bottlenecks, control coefficients (shadow-price), pFBA on enzyme usage
- Persist via YAML or SBML round-trip with
ec_*metadata - Reproducible BRENDA snapshot refresh via
geckopy brenda-refreshCLI - Full
full_ecModeltutorial walking through yeast-GEM end-to-end
The build artefacts (sdist + wheel) will be attached by the release workflow shortly.