libSBML Python API  5.11.0
Flux Balance Constraints

The libSBML “fbc” extension implements support for the SBML Level 3 Flux Balance Constraints package.

Introduction

Constraint based modeling is a widely accepted methodology used to analyze and study biological networks on both a small and whole organism (genome) scale. Typically these models are underdetermined and constraint based methods (e.g. linear, quadratic optimization) are used to optimize specific model properties. This is assumed to occur under a defined set of constraints (e.g. stoichiometric, metabolic) and bounds (e.g. thermodynamic, experimental and environmental) on the values that the solution fluxes can obtain.

Perhaps the most well known (and widely used) analysis method is Flux Balance Analysis (FBA), which is performed on Genome Scale Reconstructions. When using FBA, a target flux is optimized (e.g., to maximize a flux to biomass or minimize ATP production) while other fluxes can be bounded to simulate a selected growth environment or specific metabolic state.

As constraint based models are generally underdetermined, i.e., few or none of the kinetic rate equations and related parameters are known, it is crucial that a model definition includes the ability to define optimization parameters such as objective functions, flux bounds and constraints. This is not well-supported in SBML Level 3 Core. The question of how to best encode constraint-based models in SBML is not new. However, advances in the methods used to construct genome scale constraint-based models and the wider adoption of constraint based modeling in biotechnological/medical applications have led to a rapid increase in both the number of models being constructed and the tools used to analyze them.

Faced with such growth, both in number and diversity, the need for a standardized data format for the definition, exchange and annotation of constraint based models has become critical. As the core model components (e.g., species, reactions, stoichiometry) can already be efficiently described in SBML, the Flux Balance Constraints (FBC) package is designed to extend SBML Level~3 Core by adding the elements necessary to encode current and future constraint-based models.

The specification for this SBML package

This API documentation for libSBML does not provide a complete explanation of the SBML Level 3 Flux Balance Constraints (“fbc”) package. If you are developing software that uses “fbc”, you are strongly urged to read the actual specification for the package. A link to the specification document current is provided below, along with a link to the page of known issues (if any).

Specification for SBML Level 3 Flux Balance Constraints, current at the time of this libSBML release (5.11.0). Note: an Internet connection is required to access these documents.
Specification (in PDF format) Known issues
Flux Balance Constraints package, Version 1 Release 1 Errata page
More...

Classes

class  libsbml.Association
 fbc Proposed representation of gene associations. More...
 
class  libsbml.CobraToFbcConverter
 fbc COBRA to SBML Level 3 'fbc' converter. More...
 
class  libsbml.FbcExtension
 fbc Base extension class for the package. More...
 
class  libsbml.FbcModelPlugin
 fbc Extension of Model. More...
 
class  libsbml.FbcPkgNamespaces
 fbc SBMLNamespaces extension for the package. More...
 
class  libsbml.FbcSpeciesPlugin
 fbc Extension of Species. More...
 
class  libsbml.FbcToCobraConverter
 fbc SBML Level 3 'fbc' to COBRA converter. More...
 
class  libsbml.FluxBound
 fbc Max or min value for a reaction flux. More...
 
class  libsbml.FluxObjective
 fbc An objective function for a flux. More...
 
class  libsbml.GeneAssociation
 fbc Proposed annotation for gene associations. More...
 
class  libsbml.ListOfFluxBounds
 fbc A list of FluxBound objects. More...
 
class  libsbml.ListOfFluxObjectives
 fbc A list of FluxObjectives. More...
 
class  libsbml.ListOfGeneAssociations
 fbc A list of GeneAssociation objects. More...
 
class  libsbml.ListOfObjectives
 fbc A list of Objective objects. More...
 
class  libsbml.Objective
 fbc An objective function. More...
 

Functions

def libsbml.FbcModelPlugin.__init__ (self, args)
 fbc Extension of Model. More...
 
def libsbml.FbcSpeciesPlugin.__init__ (self, args)
 fbc Extension of Species. More...
 
def libsbml.CobraToFbcConverter.__init__ (self, args)
 fbc COBRA to SBML Level 3 'fbc' converter. More...
 
