Skip to content

Fixes from the RAVEN 3 Guide review - #7

Merged
edkerk merged 14 commits into
developfrom
fix/guide-review
Oct 17, 2026
Merged

edkerk merged 14 commits into
developfrom
fix/guide-review

Conversation

@edkerk

@edkerk edkerk commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes found while reviewing the RAVEN 3 Guide.

Gap filling

  • gapFillMILP only adds reactions from the universal model, choosing the fewest that reach the growth floor. Draft reactions keep their bounds, forced fluxes included; a reaction in the wrong direction is left for curation. Outputs are now [addedRxns, newModel, exitFlag]; reversedRxns and weights are removed.
  • gapReport raises RAVEN:infeasibleModel when the model is infeasible under its own bounds, or with its boundary closed, naming the reactions with a forced flux and asking to set ATP maintenance to zero first.

Solvers

  • optimizeProb solves MILPs with the bundled GLPK, with a RAVEN:glpkMILP warning that recommends Gurobi.
  • sampleChebyshevCenter passes a sparse constraint matrix.

Analysis and curation

  • curateModelFromTables reads columns by header and writes every given field to existing entities.
  • reporterMetabolites uses the population standard deviation in the closed-form background correction, which assumes genes drawn with replacement; scores now match raven-toolbox.
  • haveFlux returns all-blocked when no reaction survives simplification; its help states how a dead end with a forced flux is treated.
  • scaleBiomassFraction refuses a balance that would make the balancing component negative.
  • getIndexes raises a clear error for an ambiguous name[comp].
  • getKEGGModelForOrganism creates rxnNotes when the reference model has none.

I/O

  • readYAMLmodel reads folded scalars whose continuation line starts with a dash (the KEGG 118 model now reads).

Help text

  • Corrected help for six functions and a typo in a curateModelFromTables warning.

edkerk added 14 commits October 17, 2026 08:40
The closed-form background correction assumes genes drawn with
replacement from the scored-gene pool, which needs the population
standard deviation. Scores now match raven-toolbox. The help states that
results are sorted by Z-score and that P-values are one-sided.
Gurobi rejects a dense model.A, so randomSampling with method 'chrr'
failed whenever Gurobi was the RAVEN solver.
…ification

When every reaction is a dead end, simplifyModel removes them all and the
LP has an empty constraint matrix, which GLPK rejects.
… negative

scaleBiomassFraction rescales the balancing component so the biomass
total becomes 1 g/gDW. A required fraction of zero or less inverted the
balancing pseudoreaction without notice; it now raises an error, as does
a balancing component with no current fraction. The help states that the
total becomes 1 g/gDW.
optimizeProb no longer refuses a MILP when 'glpk' is the RAVEN solver.
The bundled GLPK MEX supports integer variables and gives the same
answers as Gurobi on the gap-filling and minimal-medium problems of the
guide models. A RAVEN:glpkMILP warning recommends Gurobi for larger
problems. The GLPK branch uses the default time limit for MILPs and
reports a mipgap, as the Gurobi and SCIP branches do. MILPs through the
COBRA Toolbox's GLPK interface are still refused.

The help of setRavenSolver, gapFillMILP, fillGaps and getMinimalMedium
states the solver behaviour; getMinimalMedium also states that the
returned medium need not be unique.
A metaboliteName[comp] that matches more than one metabolite ended in an
unexplained assignment error. The error now names the matching
metabolites.
- randomSampling: the random-objective description applies to
  'randomObjective' only, not to the default ACHR.
- checkTasks: the model's own exchange reactions are not closed.
- findGeneDeletions: details 2 means the solve failed, not that the
  deletion is lethal.
- checkSolution: it reads an optimizeProb result, not a Mosek one.
- assignSBOterms: where the terms are stored and how to read them.
- haveFlux: the test uses the current bounds.
readYAMLmodel treated any indented line starting with '-' as a list
item, so a wrapped name continuing with '-epoxidizing)' was reported as
an unknown entry. Only a dash followed by a space, or a lone dash,
starts a list item. This made the kegg118 reference model unreadable and
with it getKEGGModelForOrganism.
curateModelFromTables read its tables by column position, so a
metabolite table without an inchi column wrote its notes over the
InChIs. Columns are now found by header name, in any order, and optional
columns can be left out. Every supplied field is written to existing
metabolites, genes and reactions as well as to new ones, including
metNotes and rxnReferences, which were never written to existing
entities; a field the model lacks is created. MIRIAM columns of the
reaction table are taken from the columns after the core fields rather
than from a fixed position, and grRules are matched to the right
existing reaction when existing and new reactions are mixed.
…lMILP

Every draft reaction with lb >= 0 is a reversal candidate, and its lower
bound was relaxed to -bigM with a coupling that only kept the flux
non-negative while the reaction was not reversed. A forced flux such as
a maintenance requirement (lb > 0) was therefore dropped, and the MILP
could report a repair, or no repair, that does not reach the growth
floor in the returned model. The coupling now keeps the original lower
bound unless the reaction is reversed.
…del has none

The kegg118 reference model has no reaction notes, so readYAMLmodel
returns no rxnNotes field and adding the provenance note failed.
…sible model

gapFillMILP no longer reverses draft reactions: the draft keeps its bounds and
the MILP minimises the number of added reactions. The reversedRxns output and
the weights parameter are removed.

gapReport raises RAVEN:infeasibleModel when the model is infeasible under its
own bounds or with its boundary closed, naming the forced-flux reactions.
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Function test results

417 tests   378 ✅  1m 29s ⏱️
 24 suites   39 💤
  1 files      0 ❌

Results for commit d228364.

♻️ This comment has been updated with latest results.

@edkerk
edkerk merged commit 2c6f9b8 into develop Oct 17, 2026
4 checks passed
@edkerk
edkerk deleted the fix/guide-review branch October 17, 2026 20:22
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