libSBML Python API  5.18.0
Core libSBML

SBML Level 3 introduced a modular architecture, in which SBML Level 3 Core is usable in its own right (much like SBML Levels 1 and 2 before it), and optional SBML Level 3 Packages add features to this Core. To support this architecture, libSBML is itself divided into a core libSBML and optional extensions.

Differences between core libSBML and extensions to libSBML

Core libSBML corresponds to the features of SBML Levels 1 to 3 Core; they are always available, and require applications to understand only the SBML core specifications. The classes listed on the rest of this page constitute libSBML's implementation of SBML Levels 1–3, without any SBML Level 3 packages.

By contrast, the libSBML extensions are plug-ins that each implement support for a given SBML Level 3 package. Separate pages of this API manual describe the libSBML extensions for those SBML Level 3 packages that are supported at this time. They are grouped under the section titled Level 3 Extensions. The stable releases of libSBML only include extensions for officially-released package specifications; additional, experimental extensions may be available for other Level 3 packages that may not yet have been finalized by the SBML community. You can find copies of these experimental extensions at the download site for libSBML on SourceForge.net.

Summary of core SBML objects implemented in libSBML

Each type of component in a plain SBML model (i.e., one that does not use any SBML packages) is described using a specific type of SBML data object that organizes the relevant information. The top level of an SBML model definition consists of lists of these components, with every list being optional. The next table enumerates the lists and objects defined by core SBML; also shown are the SBML Level+Version combinations for which they are valid.

SBML components and corresponding libSBML objects.
Level & Version LibSBML container object LibSBML data object(s)
Level 2 Version 1 and higher ListOfFunctionDefinitionsFunctionDefinition
Level 2 Version 1 and higher ListOfUnitDefinitionsUnitDefinition
Level 2 Versions 2–5 ListOfCompartmentTypesCompartmentType
Level 1 and higher ListOfCompartmentsCompartment
Level 2 Versions 2–5 ListOfSpeciesTypesSpeciesType
Level 1 and higher ListOfSpeciesSpecies
Level 1 and higher ListOfParametersParameter
Level 2 Version  and higher ListOfInitialAssignmentsInitialAssignment
Level 1 and higher ListOfRulesAssignmentRule, AlgebraicRule, RateRule
Level 2 Version  and higher ListOfConstraintsConstraint
Level 1 and higher ListOfReactionsReaction
Level 2 Version 1 and higher ListOfEventsEvent

The list of classes below constitutes the public API of core libSBML. The list includes classes that are not defined in any SBML specification; these utility classes are provided by libSBML to implement various kinds of functionality useful in the context of working with SBML content. More...

Classes

class  libsbml.AlgebraicRule
  An SBML algebraic rule representing 0 = f(W). More...
 
class  libsbml.AssignmentRule
  An SBML assignment rule representing x = f(Y). More...
 
class  libsbml.ASTNode
  Abstract Syntax Tree (AST) representation of a mathematical expression. More...
 
class  libsbml.Compartment
  An SBML compartment, where species are located. More...
 
class  libsbml.CompartmentType
  A compartment type in SBML Level 2. More...
 
class  libsbml.Constraint
  An SBML constraint, for stating validity assumptions. More...
 
class  libsbml.ConversionOption
  A single configuration setting for an SBML converter. More...
 
class  libsbml.ConversionProperties
  Set of configuration option values for a converter. More...
 
class  libsbml.CVTerm
  A MIRIAM-compliant controlled vocabulary term. More...
 
class  libsbml.Date
  A MIRIAM-compliant date representation. More...
 
class  libsbml.DefinitionURLRegistry
  Registry of all libSBML SBML DefinitionURLs. More...
 
class  libsbml.Delay
  A delay on the time of execution of an SBML event. More...
 
class  libsbml.ElementFilter
  Base class for filter functions. More...
 
class  libsbml.Event
  A discontinuous SBML event. More...
 
class  libsbml.EventAssignment
  An assignment to a variable by an SBML event. More...
 
class  libsbml.FunctionDefinition
  A user-defined function in an SBML model. More...
 
class  libsbml.InitialAssignment
  An SBML initial assignment, evaluated once only. More...
 