def libsbml.FbcToCobraConverter.__init__ (self, args)
 fbc SBML Level 3 'fbc' to COBRA converter. More...
 
def libsbml.Association.__init__ (self, args)
 fbc Proposed representation of gene associations. More...
 
def libsbml.FluxBound.__init__ (self, args)
 fbc Max or min value for a reaction flux. More...
 
def libsbml.FluxObjective.__init__ (self, args)
 fbc An objective function for a flux. More...
 
def libsbml.GeneAssociation.__init__ (self, args)
 fbc Proposed annotation for gene associations. More...
 
def libsbml.Objective.__init__ (self, args)
 fbc An objective function. More...
 
def libsbml.ListOfFluxBounds.clone (self)
 fbc A list of FluxBound objects. More...
 
def libsbml.ListOfFluxObjectives.clone (self)
 fbc A list of FluxObjectives. More...
 
def libsbml.ListOfGeneAssociations.clone (self)
 fbc A list of GeneAssociation objects. More...
 
def libsbml.ListOfObjectives.clone (self)
 fbc A list of Objective objects. More...
 
def libsbml.FbcPkgNamespaces.clone (self)
 fbc SBMLNamespaces extension for the package. More...
 
def libsbml.FbcExtension.getPackageName ()
 fbc Base extension class for the package. More...
 

Detailed Description

The libSBML “fbc” extension implements support for the SBML Level 3 Flux Balance Constraints package.

Introduction

Constraint based modeling is a widely accepted methodology used to analyze and study biological networks on both a small and whole organism (genome) scale. Typically these models are underdetermined and constraint based methods (e.g. linear, quadratic optimization) are used to optimize specific model properties. This is assumed to occur under a defined set of constraints (e.g. stoichiometric, metabolic) and bounds (e.g. thermodynamic, experimental and environmental) on the values that the solution fluxes can obtain.

Perhaps the most well known (and widely used) analysis method is Flux Balance Analysis (FBA), which is performed on Genome Scale Reconstructions. When using FBA, a target flux is optimized (e.g., to maximize a flux to biomass or minimize ATP production) while other fluxes can be bounded to simulate a selected growth environment or specific metabolic state.

As constraint based models are generally underdetermined, i.e., few or none of the kinetic rate equations and related parameters are known, it is crucial that a model definition includes the ability to define optimization parameters such as objective functions, flux bounds and constraints. This is not well-supported in SBML Level 3 Core. The question of how to best encode constraint-based models in SBML is not new. However, advances in the methods used to construct genome scale constraint-based models and the wider adoption of constraint based modeling in biotechnological/medical applications have led to a rapid increase in both the number of models being constructed and the tools used to analyze them.

Faced with such growth, both in number and diversity, the need for a standardized data format for the definition, exchange and annotation of constraint based models has become critical. As the core model components (e.g., species, reactions, stoichiometry) can already be efficiently described in SBML, the Flux Balance Constraints (FBC) package is designed to extend SBML Level~3 Core by adding the elements necessary to encode current and future constraint-based models.

The specification for this SBML package

This API documentation for libSBML does not provide a complete explanation of the SBML Level 3 Flux Balance Constraints (“fbc”) package. If you are developing software that uses “fbc”, you are strongly urged to read the actual specification for the package. A link to the specification document current is provided below, along with a link to the page of known issues (if any).

Specification for SBML Level 3 Flux Balance Constraints, current at the time of this libSBML release (5.11.0). Note: an Internet connection is required to access these documents.
Specification (in PDF format) Known issues
Flux Balance Constraints package, Version 1 Release 1 Errata page

Function Documentation

def libsbml.FbcModelPlugin.__init__ (   self,
  args 
)

fbc Extension of Model.

This method has multiple variants; they differ in the arguments they accept.

__init__(string uri, string prefix, FbcPkgNamespaces fbcns)   FbcModelPlugin
__init__(FbcModelPlugin orig)   FbcModelPlugin

Each variant is described separately below.


Method variant with the following signature:
FbcModelPlugin(stringuri, stringprefix, FbcPkgNamespaces fbcns)

Constructor


Method variant with the following signature:
FbcModelPlugin(FbcModelPlugin orig)

