Skip to content

feat: migrate BRENDA data from max_*.txt to kcat/mw/sa.tsv - #455

Merged
edkerk merged 1 commit into
develop4from
feat/brenda-tsv-format
Aug 28, 2026
Merged

feat: migrate BRENDA data from max_*.txt to kcat/mw/sa.tsv#455
edkerk merged 1 commit into
develop4from
feat/brenda-tsv-format

Conversation

@edkerk

@edkerk edkerk commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

Replaces the 2018-vintage max_KCAT.txt/max_MW.txt/max_SA.txt (EC-prefixed, //-suffixed organism, no header) with kcat.tsv/mw.tsv/sa.tsv: BRENDA 2026.1 snapshots produced by the geckopy brenda-refresh CLI and already shipped in geckopy's own src/geckopy/data/brenda/. This adopts the exact filenames and format geckopy already uses (rather than inventing a separate max_*.tsv convention, as an earlier, abandoned attempt at this migration did) — pointing both toolboxes' BRENDA folder at the same directory now just works, with no renaming.

loadBRENDAdata.m updated to match:

  • skip the #-prefixed release-version line and the column-header line (both new)
  • read bare EC codes and plain organism strings (both no longer need the old extractAfter/regexprep stripping)
  • read the max column of kcat.tsv/sa.tsv's two aggregates (max, median) — unchanged single-aggregate behaviour, just fed from wider files

Not ported: the opt-in median aggregation geckopy's load_brenda_data exposes via adapter.params.kcat_aggregate_brenda — a separate, smaller feature not part of what this migration covers.

Test plan

  • Test fixtures affected: the ecTestGEM small BRENDA files, and two existing fuzzyKcatMatching tests (tc0021, tc0022) that build their own scratch BRENDA fixtures inline — all reformatted to the new shape with identical values, so no test assertions changed.
  • Added testLoadBRENDAdataParsesNewTsvFormat_tc0041 covering the new format's own distinguishing features (header/comment skip, bare EC codes, max-not-median column selection) directly.
  • Full local suite: 41/41 passed.
  • Verified against the real production files (84,904 rows total): parses cleanly in well under a second, no malformed rows, no NaNs.

Replaces the 2018-vintage max_KCAT.txt/max_MW.txt/max_SA.txt (EC-prefixed,
//-suffixed organism, no header) with kcat.tsv/mw.tsv/sa.tsv: BRENDA 2026.1
snapshots produced by the geckopy brenda-refresh CLI and already shipped
in geckopy's own src/geckopy/data/brenda/. Adopting the exact filenames
and format geckopy already uses (rather than inventing a separate
max_*.tsv convention) means a user can point both toolboxes' BRENDA
folder at the same directory without renaming anything.

loadBRENDAdata.m updated to match: skip the `#`-prefixed release-version
line and the column-header line (both new), read bare EC codes and plain
organism strings (both no longer need stripping), and read the max
column of kcat.tsv/sa.tsv's two aggregates (max, median) -- unchanged
single-aggregate behaviour, just fed from wider files. Not ported: the
opt-in median aggregation geckopy's load_brenda_data exposes via
adapter.params.kcat_aggregate_brenda -- a separate, smaller feature that
wasn't part of what this migration was asked to cover.

Test fixtures affected: the ecTestGEM small BRENDA files, and two
existing fuzzyKcatMatching tests (tc0021, tc0022) that build their own
scratch BRENDA fixtures inline -- all reformatted to the new shape with
identical values, so no test assertions changed. Added
testLoadBRENDAdataParsesNewTsvFormat_tc0041 to cover the new format's
own distinguishing features (header/comment skip, bare EC codes,
max-not-median column selection) directly.

Verified against the real production files (84,904 rows total): parses
cleanly in well under a second, no malformed rows, no NaNs.
@github-actions

Copy link
Copy Markdown

Unit test results

41 tests   41 ✅  10s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit d3bf92b.

@edkerk
edkerk merged commit bc19542 into develop4 Aug 28, 2026
2 checks passed
@edkerk
edkerk deleted the feat/brenda-tsv-format branch August 28, 2026 19:26
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