class  libsbml.KineticLaw
  The rate expression for an SBML reaction. More...
 
class  libsbml.L3ParserSettings
  Controls the behavior of the Level 3 formula parser. More...
 
class  libsbml.ListOf
  Parent class for libSBML's 'ListOfXYZ' classes. More...
 
class  libsbml.ListOfCompartments
  A list of Compartment objects. More...
 
class  libsbml.ListOfCompartmentTypes
  A list of CompartmentType objects. More...
 
class  libsbml.ListOfConstraints
  A list of Constraint objects. More...
 
class  libsbml.ListOfEventAssignments
  A list of EventAssignment objects. More...
 
class  libsbml.ListOfEvents
  A list of Event objects. More...
 
class  libsbml.ListOfFunctionDefinitions
  A list of FunctionDefinition objects. More...
 
class  libsbml.ListOfInitialAssignments
  A list of InitialAssignment objects. More...
 
class  libsbml.ListOfLocalParameters
  A list of LocalParameter objects. More...
 
class  libsbml.ListOfParameters
  A list of Parameter objects. More...
 
class  libsbml.ListOfReactions
  A list of Reaction objects. More...
 
class  libsbml.ListOfRules
  A list of Rule objects. More...
 
class  libsbml.ListOfSpecies
  A list of Species objects. More...
 
class  libsbml.ListOfSpeciesReferences
  A list of SpeciesReference objects. More...
 
class  libsbml.ListOfSpeciesTypes
  A list of SpeciesType objects. More...
 
class  libsbml.ListOfUnitDefinitions
  A list of UnitDefinition objects. More...
 
class  libsbml.ListOfUnits
  A list of Unit objects. More...
 
class  libsbml.LocalParameter
  A parameter inside an SBML reaction definition. More...
 
class  libsbml.Model
  An SBML model. More...
 
class  libsbml.ModelCreator
  MIRIAM-compliant data about a model's creator. More...
 
class  libsbml.ModelHistory
  MIRIAM-compliant data about a model's history. More...
 
class  libsbml.ModifierSpeciesReference
  A reference to an SBML modifier species. More...
 
class  libsbml.Parameter
  An SBML parameter: a named symbol with a value. More...
 
class  libsbml.Priority
  The priority of execution of an SBML event. More...
 
class  libsbml.RateRule
  An SBML rate rule representing dx/dt = f(Y). More...
 
class  libsbml.RDFAnnotationParser
  MIRIAM-compliant RDF annotation reader/writer. More...
 
class  libsbml.Reaction
  An SBML reaction between species in an SBML model. More...
 
class  libsbml.RenderPkgNamespaces
  Set of SBML Level + Version + namespace triples. More...
 
class  libsbml.Rule
  Parent class for SBML rules in libSBML. More...
 
class  libsbml.SBase
  SBML's SBase class, base class of most SBML objects. More...
 
class  libsbml.SBasePlugin
  Base class for extending SBML objects in packages. More...
 
class  libsbml.SBMLConverter
  Base class for SBML converters. More...
 
class  libsbml.SBMLConverterRegistry
  Registry of all libSBML SBML converters. More...
 
class  libsbml.SBMLDocument
  Overall SBML container object. More...
 
class  libsbml.SBMLDocumentPlugin
  Base class for extending SBMLDocument in packages. More...
 
class  libsbml.SBMLError
  An error, warning or other diagnostic. More...
 
class  libsbml.SBMLErrorLog
  Log of diagnostics reported during processing. More...
 
class  libsbml.SBMLExtension
  Base class for SBML Level 3 package plug-ins. More...
 
class  libsbml.SBMLExtensionException
  Exception used by package extensions More...
 
class  libsbml.SBMLExtensionRegistry
  Registry where package extensions are registered. More...
 
class  libsbml.SBMLFunctionDefinitionConverter
  Converter to expand user-defined functions in-line. More...
 
class  libsbml.SBMLIdConverter
  Converter for replacing object identifiers. More...
 
class  libsbml.SBMLInferUnitsConverter
  Converter for inferring and setting parameter units. More...
 
