主要内容

sbmlexport

Export SimBiology model to SBML file

Description

sbmlexport(modelObj) exports a SimBiology model modelObj to a file with a Systems Biology Markup Language (SBML) Level 3 Version 2 format. The default file extension is .xml, and the file name matches the model name.

example

sbmlexport(modelObj,fileName) exports a SimBiology model object modelObj to an SBML file named fileName. The default file extension is .xml.

example

sbmlexport(___,Name=Value) specifies additional options using one or more name-value arguments for any of the previous syntaxes.

example

Examples

collapse all

Load the lotka model.

sbioloadproject("lotka.sbproj");

The model is represented by the variable m1. Show the name of the model.

m1.Name
ans = 
'lotka'

Export the model to an SBML file. By default, sbmlexport uses the name of the model as the file name using the default SBML version and generates lotka.xml in the current folder.

sbmlexport(m1);

Specify the output file name and SBML version to use.

sbmlexport(m1,"lotka_2_5.xml",Version=2.5);

You can also specify how to generate the SBML IDs for the model components. For instance, to use short IDs, use ReplacementStyle="Short".

sbmlexport(m1,"lotka_short.xml",ReplacementStyle="Short");

Input Arguments

collapse all

SimBiology model, specified as a SimBiology.Model object.

Name of a file to export the model, specified as a character vector or string scalar.

The file is an XML file with a Systems Biology Markup Language (SBML) format. Enter either a file name or a path and file name supported by your operating system. If the file name has no extension, then the function appends .xml to the end of the file name. If the file name has any extension, the function keeps the extension.

You can also save a SimBiology model to a MAT file or to a SimBiology project using sbiosaveproject to save features not supported by SBML. For more information about features that are supported by SimBiology but not by SBML or vice visa, see SBML Support.

Data Types: char | string

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: sbmlexport(m1,Version=2.5) specifies to use SBML version 2.5 to export the model m1.

SBML version to export to, specified as one of the following values: 3.2, 3.1, 2.5, 2.4, 2.3, or 2.2.

Example: sbmlexport(modelObj,Version=2.5) exports modelObj using SBML version 2.5.

Data Types: double | char | string

Algorithm to generate SBML IDs during the export, specified as one of the following values:

  • "underscore" — Replaces any consecutive sequence of nonalphanumeric characters with a single underscore. If, after replacement, the initial character is a number or an underscore, the function prepends an x to ensure that the ID is both a valid SBML ID and valid MATLAB variable name. A nonalphanumeric character here represents any character that is not a letter (A-Z, a-z), number (0-9), or _ (underscore). If a generated ID is not unique, the function keeps appending a number until it is a unique ID.

  • "short" — Generates IDs using the form xN, where N is a unique hexadecimal integer for each model component, starting with x0.

  • "delete" — Deletes all characters that are not alphanumerics or underscores. If, after deletion, the initial character is numeric, the function prepends an x to ensure that the ID is both a valid SBML ID and valid MATLAB variable name. If a generated ID is not unique, the function keeps appending a number until it is a unique ID.

  • "hex" — Replaces each character that is not an alphanumeric or underscore with its corresponding hexadecimal representation. Specifically, the function starts the ID with mw. Then it replaces any character that is not an alphanumeric or underscore with _NNNN, where NNNN is the four-character hexadecimal string representation of the character's numeric value, that is, the code point. For example, the double quote " is replaced with _0022 because 0x0022 is the associated code point.

Data Types: char | string

Version History

Introduced before R2006a

expand all