Copy constructor. Creates a copy of this FbcModelPlugin object.

def libsbml.FbcSpeciesPlugin.__init__ (   self,
  args 
)

fbc Extension of Species.

The Flux Balance Constraints package extends the SBML Level 3 Version 1 Core Species class with the addition of two attributes: 'charge' and 'chemicalFormula'.

This method has multiple variants; they differ in the arguments they accept.

__init__(string uri, string prefix, FbcPkgNamespaces fbcns)   FbcSpeciesPlugin
__init__(FbcSpeciesPlugin orig)   FbcSpeciesPlugin

Each variant is described separately below.


Method variant with the following signature:
FbcSpeciesPlugin(stringuri, stringprefix, FbcPkgNamespaces fbcns)

Constructor


Method variant with the following signature:
FbcSpeciesPlugin(FbcSpeciesPlugin orig)

Copy constructor. Creates a copy of this FbcSpeciesPlugin object.

def libsbml.CobraToFbcConverter.__init__ (   self,
  args 
)

fbc COBRA to SBML Level 3 'fbc' converter.

This method has multiple variants; they differ in the arguments they accept.

__init__()   CobraToFbcConverter
__init__(CobraToFbcConverter arg2)   CobraToFbcConverter

Each variant is described separately below.


Method variant with the following signature:
CobraToFbcConverter()

Constructor.


Method variant with the following signature:
CobraToFbcConverter(CobraToFbcConverter)

Copy constructor.

def libsbml.FbcToCobraConverter.__init__ (   self,
  args 
)

fbc SBML Level 3 'fbc' to COBRA converter.

This method has multiple variants; they differ in the arguments they accept.

__init__()   FbcToCobraConverter
__init__(FbcToCobraConverter arg2)   FbcToCobraConverter

Each variant is described separately below.


Method variant with the following signature:
FbcToCobraConverter(FbcToCobraConverter)

Copy constructor.


Method variant with the following signature:
FbcToCobraConverter()

Constructor.

def libsbml.Association.__init__ (   self,
  args 
)

fbc Proposed representation of gene associations.

The Association class is currently not part of the official SBML Level 3 Flux Balance Constraints package specification; it is instead a proposed future development of the package. If adopted, the Association class would be a child of a GeneAssociation that would describe a single and or or relationship between two or more genes or other associations.

This method has multiple variants; they differ in the arguments they accept.

__init__(long level, long version, long pkgVersion)   Association
__init__(long level, long version)   Association
__init__(long level)   Association
__init__()   Association
__init__(XMLNode node, FbcPkgNamespaces fbcns)   Association
__init__(FbcPkgNamespaces fbcns)   Association
__init__(Association source)   Association

Each variant is described separately below.


Method variant with the following signature:
Association(XMLNode node, FbcPkgNamespaces fbcns)

Method variant with the following signature:
Association(FbcPkgNamespaces fbcns)

Creates a new Association with the given FbcPkgNamespaces object.


Method variant with the following signature:
Association(long level = FbcExtension.getDefaultLevel(), long version = FbcExtension.getDefaultVersion(), long pkgVersion = FbcExtension.getDefaultPackageVersion())

Creates a new Association objet with the given SBML Level, Version, and FBC package version.


Method variant with the following signature:
Association(Association source)

Copy constructor.

def libsbml.FluxBound.__init__ (   self,
  args 
)

fbc Max or min value for a reaction flux.

The FluxBound object holds a single (in)equality that provides the maximum or minimum value that a reaction flux can obtain at steady state.

This method has multiple variants; they differ in the arguments they accept.

__init__(long level, long version, long pkgVersion)   FluxBound
__init__(long level, long version)   FluxBound
__init__(long level)   FluxBound
__init__()   FluxBound
__init__(FbcPkgNamespaces fbcns)   FluxBound
__init__(FluxBound source)   FluxBound

Each variant is described separately below.


Method variant with the following signature:
FluxBound(FluxBound source)

Copy constructor.


Method variant with the following signature:
FluxBound(FbcPkgNamespaces fbcns)

Creates a new FluxBound with the given FbcPkgNamespaces object.


