Skip to content

v3 codebase review: registry, gapfilling, HPA parsers, editMiriam, getExchangeRxns, getGeneData#650

Open
edkerk wants to merge 6 commits into
develop3from
docs/v3-review
Open

v3 codebase review: registry, gapfilling, HPA parsers, editMiriam, getExchangeRxns, getGeneData#650
edkerk wants to merge 6 commits into
develop3from
docs/v3-review

Conversation

@edkerk

@edkerk edkerk commented Jun 17, 2026

Copy link
Copy Markdown
Member

Summary

Implements and documents a series of improvements identified during a subsystem-by-subsystem audit of the RAVEN v3 codebase (docs/v3_review.md).

  • Central model-field registry (core/modelFields.m) — single source of truth for all optional model fields; wired into permuteModel and removeReactions
  • Remove dead I/O helpersexportModelToSIF, getMetsInComp, and other functions that have better alternatives or are unused
  • §4.3 helpers / §5.5 consolidationsgetModelField, hasField, requireField; permuteModel/removeReactions rewritten using the registry
  • §5.2 gapfilling — merge makeSomething/consumeSomething into findLeakMetabolite(model, direction, ...); old functions retained as thin wrappers for backward compatibility
  • §6.2 HPA parsersparseHPA and parseHPArna rewritten to be header-driven (auto-detect column positions instead of version-number-guessing)
  • §6.3 minor additionseditMiriam gains a 'remove' mode; getExchangeRxns gains a 3rd output (exchanged metabolite index per exchange reaction); getGeneData adds a UniProt column

Test plan

  • tGapfilling: findLeakMetaboliteProduceReturnsSolution, findLeakMetaboliteConsumeReturnsSolution, findLeakMetaboliteInvalidDirectionErrors
  • tAnnotation: editMiriamRemovesAnnotation
  • tQueries: getExchangeRxnsThirdOutputIsMetIndex
  • CI passes on develop3 base

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

Function test results

207 tests   184 ✅  35s ⏱️
 22 suites   21 💤
  1 files      2 ❌

For more details on these failures, see this check.

Results for commit 4f2a020.

♻️ This comment has been updated with latest results.

edkerk added 6 commits June 18, 2026 11:25
Delete exportModelToSIF (Cytoscape SIF, niche legacy format), getFullPath
(345-line third-party Windows path canonicalizer), and getMD5Hash (per-OS
shell-out with a certutil bug). Replace the eight getMD5Hash call sites in
getBlast with a toolbox-free local filemd5 using Java MessageDigest. Drop
the three corresponding unit tests.

Update docs/v3_review.md: expand the "already done" section to include all
completed backports and the dispEM removal; remove the resolved §2 FSEOF
redesign and §7 bug-fix entries; renumber the roadmap items accordingly.
…actions

ravenModelFields() returns a struct array declaring every 1-D RAVEN model
field with its entity type ('rxn','met','gene','comp') and default value.
Fields requiring 2-D indexing (S, rxnGeneMat, b) or value-remapping
(metComps/rxnComps/geneComps when permuting comps) are excluded and handled
explicitly by callers.

permuteModel: replaced individual isfield/permute blocks with a
    registry-driven loop plus four small switch cases for 2-D fields.
    Fixes silent drift for pwys, spontaneous, metNotes, and geneFrom.

removeReactions: replaced individual isfield blocks with registry-driven
    loops. rxnGeneMat and S are still handled explicitly.

addExchangeRxns, addTransport: add pwys and spontaneous handlers.
    addTransport: fix rxnConfidenceScores default (1 to NaN) and rxnDeltaG
    default (0 to NaN).
§4.3 redundant helpers:
- findDuplicateRxns: rewritten with unique(S','rows') for O(n log n) vs O(n^2)
- getMetsInComp: removed (callers can write model.metComps==J inline;
  only caller was the test suite)
- parseRxnEqu: kept (two callers: constructS and prepINITModel)
- deleteUnusedGenes: refactored to thin wrapper over removeReactions;
  verbose output retained

§5.5 small consolidations:
- loadDeltaGfromCSV + saveDeltaGtoCSV collapsed into deltaGCSV(model,direction,...)
  with shared loadField/saveField local functions; old files removed
- getWoLFScores already delegates to parseScores -- no change needed

§4.1: functions kept for teaching; doc updated to reflect decision
§5.1: registry already done; doc updated
§5.4 (KEGG cache plumbing): no longer relevant after K15 refactor; removed
v3_review.md updated throughout to reflect all completed and deferred items
§5.2 — Gapfilling: merge makeSomething/consumeSomething into
findLeakMetabolite(model, direction, ...); originals kept as wrappers.

§6.2 — HPA parsers: rewrite parseHPA and parseHPArna to be fully
header-driven (column positions inferred from the file header row);
auto-detect delimiter; version parameter retained but ignored.

§6.3 — Small expansions:
  - editMiriam: add 'remove' mode to clear a named namespace
  - getExchangeRxns: add optional third output (metabolite index per
    exchange reaction)
  - getGeneData: add UniProt column extracted from GFF Dbxref
@edkerk edkerk changed the title Add v3 development review and roadmap v3 codebase review: registry, gapfilling, HPA parsers, editMiriam, getExchangeRxns, getGeneData Jun 18, 2026
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