Skip to content

Add user guide page 17: comparing models - #38

Merged
edkerk merged 1 commit into
mainfrom
guide/comparing
Aug 27, 2026
Merged

Add user guide page 17: comparing models#38
edkerk merged 1 commit into
mainfrom
guide/comparing

Conversation

@edkerk

@edkerk edkerk commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Adds user guide page 17, Comparing models — the exact diff and the
set-overlap overview, run on smallYeast against smallYeastBad (the same
model with deliberate errors). MATLAB and Python side by side, every example
executed.

The pairing makes the point by itself

reaction-set similarity 0.945
differences found by the diff 11
growth, good model 0.1222
growth, broken model 0.0000

The eleven differences include a doubled stoichiometric coefficient and a
reaction turned irreversible — changes that barely move a set-overlap score and
stop the model growing entirely. A similarity score is for grouping models, not
for validating one, and the page says so where a reader will meet the number.

Both toolboxes independently report the same 11 differences and the same
52-of-55 shared reactions.

Also documented

  • diff_models returns a falsy report when models differ, so
    assert diff_models(before, after) is a working regression test for a curation
    script; report.equal does the same in MATLAB.
  • The two overlap functions are indexed in opposite directions: RAVEN's
    matrix has one row per combination of models with nElements counting each,
    raven-toolbox's has one row per identifier with a column per model.
  • compareRxnsGenesMetsComps prints a full breakdown unless given
    'printResults', false.
  • MATLAB reports the zero objective as -0.0000; noted so it does not read as a
    negative growth rate.

Checks

  • 8 examples, both languages, all passing
  • check_names.py clean (nElements, smallYeastBad added to the allowlist)
  • site builds

The guide is now 17 pages, 175 examples, no skips.

Two questions, two tools: diffModels/diff_models for an exact,
entry-by-entry answer to "did anything change", and
compareRxnsGenesMetsComps/compare_models for "how alike are these" across
whole sets. Both run on smallYeast against smallYeastBad, the same model
with deliberate errors.

The pairing makes the page's point on its own. The two models score
0.945 on reaction-set similarity, and the eleven differences the diff
lists include a doubled stoichiometric coefficient and a reaction turned
irreversible -- so on the same medium with the same objective, the good
model grows at 0.1222 and the broken one does not grow at all. A
similarity score is for grouping models, not for validating one.

Also documents that the two overlap functions are indexed in opposite
directions: RAVEN's matrix has a row per combination of models with
nElements counting each, raven-toolbox's a row per identifier with a
column per model.
@edkerk
edkerk merged commit d8e64b5 into main Aug 27, 2026
2 checks passed
@edkerk
edkerk deleted the guide/comparing branch August 27, 2026 09:47
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