Method variant with the following signature:
FluxBound(long level = FbcExtension.getDefaultLevel(), long version = FbcExtension.getDefaultVersion(), long pkgVersion = FbcExtension.getDefaultPackageVersion())

Creates a new FluxBound with the given level, version, and package version.

def libsbml.FluxObjective.__init__ (   self,
  args 
)

fbc An objective function for a flux.

An integral component in a complete description of a steady-state model is the so-called objective function, which generally consists of a linear combination of model variables (fluxes) and a sense (direction). In the SBML Level 3 FBC package, this concept is succinctly captured in the Objective class.

This method has multiple variants; they differ in the arguments they accept.

__init__(long level, long version, long pkgVersion)   FluxObjective
__init__(long level, long version)   FluxObjective
__init__(long level)   FluxObjective
__init__()   FluxObjective
__init__(FbcPkgNamespaces fbcns)   FluxObjective
__init__(FluxObjective source)   FluxObjective

Each variant is described separately below.


Method variant with the following signature:
FluxObjective(FluxObjective source)

Copy constructor.


Method variant with the following signature:
FluxObjective(FbcPkgNamespaces fbcns)

Creates a new FluxObjective with the given FbcPkgNamespaces object.


Method variant with the following signature:
FluxObjective(long level = FbcExtension.getDefaultLevel(), long version = FbcExtension.getDefaultVersion(), long pkgVersion = FbcExtension.getDefaultPackageVersion())

Creates a new FluxObjective with the given level, version, and package version.

def libsbml.GeneAssociation.__init__ (   self,
  args 
)

fbc Proposed annotation for gene associations.

Gene associations are not part of the core FBC specification, but rather are a proposed annotation.

This method has multiple variants; they differ in the arguments they accept.

__init__(long level, long version, long pkgVersion)   GeneAssociation
__init__(long level, long version)   GeneAssociation
__init__(long level)   GeneAssociation
__init__()   GeneAssociation
__init__(XMLNode node, FbcPkgNamespaces fbcns)   GeneAssociation
__init__(FbcPkgNamespaces fbcns)   GeneAssociation
__init__(GeneAssociation source)   GeneAssociation

Each variant is described separately below.


Method variant with the following signature:
GeneAssociation(XMLNode node, FbcPkgNamespaces fbcns)

Creates a new GeneAssociation with the given node and FbcPkgNamespaces fbcns.


Method variant with the following signature:
GeneAssociation(FbcPkgNamespaces fbcns)

Creates a new GeneAssociation with the given FbcPkgNamespaces object.


Method variant with the following signature:
GeneAssociation(long level = FbcExtension.getDefaultLevel(), long version = FbcExtension.getDefaultVersion(), long pkgVersion = FbcExtension.getDefaultPackageVersion())

Creates a new GeneAssociation with the given level, version, and pkgVersion.


Method variant with the following signature:
GeneAssociation(GeneAssociation source)

Copy constructor.

def libsbml.Objective.__init__ (   self,
  args 
)

fbc An objective function.

An integral component in a complete description of a steady-state model is the so-called objective function, which generally consists of a linear combination of model variables (fluxes) and a sense (direction). In the SBML Level 3 FBC package, this concept is succinctly captured in the Objective class. The FBC Objective class is derived from the normal SBML SBase class and inherits the 'metaid' and 'sboTerm' attributes, as well as the subcomponents for Annotation and Notes.

This method has multiple variants; they differ in the arguments they accept.

__init__(long level, long version, long pkgVersion)   Objective
__init__(long level, long version)   Objective
__init__(long level)   Objective
__init__()   Objective
__init__(FbcPkgNamespaces fbcns)   Objective
__init__(Objective source)   Objective

Each variant is described separately below.


Method variant with the following signature:
Objective(Objective source)

Copy constructor.


Method variant with the following signature:
Objective(FbcPkgNamespaces fbcns)

Creates a new Objective with the given FbcPkgNamespaces object.


Method variant with the following signature:
Objective(long level = FbcExtension.getDefaultLevel(), long version = FbcExtension.getDefaultVersion(), long pkgVersion = FbcExtension.getDefaultPackageVersion())

