Skip to content

feat: generalize kcat merging to N sources via mergeKcats - #457

Merged
edkerk merged 2 commits into
develop4from
feat/generalize-merge-kcats
Aug 28, 2026
Merged

feat: generalize kcat merging to N sources via mergeKcats#457
edkerk merged 2 commits into
develop4from
feat/generalize-merge-kcats

Conversation

@edkerk

@edkerk edkerk commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

Adds mergeKcats: merges any number of kcatLists (each of which may mix several sources itself, e.g. an OpenKineticsPredictor result carrying BRENDA/Sabio-RK/CataPro rows in its own per-row kcatSource field) and resolves them per reaction by a caller-supplied sourcePriority. Three reserved tier tokens select from a database-sourced row's own quality:

  • database_exact — an exact experimental-DB hit (no wildcard/origin metadata at all — i.e. a direct OKP value, not a fuzzy match).
  • database_top — a fuzzy BRENDA match, wildcardLvl==0 & origin<=top.
  • database_bottom — weaker fuzzy matches within the wildcard/origin gate.

Any other sourcePriority token is matched against a row's own source label (folded to lowercase snake_case, e.g. 'dlkcat'); sources not listed in sourcePriority are dropped, with a warning naming them.

mergeDLKcatAndFuzzyKcats becomes a deprecated, warning-emitting thin wrapper delegating to mergeKcats with the legacy three-tier order ('database_top', 'dlkcat', 'database_bottom') and its own established parseGECKOargs-style optional arguments unchanged.

Test plan

  • Verified against the existing testKcats_tc0011 fixture (unmodified): identical merged output to the pre-rewrite algorithm, confirming the tier-based reimplementation preserves the legacy function's exact row selection.
  • Added testMergeKcatsGeneralizesToNSourcesWithExactTier_tc0041 (the new database_exact tier and the dropped-source warning, using a fetchOpenKineticsPredictor-shaped fixture).
  • Added testMergeDLKcatAndFuzzyKcatsDelegatesToMergeKcats_tc0042 (the wrapper's own three-tier order, independent of testKcats_tc0011's larger end-to-end fixture).
  • Full local suite: 42/42 passed.

Add mergeKcats: merges any number of kcatLists (each of which may mix
several sources itself, e.g. an OpenKineticsPredictor result carrying
BRENDA/Sabio-RK/CataPro rows in its own per-row kcatSource field) and
resolves them per reaction by a caller-supplied sourcePriority. Three
reserved tier tokens select from a database-sourced row's own quality:

- database_exact:  an exact experimental-DB hit (no wildcard/origin
  metadata at all -- i.e. a direct OKP value, not a fuzzy match).
- database_top:    a fuzzy BRENDA match, wildcardLvl==0 & origin<=top.
- database_bottom: weaker fuzzy matches within the wildcard/origin gate.

Any other sourcePriority token is matched against a row's own source
label (folded to lowercase snake_case, e.g. 'dlkcat'); sources not
listed in sourcePriority are dropped, with a warning naming them.

mergeDLKcatAndFuzzyKcats becomes a deprecated, warning-emitting thin
wrapper delegating to mergeKcats with the legacy three-tier order
('database_top', 'dlkcat', 'database_bottom') and its own established
parseGECKOargs-style optional arguments unchanged. Verified against
the existing testKcats_tc0011 fixture (unmodified): identical merged
output to the pre-rewrite algorithm, confirming the tier-based
reimplementation preserves the legacy function's exact row selection.

Adds testMergeKcatsGeneralizesToNSourcesWithExactTier_tc0041 (the new
database_exact tier and the dropped-source warning, using a
fetchOpenKineticsPredictor-shaped fixture) and
testMergeDLKcatAndFuzzyKcatsDelegatesToMergeKcats_tc0042 (the wrapper's
own three-tier order, independent of testKcats_tc0011's larger
end-to-end fixture).

Full local suite: 42/42 passed.
@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Unit test results

43 tests   43 ✅  11s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit 07d32fa.

♻️ This comment has been updated with latest results.

…erge-kcats

# Conflicts:
#	test/unit_tests/geckoCoreFunctionTests.m
@edkerk
edkerk merged commit 6ac195a into develop4 Aug 28, 2026
2 checks passed
@edkerk
edkerk deleted the feat/generalize-merge-kcats branch August 28, 2026 20:08
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