Effort: thorough
Build a metabolic-pathway flux pipeline using cobrapy that takes
a gene knock-out (or knock-down expression change), simulates the
resulting metabolic flux in a context-specific genome-scale model
(Recon3D for human or species-appropriate alternative), runs FBA
(Flux Balance Analysis) and FVA (Flux Variability Analysis), and
persists the per-reaction flux shift as an interpretable artifact.
Used by metabolic-vertical debates ("does GLP-1R agonism shift hepatic
gluconeogenesis fluxes?") to provide quantitative answers, not just
literature claims.
The metabolic vertical needs more than DEG analysis to be credible —
fluxes through the metabolic network are what physiologically matter,
and constraint-based modeling is the only tractable way to estimate
them at scale. cobrapy is bundled but no pipeline composes it. With
this pipeline, a metabolic Theorist can argue from simulated fluxes,
the Skeptic can rerun with alternative constraints, and the resulting
artifact is reproducible.
scidex/forge/pathway_flux.py (≤700 LoC):load_model(name='Recon3D') — caches Recon3D SBML andcobra.Model; supports iJO1366 (E. coli) andiCHOv1 (CHO) as alternatives.apply_knockout(model, gene_symbol) — translates gene toapply_expression(model, gene_to_fold_change) — bulk-appliesrun_fba(model) — solves; returns objective value + fluxes.run_fva(model, fraction_of_optimum=0.95) — solves FVA;compare(baseline, perturbed) — computes per-reactionpipeline(gene_or_expression, model='Recon3D') — composesdata/scidex-artifacts/flux/<run_id>/ with the SBMLflux_run(run_id PRIMARY KEY, model_name,tools.py registers pathway_flux_pipeline(...) with@log_tool_call. TOOL_NAME_MAPPING entry added.
/artifacts/<id> renders the Escher map (existing imageq-vert-vertical-personas-pack) receives a flux_block whenpython -m scidex.forge.pathway_flux --gene G6PDhttp://bigg.ucsd.edu/static/models/Recon3D.xml)data/cobra/Recon3D.xml.
escher Python lib if installable,q-tool-singlecell-trajectory-cobrapy skill.q-vert-vertical-personas-pack — metabolic-expert persona consumesStarted: Confirmed task is not stale — no prior commits touch pathway_flux.py.
Read cobrapy SKILL.md (vendor/kdense-skills) for API patterns. Verified
cobrapy is NOT installed in current Python environment (read-only filesystem
blocks pip --user). forge-* conda envs present but no cobrapy in scope.
Implemented:
scidex/forge/pathway_flux.py (549 lines) — full pipeline per spec:load_model (Recon3D/iJO1366/iCHOv1, BiGG-cached), apply_knockoutcobra.manipulation.knock_out_model_genes on a model copy),apply_expression (E-Flux log1p scaling), run_fba, run_fva,compare + compare_with_subsystems (subsystem resolution from model),_render_escher_map (escher lib or no-op), _build_flux_json,pipeline (full end-to-end with artifact bundle). CLI entry pointpython -m scidex.forge.pathway_flux --gene G6PD.
migrations/100_add_flux_run_table.py — flux_run table (all spec columns,scidex.core.database.get_db(); migration_historyscidex/forge/tools.py — added TOOL_NAME_MAPPING entry, definedpathway_flux_pipeline() with @log_tool_call decorator, addedNot yet completed (blocked):
--gene G6PD) — cobrapy not installable in sandboxpython3 -m py_compile passes).
/artifacts/<id> Escher rendering — needs escher library + cobrapyflux_block injection — requiresq-vert-vertical-personas-pack work (separate task scope).Committed: 47028afee to branch
orchestra/task/7b6e6850-metabolic-pathway-flux-pipeline-gene-ko; pushed
to origin. Rebased cleanly on latest origin/main (no conflicts).
Evidence: git log --oneline origin/main shows no prior pathway_flux
commits; git diff origin/main..HEAD --stat confirms 3 new files (644 lines)
added by this task. Cobrapy not in scope but code follows SKILL.md API.
Commit: 47028afee — [Forge] Metabolic pathway flux pipeline —
cobrapy FBA/FVA + flux-shift artifact