feat: add human_gem Python package with load_model()#1069
Conversation
First step towards a pip-installable Python interface to Human-GEM, on
raven-toolbox + cobrapy. human_gem.load_model() loads Human-GEM as a fully
annotated cobra model - reading the YAML via raven-toolbox and merging the
cross-references and SBO terms from the annotation tables, which a bare
cobra.io.load_yaml_model does not do:
import human_gem
model = human_gem.load_model() # 12877 rxns, 8460 mets, cross-refs attached
- pyproject.toml (deps: cobra, pandas, raven-toolbox)
- human_gem/io.py load_model(model_dir=None, annotate=True)
- human_gem/annotation.py TSV -> MIRIAM/SBO merge (packaged home of the logic
currently duplicated in code/annotateGEM.py)
Verified locally: load_model() attaches cross-references to 12698/12877
reactions and 8449/8460 metabolites; annotate=False returns the bare model.
Next increments: reduce code/annotateGEM.py to a shim importing from human_gem
(single source of truth) + install the package in CI; then promote the ftINIT
essentiality and task helpers into the package.
Model quality report
Each check name links to its explanation in the testResults README. Model checksDuplicate keys (model unloadable) and no growth block the merge; every other row is a non-blocking report.
MACAW and mass/charge balance
Model file and metabolic tasks
MEMOTETotal score: 63.2% (core subset) 0
Per-test scores
Full suite: 64.2% 0 · from the last The score above is the fast core subset. Comment Gene essentiality (Hart 2015)Not run automatically (it takes hours). Comment ❌ = a count rose vs the target branch (regression) · Full workflow run · this comment is edited as results come in |
Main improvements in this PR:
First increment towards a pip-installable Python interface to Human-GEM (dual-language support).
human_gem.load_model()loads Human-GEM as a fully annotated cobra model — reading the YAML via raven-toolbox and merging the cross-references + SBO terms from the annotation tables, which a barecobra.io.load_yaml_modeldoes not do:pyproject.toml— packagehuman-gem(deps:cobra,pandas,raven-toolbox)human_gem/io.py—load_model(model_dir=None, annotate=True)human_gem/annotation.py— the TSV → MIRIAM/SBO merge (packaged home of the logic currently incode/annotateGEM.py)Verified locally (raven-toolbox 0.3.0):
load_model()attaches cross-references to 12698/12877 reactions, 8449/8460 metabolites and all 2848 genes;annotate=Falsereturns the bare model.This increment is deliberately small and non-disruptive — it adds new files and imports nothing existing, so it does not touch the current MATLAB or Python CI. Planned next increments:
code/annotateGEM.pyto a thin shim importing fromhuman_gem.annotation(single source of truth) + install the package in the Python CI;pip installdistribution.No model changes.
I hereby confirm that I have:
data/deprecatedIdentifiers/.developas target branch, and will be resolved with a squash-merge.mainas target branch, and will be resolved with a merge commit.