Skip to content

Feat: add model quality-control checks workflow#1046

Merged
edkerk merged 8 commits into
developfrom
feat/model-qc-checks
Jul 11, 2026
Merged

Feat: add model quality-control checks workflow#1046
edkerk merged 8 commits into
developfrom
feat/model-qc-checks

Conversation

@edkerk

@edkerk edkerk commented Jul 11, 2026

Copy link
Copy Markdown
Member

Main improvements in this PR:

Addresses #732 (more diverse workflows around simulation and functional behaviour, beyond the existing structure/format checks).

Adds a Model QC checks workflow with lightweight, diff-friendly checks that complement the existing MACAW, mass/charge balance and gene-essentiality tests:

  • Growth sanity — fails the build if the model cannot produce biomass.
  • Metabolite formula/charge completeness (qc_metabolite_completeness.csv).
  • Reaction GPR / bounds sanity (qc_reaction_sanity.csv).
  • Annotation / cross-reference validation across namespaces (qc_annotation_issues.csv).
  • MEMOTE snapshot with score tracking (memote_score.md) — a fast core subset on every PR, the full suite on PRs to main.

The fast checks and MEMOTE run as separate jobs, so quick feedback is not blocked by the slow MEMOTE run. Per-finding detail is committed as CSVs under data/testResults/. The MACAW/balance, gene-essentiality and QC results are combined into a single pull-request comment: a compact status table with each check's value, its change versus the target branch, and an icon for a quick visual check.

I hereby confirm that I have:

  • Any removed reactions and metabolites have been moved to the corresponding deprecated identifier lists in data/deprecatedIdentifiers/. (No reactions or metabolites are removed in this PR.)
  • This PR has develop as target branch, and will be resolved with a squash-merge.
  • This PR has main as target branch, and will be resolved with a merge commit.

@edkerk edkerk added this to the 2.0.1 milestone Jul 11, 2026
@edkerk
edkerk force-pushed the feat/model-qc-checks branch from 2732c62 to 83473a8 Compare July 11, 2026 19:21
@edkerk
edkerk changed the base branch from main to develop July 11, 2026 19:21
…ounds, MEMOTE)

Adds a "Model QC checks" GitHub Actions workflow with two jobs:

- checks (every PR, fast): metabolite formula/charge completeness, reaction
  bound and GPR sanity, a growth sanity gate, and annotation cross-reference
  validation across namespaces. Posts a compact status table as a PR comment
  with the change versus the target branch and an icon per check.
- memote (separate job): runs MEMOTE in-process and builds the snapshot report
  to obtain the total score (memote run alone does not compute one). A fast core
  subset (skipping the three FVA/loopless tests) runs on every PR; the full suite
  runs only on PRs to main. It updates the same PR comment when it finishes.

Detailed per-finding output is written to diff-friendly CSVs in data/testResults;
the compact comment is for a quick visual check.
@edkerk
edkerk force-pushed the feat/model-qc-checks branch from 83473a8 to d95c81d Compare July 11, 2026 19:25
@edkerk edkerk changed the title Add model QC checks: metabolite completeness, annotation, growth, GPR/bounds, MEMOTE Feat: add model quality-control checks workflow Jul 11, 2026
edkerk and others added 4 commits July 11, 2026 20:08
Adds buildReport.py, which builds one consolidated model-quality comment from
the committed result files: a compact Model QC status table, the MACAW and
mass/charge balance summary, and the Hart 2015 gene-essentiality metrics. Any
result set not yet committed for the pull request shows as pending.

The Model QC and QC-tests workflows both build and post this comment to a single
shared identifier (GITHUB_COMMENT_QC), each rebuilding it from the committed
files so the last to finish shows the complete picture. Replaces the separate
buildQcComment.py / commentModelQC.md / commentQC.md.
The core subset still ran the stoichiometric-consistency / energy-cycle MILPs and
the per-metabolite open-bound checks (~32 min) and the O(n^3) matrix rank / null-
space tests, so it exceeded the per-PR budget. Skip those twelve tests in the
subset; the full suite (PRs to main) still runs them.
@edkerk
edkerk force-pushed the feat/model-qc-checks branch from bcafe2d to d12a7cc Compare July 11, 2026 20:17
@edkerk edkerk closed this Jul 11, 2026
@edkerk edkerk reopened this Jul 11, 2026
checkout v4->v7, setup-python v5->v6, upload-artifact v4->v7,
git-auto-commit-action v5->v7.
@SysBioChalmers SysBioChalmers deleted a comment from github-actions Bot Jul 11, 2026
@SysBioChalmers SysBioChalmers deleted a comment from github-actions Bot Jul 11, 2026
@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown

Model quality report

Model QC checks fine, no changes compared to develop.

Model QC checks

Check Result Δ vs develop
Growth (biomass producible) 125 new
Metabolites missing formula 7 new 🆕
Metabolites missing charge 0 new 🆕
Reaction bound / GPR issues 0 new 🆕
Malformed cross-references 59 new 🆕
Cross-refs inconsistent across compartments 59 new 🆕
MEMOTE score (%) pending

MACAW and mass/charge balance

MACAW: dead-end and duplicate tests

Mass and charge balance

(balance report unavailable)

Gene essentiality (Hart 2015)

cellLine TP TN FP FN accuracy sensitivity specificity F1 MCC
DLD1 38 2158 60 280 0.8659 0.1195 0.9729 0.1827 0.1588
GBM 34 2137 64 300 0.8564 0.1018 0.9709 0.1574 0.1276
HCT116 47 2181 55 308 0.8599 0.1324 0.9754 0.2057 0.1906
HELA 32 2241 70 250 0.8766 0.1135 0.9697 0.1667 0.1332
RPE1 15 2179 83 258 0.8655 0.05495 0.9633 0.08086 0.02935
all 7 2379 95 112 0.9202 0.05882 0.9616 0.06335 0.02199

Per-finding detail is committed to data/testResults/ (qc_metabolite_completeness.csv, qc_reaction_sanity.csv, qc_annotation_issues.csv, macaw_results.csv, balance_results.csv, gene-essential.csv); the full MEMOTE result is uploaded as a build artifact.

Results for commit 4ca5e17.

Full workflow run · this comment is edited on subsequent runs

@SysBioChalmers SysBioChalmers deleted a comment from github-actions Bot Jul 11, 2026
@edkerk

edkerk commented Jul 11, 2026

Copy link
Copy Markdown
Member Author

Merge to develop for now, further troubleshooting once combined with #1027

@edkerk
edkerk merged commit 2e5e5a6 into develop Jul 11, 2026
2 of 8 checks passed
@edkerk
edkerk deleted the feat/model-qc-checks branch July 11, 2026 22:20
@edkerk edkerk mentioned this pull request Jul 15, 2026
3 tasks
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