Learn R Programming

minval (version 0.8-2)

writeSBMLmod: Write a model in SBML format

Description

This function converts a data.frame or a modelOrg object to a valid SBML file. The Systems Biology Markup Language (SBML) is a representation format, based on XML, for communicating and storing computational models of biological processes.

Usage

writeSBMLmod(modelData, modelID = "model", outputFile, boundary = "b")

Arguments

modelData

A modelOrg or a data.frame object. If a data.frame is given, it must contain following mandatory colnames:

  • 'ID': A list of single character strings containing the reaction abbreviations, Entries in the field abbreviation are used as reaction ids, so they must be unique.

  • 'REACTION': A set of stoichiometric reaction with the following characteristics:

    • Arrows symbols must be given in the form '=>' or '<=>'

    • Inverse arrow symbols '<=' or other types as: '-->', '<==>', '->' will not be parsed and will lead to errors.

    • Arrow symbols and plus signs (+) must be surrounded by a space character

    • Stoichiometric coefficients must be surrounded by a space character and not by parentheses.

    • Each metabolite must have only one stoichiometric coefficient, substituents must be joined to metabolite name by a hyphen (-) symbol.

    • Exchange reactions must have only one metabolite before arrow symbol

    • Compartments must be given between square brackets ([compartment]) joined at the end of metabolite name

    Some examples of valid stoichiometric reactions are:

    • H2O[c] + Urea-1-Carboxylate[c] <=> 2 CO2[c] + 2 NH3[c]

    • ADP[c] + Phosphoenolpyruvate[c] => ATP[c] + Pyruvate[c]

    • CO2[c] <=>

  • 'GPR': A set of genes joined by boolean operators as AND or OR, rules may be nested by parenthesis. (optional: column can be empty),

  • 'LOWER.BOUND': A list of numeric values containing the lower bounds of the reaction rates. If not set, zero is used for an irreversible reaction and -1000 for a reversible reaction. (optional: column can be empty),

  • 'UPPER.BOUND': A list of numeric values containing the upper bounds of the reaction rates. If not set, 1000 is used by default. (optional: column can be empty),

  • 'OBJECTIVE': A list of numeric values containing objective values (-1, 0 or 1) for each reaction (optional: column can be empty).

modelID

A single character string giving the modelID

outputFile

A writable path for the output 'SBML' file to be generate

boundary

A single character string specifying the compartment to be used as boundary, 'b' is used by default

Value

A valid SBML file

Examples

Run this code
# NOT RUN {
# Loading a metabolic model
glycolysis <- read.csv(system.file("extdata/glycolysisModel.csv",package = "minval"), sep='\t')

# }
# NOT RUN {
# Writing a model in SBML format
writeSBMLmod(modelData = glycolysis,modelID = "Glycolysis",outputFile = "glycolysis.xml")


# Writing a modelOrg object in a SBML format
## Loading the sybil R package
library(sybil)

## Loading the data
data("Ec_core")

## Writing the modelOrg object in a SBML format
writeSBMLmod(modelData = Ec_core,modelID = "E.coli",outputFile = "eColi.xml")
# }

Run the code above in your browser using DataLab