Creates a new Objective with the given level, version, and package version.

def libsbml.ListOfFluxBounds.clone (   self)

fbc A list of FluxBound objects.

The ListOfFluxBounds is a container for the FluxBound elements of a Model.

The various ListOf___ classes in SBML are merely containers used for organizing the main components of an SBML model. In libSBML's implementation, ListOf___ classes are derived from the intermediate utility class ListOf, which is not defined by the SBML specifications but serves as a useful programmatic construct. ListOf is itself is in turn derived from SBase, which provides all of the various ListOf___ classes with common features defined by the SBML specification, such as 'metaid' attributes and annotations.

The relationship between the lists and the rest of an SBML model is illustrated by the following (for SBML Level 2 Version 4):

Readers may wonder about the motivations for using the ListOf___ containers in SBML. A simpler approach in XML might be to place the components all directly at the top level of the model definition. The choice made in SBML is to group them within XML elements named after ListOfClassname, in part because it helps organize the components. More importantly, the fact that the container classes are derived from SBase means that software tools can add information about the lists themselves into each list container's 'annotation'.

See also
ListOfFunctionDefinitions
ListOfUnitDefinitions
ListOfCompartmentTypes
ListOfSpeciesTypes
ListOfCompartments
ListOfSpecies
ListOfParameters
ListOfInitialAssignments
ListOfRules
ListOfConstraints
ListOfReactions
ListOfEvents

Creates and returns a deep copy of this ListOfFluxBounds.

clone()   ListOfFluxBounds
Returns
a (deep) copy of this ListOfFluxBounds.
def libsbml.ListOfFluxObjectives.clone (   self)

fbc A list of FluxObjectives.

The ListOfFluxObjectives is a container for the FluxObjective elements of a Model annotation.

The various ListOf___ classes in SBML are merely containers used for organizing the main components of an SBML model. In libSBML's implementation, ListOf___ classes are derived from the intermediate utility class ListOf, which is not defined by the SBML specifications but serves as a useful programmatic construct. ListOf is itself is in turn derived from SBase, which provides all of the various ListOf___ classes with common features defined by the SBML specification, such as 'metaid' attributes and annotations.

The relationship between the lists and the rest of an SBML model is illustrated by the following (for SBML Level 2 Version 4):

Readers may wonder about the motivations for using the ListOf___ containers in SBML. A simpler approach in XML might be to place the components all directly at the top level of the model definition. The choice made in SBML is to group them within XML elements named after ListOfClassname, in part because it helps organize the components. More importantly, the fact that the container classes are derived from SBase means that software tools can add information about the lists themselves into each list container's 'annotation'.

See also
ListOfFunctionDefinitions
ListOfUnitDefinitions
ListOfCompartmentTypes
ListOfSpeciesTypes
ListOfCompartments
ListOfSpecies
ListOfParameters
ListOfInitialAssignments
ListOfRules
ListOfConstraints
ListOfReactions
ListOfEvents
FluxObjective

Creates and returns a deep copy of this ListOfFluxObjectives.

clone()   ListOfFluxObjectives
Returns
a (deep) copy of this ListOfFluxObjectives.
def libsbml.ListOfGeneAssociations.clone (   self)

fbc A list of GeneAssociation objects.

The ListOfGeneAssociations is a container for the GeneAssociation elements of the proposed Model annotation, and is not part of the official FBC specification.

The various ListOf___ classes in SBML are merely containers used for organizing the main components of an SBML model. In libSBML's implementation, ListOf___ classes are derived from the intermediate utility class ListOf, which is not defined by the SBML specifications but serves as a useful programmatic construct. ListOf is itself is in turn derived from SBase, which provides all of the various ListOf___ classes with common features defined by the SBML specification, such as 'metaid' attributes and annotations.

The relationship between the lists and the rest of an SBML model is illustrated by the following (for SBML Level 2 Version 4):

Readers may wonder about the motivations for using the ListOf___ containers in SBML. A simpler approach in XML might be to place the components all directly at the top level of the model definition. The choice made in SBML is to group them within XML elements named after ListOfClassname, in part because it helps organize the components. More importantly, the fact that the container classes are derived from SBase means that software tools can add information about the lists themselves into each list container's 'annotation'.