class  libsbml.SBMLInitialAssignmentConverter
  Converter that removes SBML initial assignments. More...
 
class  libsbml.SBMLLevel1Version1Converter
  Whole-document SBML Level/Version converter. More...
 
class  libsbml.SBMLLevelVersionConverter
  Whole-document SBML Level/Version converter. More...
 
class  libsbml.SBMLLocalParameterConverter
  Converter to turn local parameters into global ones. More...
 
class  libsbml.SBMLNamespaces
  Set of SBML Level + Version + namespace triples. More...
 
class  libsbml.SBMLReactionConverter
  Converter to replace reactions with SBML rate rules. More...
 
class  SBMLReader
  File and text-string SBML reader. More...
 
class  libsbml.SBMLReader
  File and text-string SBML reader. More...
 
class  libsbml.SBMLRuleConverter
  Converter that sorts SBML rules and assignments. More...
 
class  libsbml.SBMLStripPackageConverter
  Converter that removes SBML Level 3 packages. More...
 
class  libsbml.SBMLUnitsConverter
  Converts a model's existing units to SI units. More...
 
class  libsbml.SBMLValidator
  Base class for SBML validators. More...
 
class  SBMLWriter
  File and text-string SBML writer. More...
 
class  libsbml.SBMLWriter
  File and text-string SBML writer. More...
 
class  libsbml.SBO
  Facilities for using the Systems Biology Ontology. More...
 
class  libsbml.SimpleSpeciesReference
  Abstract class for references to species in reactions. More...
 
class  libsbml.Species
  An SBML species – a pool of entities. More...
 
class  libsbml.SpeciesReference
  A reference to an SBML species in a reaction. More...
 
class  libsbml.SpeciesType
  A species type in SBML Level 2. More...
 
class  libsbml.StoichiometryMath
  Stochiometry expressions in SBML Level 2 reactions. More...
 
class  libsbml.SyntaxChecker
  Methods for checking the validity of SBML identifiers. More...
 
class  libsbml.Trigger
  The trigger expression for an SBML event. More...
 
class  libsbml.Unit
  A single unit referenced in an SBML unit definition. More...
 
class  libsbml.UnitDefinition
  A definition of a unit used in an SBML model. More...
 
class  libsbml.XMLAttributes
  A list of attributes on an XML element. More...
 
class  libsbml.XMLError
  XML-level errors, warnings and other diagnostics. More...
 
class  libsbml.XMLErrorLog
  Log of diagnostics reported during XML processing. More...
 
class  libsbml.XMLInputStream
  An interface to an XML input stream. More...
 
class  libsbml.XMLNamespaces
  An XML Namespace. More...
 
class  libsbml.XMLNode
  A node in libSBML's XML document tree. More...
 
class  libsbml.XMLOutputStream
  Interface to an XML output stream. More...
 
class  libsbml.XMLToken
  A token in an XML stream. More...
 
class  libsbml.XMLTriple
  A qualified XML name. More...
 

Functions

def libsbml.RenderPkgNamespaces.__init__ (self, args)
 

Detailed Description

SBML Level 3 introduced a modular architecture, in which SBML Level 3 Core is usable in its own right (much like SBML Levels 1 and 2 before it), and optional SBML Level 3 Packages add features to this Core. To support this architecture, libSBML is itself divided into a core libSBML and optional extensions.

Differences between core libSBML and extensions to libSBML

Core libSBML corresponds to the features of SBML Levels 1 to 3 Core; they are always available, and require applications to understand only the SBML core specifications. The classes listed on the rest of this page constitute libSBML's implementation of SBML Levels 1–3, without any SBML Level 3 packages.

By contrast, the libSBML extensions are plug-ins that each implement support for a given SBML Level 3 package. Separate pages of this API manual describe the libSBML extensions for those SBML Level 3 packages that are supported at this time. They are grouped under the section titled Level 3 Extensions. The stable releases of libSBML only include extensions for officially-released package specifications; additional, experimental extensions may be available for other Level 3 packages that may not yet have been finalized by the SBML community. You can find copies of these experimental extensions at the download site for libSBML on SourceForge.net.

