API

SBMLToolkit provides importer selectors and extends the system constructors owned by SBML, Catalyst, and ModelingToolkit.

SBMLToolkit.convert_simplify_math — Function
convert_simplify_math(args...)

Compatibility alias for SBML.convert_promotelocals_expandfuns.

All arguments are forwarded unchanged. New code should import and call SBML.convert_promotelocals_expandfuns directly.

Examples

normalized_document = convert_simplify_math(document)
source
Catalyst.ReactionSystem — Method
ReactionSystem(model::SBML.Model; kwargs...)

Convert an SBML.Model to a completed Catalyst.ReactionSystem.

Arguments

  • model::SBML.Model: the normalized SBML model to convert.

Keywords

  • kwargs...: forwarded to Catalyst.ReactionSystem.

Returns

  • Catalyst.ReactionSystem: the completed reaction system.

Examples

model = readSBML("model.xml", DefaultImporter())
reaction_system = ReactionSystem(model)
source
ModelingToolkitBase.ODESystem — Method
ODESystem(model::SBML.Model; include_zero_odes = true, kwargs...)

Convert an SBML.Model to a completed ModelingToolkit.ODESystem.

Arguments

  • model::SBML.Model: the normalized SBML model to convert.

Keywords

  • include_zero_odes::Bool = true: retain equations with zero right-hand sides.
  • kwargs...: forwarded while constructing the intermediate reaction system.

Returns

  • ModelingToolkit.ODESystem: the completed ODE system.

Examples

model = readSBML("model.xml", DefaultImporter())
ode_system = ODESystem(model)
source
SBMLToolkit.DefaultImporter — Type
DefaultImporter()

Select SBMLToolkit's default normalization pipeline for SBML.readSBML.

The pipeline checks for unsupported features, upgrades the document to SBML Level 3 Version 2, and promotes local parameters and function definitions.

Examples

model = readSBML("model.xml", DefaultImporter())
source
SBMLToolkit.ODESystemImporter — Type
ODESystemImporter()

Select conversion of an SBML file to a completed ModelingToolkit.ODESystem.

Examples

ode_system = readSBML("model.xml", ODESystemImporter())
source
SBMLToolkit.ReactionSystemImporter — Type
ReactionSystemImporter()

Select conversion of an SBML file to a completed Catalyst.ReactionSystem.

Examples

reaction_system = readSBML("model.xml", ReactionSystemImporter())
source
SBML.readSBML — Method
readSBML(sbmlfile::String, ::DefaultImporter) -> SBML.Model

Import and normalize an SBML file for conversion to SciML system types.

Arguments

  • sbmlfile::String: path to the SBML XML file.
  • ::DefaultImporter: selects SBMLToolkit's default normalization pipeline.

Returns

  • SBML.Model: the normalized SBML model.

Throws

  • ErrorException: the file uses an unsupported SBML feature.

Examples

model = readSBML("model.xml", DefaultImporter())
source
SBML.readSBML — Method
readSBML(sbmlfile::String, ::ODESystemImporter; include_zero_odes = true, kwargs...)

Import an SBML file as a completed ModelingToolkit.ODESystem.

Arguments

  • sbmlfile::String: path to the SBML XML file.
  • ::ODESystemImporter: selects ODE-system conversion.

Keywords

  • include_zero_odes::Bool = true: retain equations with zero right-hand sides.
  • kwargs...: forwarded while constructing the intermediate reaction system.

Returns

  • ModelingToolkit.ODESystem: the completed ODE system.

Examples

ode_system = readSBML("model.xml", ODESystemImporter())
source
SBML.readSBML — Method
readSBML(sbmlfile::String, ::ReactionSystemImporter; kwargs...)

Import an SBML file as a completed Catalyst.ReactionSystem.

Arguments

  • sbmlfile::String: path to the SBML XML file.
  • ::ReactionSystemImporter: selects reaction-system conversion.

Keywords

  • kwargs...: forwarded to Catalyst.ReactionSystem.

Returns

  • Catalyst.ReactionSystem: the completed reaction system.

Examples

reaction_system = readSBML("model.xml", ReactionSystemImporter())
source
SBMLToolkit.checksupport_file — Method
checksupport_file(filename::String)

Validate that an SBML file uses features supported by SBMLToolkit.

Arguments

  • filename::String: path to the SBML XML file.

Returns

  • Bool: true when the file does not contain a known unsupported feature.

Throws

  • ErrorException: the file uses an unsupported SBML feature.

Examples

checksupport_file("model.xml")
source

Compatibility reexports

SBMLToolkit keeps these dependency-owned bindings available for compatibility. New code should import each binding from its owning package.

  • ReactionSystem: the Catalyst.ReactionSystem type and constructor.
  • ODESystem: the ModelingToolkit.ODESystem type and constructor.
  • readSBML: the SBML.readSBML loader extended by the importer selectors above.
  • readSBMLFromString: the SBML.readSBMLFromString loader for in-memory XML.
  • set_level_and_version: the corresponding SBML document transformation from SBML.jl.
  • convert_promotelocals_expandfuns: the SBML.jl normalization transformation.
  • convert_simplify_math: SBMLToolkit's compatibility alias for convert_promotelocals_expandfuns.