New functionality, dependencies and error handling#
RAVEN 3 changes gap-filling and the extraction of context-specific models with ftINIT, adds functions, depends on fewer MATLAB toolboxes, and handles errors in a different way.
Gap-filling and context-specific model extraction#
Aspect |
RAVEN 2 |
RAVEN 3 |
|---|---|---|
|
One built-in mixed-integer linear programming (MILP) strategy that maximises connectivity |
The same strategy is the default ( |
|
|
The first four optional arguments are unchanged. |
|
Depends on the solver seed, and the retries of the MILP set the seed to 1234. The dependence was not measured |
The option |
|
Retries with an increasing relative gap, which is derived from an absolute-gap setting and the last objective value |
The option |
|
|
Unchanged. |
|
One behaviour, equivalent to |
|
|
|
|
Positions in the migration pages count all arguments of the call, required ones included. The functions getINITModel and runINIT are described in Renamed and merged functions.
Algorithms of fillGaps#
The option algorithm of fillGaps selects one of these algorithms. A value that is none of them runs the algorithm 'reference'.
'fastLP'and'swiftLP'relax the problem to a linear program (LP) in the manner of FASTCORE and SWIFTCORE.'gapfillMILP'is a MILP with a growth floor. Reactions that are already in the draft model keep their bounds, so a reaction with the wrong direction is not changed.'topological'is a pre-screen of producibility by breadth-first search. It does not modify the model, requires a reference model and uses the first one.
The function fillGaps calls gapFillTopological with the defaults of that function. The seeds are the metabolites of the exchange reactions that getExchangeRxns classes as 'uptake' or 'reverse'. The targets are the metabolites of the first objective reaction, and a model without an objective reaction raises RAVEN:badInput.
Gap-filling in fitTasks#
With gapFillMode set to 'preMerged', fitTasks expects a reference model that already contains the reactions of the model. No merge is needed for each task, and ftINITFillGaps fills the gaps. How fitTasks treats a task that requires net production of a metabolite without reactions was not checked.
Tie-breaking in ftINIT#
With resolveTies, each MILP step of ftINIT holds the score at its optimum and chooses among the tied solutions in phases, each with a time limit. The phases select, in this order:
the fewest kept removable reactions;
the lowest summed ID rank of those reactions, where a merged reaction is ranked by the smallest original ID of its group;
the least total absolute flux;
the least backward flux, weighted by ID rank.
The function ftINITInternalAlg has the arguments resolveTies (13th), rankKeys (14th, default model.rxns) and pinFluxes (15th, default true). With pinFluxes set to false the two flux phases are skipped, and ftINIT passes false in its last step. A step whose first solve stops at the time limit keeps that solution without the phases. The count phase and the rank phase get half of the step time limit each, and a phase that fails issues a warning.
New functionality#
The table lists the functions that RAVEN 3 adds. The functions randomSampling and parseScores exist in RAVEN 2 and behave differently.
Area |
Functions |
Capability |
|---|---|---|
Flux sampling ( |
|
ACHR (hit-and-run) and CHRR (hit-and-run with rounding), two near-uniform Markov chain Monte Carlo (MCMC) samplers |
Flux sampling ( |
|
Dispatcher with the option |
Flux analysis and quality control (QC) |
|
Compares flux vectors |
Flux analysis and QC |
|
Searches a minimal medium with a MILP |
Flux analysis and QC |
|
Traces the path of the highest flux fraction between two reactions |
Flux analysis and QC |
|
Navigates the flux neighbourhood interactively |
Flux analysis and QC |
|
Prints a summary of a model and its fluxes |
Model comparison ( |
|
Compares two models by ID: stoichiometry, bounds, objective, |
Manipulation |
|
Query for reactions with the same stoichiometry |
Genome-based curation ( |
|
Pipeline from an NCBI genome accession to a gene ID mapping table |
Genome-based curation ( |
|
Renames genes in bulk |
Genome-based curation ( |
|
Curates metabolites, reactions and genes of an existing model in bulk from |
Biomass composition ( |
|
Calibration of the biomass composition and of the growth-associated maintenance (GAM). |
Localisation ( |
|
Deterministic assignment of compartments by MILP, as an alternative to the heuristic |
Localisation ( |
|
Adds |
Annotation ( |
|
Assignment of SBO terms; CSV I/O of ΔG data |
Conditions ( |
|
Applies a condition from a YAML file to a model in a fixed order: exchange bounds, edits of cofactor pseudoreactions, changes of the biomass stoichiometry, and bound overrides per reaction |
Infrastructure |
|
Registry of every one-dimensional model field (entity type, default value), used by |
Infrastructure |
|
Progress reporting with a selectable backend, for example a log file on compute clusters |
Infrastructure |
|
Splits an optimisation problem to improve its conditioning |
The call randomSampling(model, n) runs ACHR, where RAVEN 2 ran its own method. Adding 'method', 'randomObjective' runs the RAVEN 2 method. The function also gains the outputs and options info, seed, thinning and nBurnin.
The function documentation of sampleCHRR states that the polytope is rounded before sampling and that mixing stays fast on strongly elongated polytopes such as enzyme-constrained models. It states that sampleACHR does not round. The mixing speed was not measured.
Parsing of gene-reaction rules describes findPotentialErrors, the parser functions and the rule comparison of diffModels. Reconstruction: KEGG and homology pipelines describes the reconstruction and curation functions for KEGG, homology and genome data.
Toolbox dependencies and installation#
Aspect |
RAVEN 2 |
RAVEN 3 |
|---|---|---|
MATLAB version |
No minimum stated. |
No minimum stated, and the code has no check that rejects an older release. |
Statistics and Machine Learning Toolbox |
Required by |
Optional in |
Bioinformatics Toolbox |
Required by |
Not required ( |
Optimization Toolbox |
Required for |
Not required, because both functions are removed |
Parallel Computing Toolbox |
Optional. The |
Optional. |
Excel I/O |
Bundled Apache POI (Java) |
OOXML writer without dependencies |
LP and MILP solver |
Required: bundled |
Unchanged |
External binaries |
Committed to the repository (BLAST+, DIAMOND, HMMER) and available offline after cloning |
Fetched on first use as ZIP files per platform into |
KEGG HMM libraries and reference data |
Manual download or local build |
Fetched on first use and cached |
Installation self-check |
|
|
KEGG data, binaries and the checksum manifest come from releases of toolbox-assets. Other downloads have other sources. A RAVEN 3 clone needs network access for these downloads.
KEGG data comes from the release tag that
keggDataVersion()returns (src/reconstruction/kegg/KEGG_VERSION.md, tagkegg118).The binaries come from the fixed tags in
src/installation/downloadRavenBinaries.m:blast-2.17.0,diamond-2.1.17,hmmer-3.4.0and, on Windows,hmmer-3.3.2.The checksums of downloaded files come from
manifest.jsonof themanifest-v3release, which is read at download time.setRavenSolver('scip')on Windows downloadsscip_mex_win.zipfrom the RAVEN v2.8.6 release on GitHub intosrc/external/scip. The repository holds no SCIP files, and other platforms need a SCIP installation made by hand.getUniProtScoresqueries rest.uniprot.org,downloadGenomeDatadownloads from NCBI, andcheckRavenreads the version file from GitHub.
Error and warning handling#
RAVEN 3 raises errors and issues warnings with error() and warning(). Outside src/external there are 411 error calls, counted as lines that contain error( and do not start with a comment. Of these, 301 carry an identifier, and 242 of those are in the RAVEN:* namespace. By the same rule there are 94 warning calls, of which 79 carry an identifier and 72 are in the RAVEN:* namespace. Whether the message texts of the RAVEN 2 checks are preserved was not checked. A try/catch block that matches message text can be replaced by a match on the identifier where one exists. Backward-incompatible changes describes the replacement of dispEM, and Removed functionality names the helper utils/ravenList.m.
The call issues = checkModelStruct(model) returns a structure array of the problems (category, target and message) for programmatic model QC and raises no error. Without an output argument the function raises errors or issues warnings as in RAVEN 2. The options throwErrors and trimWarnings, which are positional in RAVEN 2, can also be given as name-value pairs.