feat: migrate BRENDA data from max_*.txt to kcat/mw/sa.tsv - #455
Merged
Conversation
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.
Unit test results41 tests 41 ✅ 10s ⏱️ Results for commit d3bf92b. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the 2018-vintage
max_KCAT.txt/max_MW.txt/max_SA.txt(EC-prefixed,//-suffixed organism, no header) withkcat.tsv/mw.tsv/sa.tsv: BRENDA 2026.1 snapshots produced by thegeckopy brenda-refreshCLI and already shipped in geckopy's ownsrc/geckopy/data/brenda/. This adopts the exact filenames and format geckopy already uses (rather than inventing a separatemax_*.tsvconvention, 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.mupdated to match:#-prefixed release-version line and the column-header line (both new)extractAfter/regexprepstripping)Not ported: the opt-in median aggregation geckopy's
load_brenda_dataexposes viaadapter.params.kcat_aggregate_brenda— a separate, smaller feature not part of what this migration covers.Test plan
fuzzyKcatMatchingtests (tc0021,tc0022) that build their own scratch BRENDA fixtures inline — all reformatted to the new shape with identical values, so no test assertions changed.testLoadBRENDAdataParsesNewTsvFormat_tc0041covering the new format's own distinguishing features (header/comment skip, bare EC codes, max-not-median column selection) directly.