Skip to content

Format conversion

MATLAB functions in RAVEN/conversion of the RAVEN toolbox. Help text is collected from the source of the tracked branch.

Functions

Function Summary
addIdentifierPrefix Add identifier prefixes required by SBML.
ravenCobraWrapper Convert between RAVEN and COBRA structures.
removeIdentifierPrefix Remove SBML-required identifier prefixes.
standardizeModelFieldOrder Order RAVEN model structure fields.

Reference

addIdentifierPrefix

Add identifier prefixes required by SBML.

If reaction, metabolite, compartment, gene or model identifiers do not start with a letter or _, which conflicts with SBML specifications, prefixes are added for all identifiers in the respective model field. The prefixes are:

"R_" for model.rxns,
"M_" for model.mets,
"C_" for model.comps;
"G_" for model.genes (and also represented in model.grRules)

Input arguments:

Name Type Description Default
model struct

model whose identifiers should be modified.

required

Name-value arguments:

Name Type Description Default
fields cell

cell array with model field names that should be checked if prefixes should be added, possible values: 'rxns', 'mets', 'comps', 'genes', 'id' (default all listed model fields will be checked).

Output arguments:

Name Type Description
model struct

modified model.

hasChanged cell

cell array with fields and prefixes that are added.

Examples:

[model, hasChanged] = addIdentifierPrefix(model, fields);

ravenCobraWrapper

Convert between RAVEN and COBRA structures.

This function is a bidirectional tool to convert between RAVEN and COBRA structures. It recognises a COBRA structure by checking the existence of the field 'rules', which is only found in a COBRA Toolbox structure. If the COBRA model also has a grRules field, then this will be used instead of parsing the rules field.

Input arguments:

Name Type Description Default
model struct

a RAVEN/COBRA-compatible model structure.

required

Output arguments:

Name Type Description
newModel struct

a COBRA/RAVEN-compatible model structure.

Examples:

newModel = ravenCobraWrapper(model);
Notes

During the RAVEN -> COBRA -> RAVEN conversion cycle the following fields are lost: annotation, compOutside, compMiriams, rxnComps, geneComps, unconstrained. Boundary metabolites are lost, because the COBRA structure does not involve boundary metabolites, so they are removed using simplifyModel before RAVEN -> COBRA conversion. The field 'rev' is also partially lost, but during COBRA -> RAVEN conversion it is reconstructed based on lower bound reaction values.

During the COBRA -> RAVEN -> COBRA conversion cycle the following fields are lost: geneEntrezID, modelVersion, proteins.

The information about mandatory RAVEN fields was taken from the checkModelStruct function, whereas the corresponding information about COBRA fields was fetched from the verifyModel function.

removeIdentifierPrefix

Remove SBML-required identifier prefixes.

This function removes identifier prefixes:

"R_" for model.rxns, model.rxnNames and model.id,
"M_" for model.mets and model.metNames,
"C_" for model.comps;
"G_" for model.genes (and also represented in model.grRules).

By default, the prefixes are only removed if all entries in a particular field have the prefix. The prefixes might have been present because one or more identifiers do not start with a letter or _, which conflicts with SBML specifications.

Input arguments:

Name Type Description Default
model struct

model whose identifiers should be modified.

required

Name-value arguments:

Name Type Description Default
fields cell

cell array with model field names from which the identifiers should be removed, possible values: 'rxns', 'mets', 'comps', 'genes', 'metNames', 'rxnNames', 'id' (default all listed model fields will be checked).

forceRemove logical

if prefixes should be removed even if not all entries in a model field have the prefix (default false).

Output arguments:

Name Type Description
model struct

modified model.

hasChanged cell

cell array with fields and prefixes that are removed.

Examples:

model = removeIdentifierPrefix(model, fields, forceRemove);

standardizeModelFieldOrder

Order RAVEN model structure fields.

Orders fields of a RAVEN model structure as specified at https://github.com/SysBioChalmers/RAVEN/wiki/RAVEN-Model-Structure

The model fields themselves are not changed, only the order is modified. For changing model fields between RAVEN and COBRA format, use ravenCobraWrapper().

Input arguments:

Name Type Description Default
model struct

model structure, either RAVEN or COBRA format.

required

Output arguments:

Name Type Description
orderedModel struct

model structure with ordered fields.

Examples:

orderedModel = standardizeModelFieldOrder(model);
See also

ravenCobraWrapper