Skip to content

fix: reportEnzymeUsage skips only fully-inactive enzymes in topAbsUsage - #460

Merged
edkerk merged 2 commits into
develop4from
feat/reconcile-report-enzyme-usage
Aug 29, 2026
Merged

fix: reportEnzymeUsage skips only fully-inactive enzymes in topAbsUsage#460
edkerk merged 2 commits into
develop4from
feat/reconcile-report-enzyme-usage

Conversation

@edkerk

@edkerk edkerk commented Aug 28, 2026

Copy link
Copy Markdown
Member

reportEnzymeUsage's topAbsUsage table used to pad in a placeholder row for an enzyme with no flux-carrying reaction at all: isscalar(find(carriedFlux)) is false both for zero matches and for multiple matches, so a fully-inactive enzyme took the same "combined usage" branch as a genuinely multi-reaction one.

Reconciled with geckopy's report_enzyme_usage: an enzyme is skipped only when every one of its reactions carries no flux. An enzyme with a mix of flux- and non-flux-carrying reactions is still reported, attributed to the flux-carrying subset — this part was already correct before this change; the new test covers it too, alongside the fix, so it can't silently regress.

New test testReportEnzymeUsageSkipsOnlyFullyInactiveEnzymes_tc0045 builds a minimal ecModel-like fixture exercising all three cases directly (fully-inactive → skipped; one active reaction out of several → single-branch; two active out of three → combined-branch, split only across the active ones). Confirmed it (and the updated tc0019) fail against the pre-fix code before restoring the fix.

testReportEnzymeUsageTopAbsUsageOutOfBounds_tc0019's all-zero-flux fixture now correctly returns zero rows instead of a padded count on every call; updated its assertions and comment to match — its actual purpose (no crash on an out-of-range topAbsUsage) is unaffected.

Addresses SysBioChalmers/raven-gecko-parity#18.

isscalar(find(carriedFlux)) was false both for zero flux-carrying
reactions and for multiple ones, so an enzyme with no flux-carrying
reaction at all took the same "combined usage" branch as a genuinely
multi-reaction enzyme, padding in a placeholder row instead of being
left out.

Reconciled with geckopy's report_enzyme_usage: an enzyme is skipped
only when every one of its reactions carries no flux. An enzyme with
a mix of flux- and non-flux-carrying reactions is still reported,
attributed to the flux-carrying subset -- already correct before this
change, now covered by a regression test alongside the fix.

testReportEnzymeUsageTopAbsUsageOutOfBounds_tc0019's all-zero-flux
fixture now correctly returns zero rows instead of a padded count;
updated its assertions and comment to match.

Closes SysBioChalmers/raven-gecko-parity#18.
@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Unit test results

46 tests   46 ✅  7s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit 2cecdea.

♻️ This comment has been updated with latest results.

…port-enzyme-usage

# Conflicts:
#	test/unit_tests/geckoCoreFunctionTests.m
@edkerk
edkerk merged commit 5193772 into develop4 Aug 29, 2026
2 checks passed
@edkerk
edkerk deleted the feat/reconcile-report-enzyme-usage branch August 29, 2026 20:13
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