SBML

Methods are provided to import model definitions from SBML, based on the level 3 version 2 specification. Older versions (level 2 and up) are partially supported, but may raise warnings. Export of models is provided (level 3 version 2), but note that all variables will be represented as parameters (no compartments, species, or reactions) are created.

For further SBML functions, see SBML API.

Importing

The standard API for importing is provided:

myokit.formats.sbml.importers()

Returns a dict of all importers available in this module.

class myokit.formats.sbml.SBMLImporter

This Importer loads model definitions from files in SBML format.

Not all SBML features are supported, see myokit.formats.sbml.SBMLParser.

model(path)

Reads the SBML model stored at path and returns a Myokit model.

supports_model()

Returns True.

Exporting

The standard API for exporting is provided:

myokit.formats.sbml.exporters()

Returns a dict of all exporters available in this module.

class myokit.formats.sbml.SBMLExporter

This Exporter creates an SBML model.

model(path, model, protocol=None)

Writes an SBML model to the given filename.

Arguments:

path

The path/filename to write the generated code to.

model

The model to export.

protocol

If given, an attempt will be made to convert the protocol to an expression and insert it into the model before exporting. See myokit.lib.guess.add_embedded_protocol() for details.

supports_model()

Returns True.