Summary of core SBML objects implemented in libSBML

Each type of component in a plain SBML model (i.e., one that does not use any SBML packages) is described using a specific type of SBML data object that organizes the relevant information. The top level of an SBML model definition consists of lists of these components, with every list being optional. The next table enumerates the lists and objects defined by core SBML; also shown are the SBML Level+Version combinations for which they are valid.

SBML components and corresponding libSBML objects.
Level & Version LibSBML container object LibSBML data object(s)
Level 2 Version 1 and higher ListOfFunctionDefinitionsFunctionDefinition
Level 2 Version 1 and higher ListOfUnitDefinitionsUnitDefinition
Level 2 Versions 2–5 ListOfCompartmentTypesCompartmentType
Level 1 and higher ListOfCompartmentsCompartment
Level 2 Versions 2–5 ListOfSpeciesTypesSpeciesType
Level 1 and higher ListOfSpeciesSpecies
Level 1 and higher ListOfParametersParameter
Level 2 Version  and higher ListOfInitialAssignmentsInitialAssignment
Level 1 and higher ListOfRulesAssignmentRule, AlgebraicRule, RateRule
Level 2 Version  and higher ListOfConstraintsConstraint
Level 1 and higher ListOfReactionsReaction
Level 2 Version 1 and higher ListOfEventsEvent

The list of classes below constitutes the public API of core libSBML. The list includes classes that are not defined in any SBML specification; these utility classes are provided by libSBML to implement various kinds of functionality useful in the context of working with SBML content.

Function Documentation

def libsbml.RenderPkgNamespaces.__init__ (   self,
  args 
)
__init__(SBMLExtensionNamespaces<(RenderExtension)> self, long  level, long  version, long  pkgVersion, string prefix)   RenderPkgNamespaces
__init__(SBMLExtensionNamespaces<(RenderExtension)> self, long  level, long  version, long  pkgVersion)   RenderPkgNamespaces
__init__(SBMLExtensionNamespaces<(RenderExtension)> self, long  level, long  version)   RenderPkgNamespaces
__init__(SBMLExtensionNamespaces<(RenderExtension)> self, long  level)   RenderPkgNamespaces
__init__(SBMLExtensionNamespaces<(RenderExtension)> self)   RenderPkgNamespaces
__init__(SBMLExtensionNamespaces<(RenderExtension)> self, RenderPkgNamespaces orig)   RenderPkgNamespaces
  Set of SBML Level + Version + namespace triples.

This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.

SBMLExtensionNamespaces is a template class. It is extended from SBMLNamespaces and is meant to be used by package extensions to store the SBML Level, Version within a Level, and package version of the SBML Level 3 package implemented by a libSBML package extension.

Basic principles of SBML package extensions in libSBML

SBML Level 3's package structure permits modular extensions to the core SBML format. In libSBML, support for SBML Level 3 packages is provided through optional package extensions that can be plugged into libSBML at the time it is built/compiled. Users of libSBML can thus choose which extensions are enabled in their software applications.

LibSBML defines a number of classes that developers of package extensions can use to implement support for an SBML Level 3 package. These classes make it easier to extend libSBML objects with new attributes and/or subobjects as needed by a particular Level 3 package. Three overall categories of classes make up libSBML's facilities for implementing package extensions. There are (1) classes that serve as base classes meant to be subclassed, (2) template classes meant to be instantiated rather than subclassed, and (3) support classes that provide utility features. A given package implementation for libSBML will take the form of code using these and other libSBML classes, placed in a subdirectory of src/sbml/packages/.

The basic libSBML distribution includes a number of package extensions implementing support for officially-endorsed SBML Level 3 packages; among these are Flux Balance Constraints ('fbc'), Hierarchical Model Composition ('comp'), Layout ('layout'), and Qualitative Models ('qual'). They can serve as working examples for developers working to implement other packages.

Extensions in libSBML can currently only be implemented in C++ or C; there is no mechanism to implement them first in languages such as Java or Python. However, once implemented in C++ or C, language interfaces can be generated semi-automatically using the framework in place in libSBML. (The approach is based on using SWIG and facilities in libSBML's build system.)