See also
ListOfFunctionDefinitions
ListOfUnitDefinitions
ListOfCompartmentTypes
ListOfSpeciesTypes
ListOfCompartments
ListOfSpecies
ListOfParameters
ListOfInitialAssignments
ListOfRules
ListOfConstraints
ListOfReactions
ListOfEvents
GeneAssociation

Creates and returns a deep copy of this ListOfGeneAssociations.

clone()   ListOfGeneAssociations
Returns
a (deep) copy of this ListOfGeneAssociations.
def libsbml.ListOfObjectives.clone (   self)

fbc A list of Objective objects.

The ListOfObjectives is a container for the Objective elements of Model.

The various ListOf___ classes in SBML are merely containers used for organizing the main components of an SBML model. In libSBML's implementation, ListOf___ classes are derived from the intermediate utility class ListOf, which is not defined by the SBML specifications but serves as a useful programmatic construct. ListOf is itself is in turn derived from SBase, which provides all of the various ListOf___ classes with common features defined by the SBML specification, such as 'metaid' attributes and annotations.

The relationship between the lists and the rest of an SBML model is illustrated by the following (for SBML Level 2 Version 4):

Readers may wonder about the motivations for using the ListOf___ containers in SBML. A simpler approach in XML might be to place the components all directly at the top level of the model definition. The choice made in SBML is to group them within XML elements named after ListOfClassname, in part because it helps organize the components. More importantly, the fact that the container classes are derived from SBase means that software tools can add information about the lists themselves into each list container's 'annotation'.

See also
ListOfFunctionDefinitions
ListOfUnitDefinitions
ListOfCompartmentTypes
ListOfSpeciesTypes
ListOfCompartments
ListOfSpecies
ListOfParameters
ListOfInitialAssignments
ListOfRules
ListOfConstraints
ListOfReactions
ListOfEvents
Objective

Creates and returns a deep copy of this ListOfObjectives object.

clone()   ListOfObjectives
Returns
a (deep) copy of this ListOfObjectives.
def libsbml.FbcPkgNamespaces.clone (   self)

fbc SBMLNamespaces extension for the package.

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.

SBML Level 3 “packages” add features on top of SBML Level 3 Core. When a model definition uses an SBML package, it must declare the Level and Version of SBML Core and the Version of the package being used. The package name, the SBML Level and Version, and the package Version correspond uniquely to an XML namespace added to the XML encoding of the SBML model.

LibSBML Level 3 extensions are implementations of support for SBML Level 3 packages. Each package is implemented as a separate extension. To allow software applications to query the level and version information of an extension's package implementation, libSBML uses specialized object classes. For the extension implementing the SBML “fbc” package, the object class is FbcPkgNamespaces. (This class is a specialization of a common base class called SBMLExtensionNamespaces that is not exposed in the libSBML programming language interfaces other than C++.)

Objects of class FbcPkgNamespaces can be passed to constructors of SBML components defined by “fbc” in order to ensure that the correct component structure is created. This is necessary because different versions of an SBML Level 3 package may introduce differences in the definition of the components defined by the package. (For example, later editions of a package may introduce new attributes on a component that are not present in earlier editions of the package specification.)

See also
CompPkgNamespaces
LayoutPkgNamespaces
QualPkgNamespaces

Creates and returns a deep copy of this SBMLExtensionNamespaces.

clone()   FbcPkgNamespaces
Returns
a (deep) copy of this SBMLExtensionNamespaces.
def libsbml.FbcExtension.getPackageName ( )

fbc Base extension class for the package.

Returns the nickname of the SBML Level 3 package implemented by this libSBML extension.

getPackageName()   string
Returns
the package nickname, as a string.
Note
Because this is a static method on a class, the Python language interface for libSBML will contain two variants. One will be the expected, normal static method on the class (i.e., a regular methodName), and the other will be a standalone top-level function with the name ClassName_methodName(). This is merely an artifact of how the language interfaces are created in libSBML. The methods are functionally identical.