libSBML C API  5.18.0
FbcModelPlugin_t Class Reference

Detailed Description

fbc Extension of Model_t.

The FbcModelPlugin_t object is used to extend the standard SBML Model_t object with features used in the SBML Level 3 Flux Balance Constraints (“fbc”) package. In Version 1 of the “fbc” specification, the extended Model_t class has two optional subobjects: ListOfObjectives_t and ListOfFluxBounds_t. In Version 2 of the specification, the extended Model_t object is defined differently: it is extended with a new required attribute named "strict", and the two optional subobjects ListOfObjectives_t and ListOfGeneProducts_t. (ListOfFluxBounds_t is not used in Version 2.)

The "strict" attribute on the (extended) Model_t class

The mandatory attribute "strict", of type boolean, in Version 2 of this package, is used to apply an additional set of restrictions to the model. The "strict" attribute helps ensure that the Flux Balance Constraints package can be used to encode legacy flux-balance analysis models expressible as Linear Programs (LP's) for software that is unable to analyze arbitrary mathematical expressions that may appear in an SBML model. In addition, a "strict" model is fully described and mathematically consistent, for example, by ensuring that all fluxes have a valid upper or lower bound.

The following restrictions are in effect if an “fbc” model object has a value of "true" for the attribute "strict" on Model_t:

  • Each Reaction_t in a Model_t must define values for the attributes "lowerFluxBound" and "upperFluxBound", with each attribute pointing to a valid Parameter_t object defined in the current Model_t.
  • Each Parameter_t object referred to by the Reaction_t attributes "lowerFluxBound" and "upperFluxBound" must have its "constant" attribute set to the value "true" and its "value" attribute set to a value of type double. This value may not be "NaN".
  • SpeciesReference_t objects in Reaction_t objects must have their "stoichiometry" attribute set to a double value that is not "NaN", nor "-INF", nor "INF". In addition, the value of their "constant" attribute must be set to "true".
  • All defined FluxObjective_t objects must have their coefficient attribute set to a double value that is not "NaN", nor "-INF", nor "INF".
  • A Reaction_t "lowerFluxBound" attribute may not point to a Parameter_t object that has a value of "INF".
  • A Reaction_t "upperFluxBound" attribute may not point to a Parameter_t object that has a value of "-INF".
  • For all Reaction_t objects, the value of a "lowerFluxBound" attribute must be less than or equal to the value of the "upperFluxBound" attribute.

While it is not compulsory for a "strict" Flux Balance Constraints model to define an Objective_t, doing so does does allow the model to be formulated as a Linear Program and optimized. However, this decision is left to the modeler. Note that all other properties of the objects referred to in the list above are to be set as specified in the relevant SBML Level 3 Version 1 Core and Flux Balance Constraints (“fbc”) specifications.

Alternatively, if the value of the strict attribute is "false", then none of these restrictions apply and the model creator can choose to define “fbc” models that are not necessarily encodable as an LP. For example, if strict is "false", the InitialAssignment_t construct may be used to set any valid numerical entity, including Parameter_t values and stoichiometric coefficients, with any value of type double. In addition, Parameter_t elements are no longer required to be flagged as constant, thus allowing for a Flux Balance Constraints model's use in alternative, hybrid modeling strategies.

Lists of subobjects on the (extended) Model_t class

The ListOfObjectives_t is used to define the objectives of a given “fbc” model. Objectives generally consist of linear combinations of model variables (fluxes) and a direction for the optimality constraint (either maximization or minimization). Each Objective_t has a ListOfFluxObjectives_t subobjects.

In Version 2 of “fbc”, the ListOfGeneProducts_t is used to define the gene products represented by the “fbc” model.

In Version 1 of “fbc”, there is no ListOfGeneProducts_t, and instead, Model_t can have an optional ListOfFluxBounds_t.

See also
Objective_t
FluxObjective_t
FluxBound_t

Public Member Functions

int FbcModelPlugin_addFluxBound (SBasePlugin_t *fmp, FluxBound_t *fb)
 Appends a copy of the given FluxBound_t structure to the given FbcModelPlugin_t structure. More...
 
int FbcModelPlugin_addGeneProduct (SBasePlugin_t *fmp, GeneProduct_t *fb)
 Appends a copy of the given GeneProduct_t structure to the given FbcModelPlugin_t structure. More...
 
int FbcModelPlugin_addObjective (SBasePlugin_t *fmp, Objective_t *obj)
 Appends a copy of the given Objective_t structure to the given FbcModelPlugin_t structure. More...
 
char * FbcModelPlugin_getActiveObjectiveId (SBasePlugin_t *fmp)
 Takes a FbcModelPlugin_t structure and returns the id of the current activeObjective. More...
 
FluxBound_tFbcModelPlugin_getFluxBound (SBasePlugin_t *fmp, unsigned int n)
 Return a specific FluxBound_t structure of the given FbcModelPlugin_t. More...
 
GeneProduct_tFbcModelPlugin_getGeneProduct (SBasePlugin_t *fmp, unsigned int n)
 Return a specific GeneProduct_t structure of the given FbcModelPlugin_t. More...
 
unsigned int FbcModelPlugin_getNumFluxBounds (SBasePlugin_t *fmp)
 Returns the number of FluxBound_t structures attached to the given FbcModelPlugin_t. More...
 
unsigned int FbcModelPlugin_getNumGeneProducts (SBasePlugin_t *fmp)
 Returns the number of GeneProduct_t structures attached to the given FbcModelPlugin_t. More...
 
unsigned int FbcModelPlugin_getNumObjectives (SBasePlugin_t *fmp)
 Returns the number of Objective_t structures attached to the given FbcModelPlugin_t. More...
 
Objective_tFbcModelPlugin_getObjective (SBasePlugin_t *fmp, unsigned int n)
 Return a specific Objective_t structure of the given FbcModelPlugin_t. More...
 
int FbcModelPlugin_getStrict (SBasePlugin_t *fmp)
 Takes a FbcModelPlugin_t structure and returns the value of the strict attribute. More...
 
int FbcModelPlugin_setActiveObjectiveId (SBasePlugin_t *fmp, const char *activeObjective)
 Sets the activeObjective of the given FbcModelPlugin_t to a copy of activeObjective. More...
 
int FbcModelPlugin_setStrict (SBasePlugin_t *fmp, int strict)
 Sets the strict attribute of the given FbcModelPlugin_t. More...
 

Member Function Documentation

int FbcModelPlugin_addFluxBound ( SBasePlugin_t fmp,
FluxBound_t fb 
)

Appends a copy of the given FluxBound_t structure to the given FbcModelPlugin_t structure.

Parameters
fmpthe FbcModelPlugin_t structure to which the FluxBound_t should be added.
fba FluxBound_t structure to add.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int FbcModelPlugin_addGeneProduct ( SBasePlugin_t fmp,
GeneProduct_t fb 
)

Appends a copy of the given GeneProduct_t structure to the given FbcModelPlugin_t structure.

Parameters
fmpthe FbcModelPlugin_t structure to which the GeneProduct_t should be added.
fba GeneProduct_t structure to add.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int FbcModelPlugin_addObjective ( SBasePlugin_t fmp,
Objective_t obj 
)

Appends a copy of the given Objective_t structure to the given FbcModelPlugin_t structure.

Parameters
fmpthe FbcModelPlugin_t structure to which the Objective_t should be added.
objan Objective_t structure to add.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
char * FbcModelPlugin_getActiveObjectiveId ( SBasePlugin_t fmp)

Takes a FbcModelPlugin_t structure and returns the id of the current activeObjective.

Parameters
fmpthe FbcModelPlugin_t whose id of the current activeObjective is sought.
Returns
the id of the current activeObjective of the given FbcModelPlugin_t, as a pointer to a string.
FluxBound_t * FbcModelPlugin_getFluxBound ( SBasePlugin_t fmp,
unsigned int  n 
)

Return a specific FluxBound_t structure of the given FbcModelPlugin_t.

Parameters
fmpthe FbcModelPlugin_t structure to use.
nan integer, the index of the FluxBound_t structure to return.
Returns
the nth FluxBound_t of the given FbcModelPlugin_t, or NULL if no such FluxBound_t exists.
GeneProduct_t * FbcModelPlugin_getGeneProduct ( SBasePlugin_t fmp,
unsigned int  n 
)

Return a specific GeneProduct_t structure of the given FbcModelPlugin_t.

Parameters
fmpthe FbcModelPlugin_t structure to use.
nan integer, the index of the GeneProduct_t structure to return.
Returns
the nth GeneProduct_t of the given FbcModelPlugin_t, or NULL if no such GeneProduct_t exists.
unsigned int FbcModelPlugin_getNumFluxBounds ( SBasePlugin_t fmp)

Returns the number of FluxBound_t structures attached to the given FbcModelPlugin_t.

Parameters
fmpthe FbcModelPlugin_t structure to use.
Returns
the number of FluxBound_t structures in the given FbcModelPlugin_t.
unsigned int FbcModelPlugin_getNumGeneProducts ( SBasePlugin_t fmp)

Returns the number of GeneProduct_t structures attached to the given FbcModelPlugin_t.

Parameters
fmpthe GeneProduct_t structure to use.
Returns
the number of EventAssignment_t structures in the given FbcModelPlugin_t.
unsigned int FbcModelPlugin_getNumObjectives ( SBasePlugin_t fmp)

Returns the number of Objective_t structures attached to the given FbcModelPlugin_t.

Parameters
fmpthe FbcModelPlugin_t structure to use.
Returns
the number of Objective_t structures in the given FbcModelPlugin_t.
Objective_t * FbcModelPlugin_getObjective ( SBasePlugin_t fmp,
unsigned int  n 
)

Return a specific Objective_t structure of the given FbcModelPlugin_t.

Parameters
fmpthe FbcModelPlugin_t structure to use.
nan integer, the index of the Objective_t structure to return.
Returns
the nth Objective_t of the given FbcModelPlugin_t, or NULL if no such Objective_t exists.
int FbcModelPlugin_getStrict ( SBasePlugin_t fmp)

Takes a FbcModelPlugin_t structure and returns the value of the strict attribute.

Note
The 'strict' attribute of the FbcModelPlugin_t is only defined for version 2 of the "Flux Balance Constraints" specification, and has no equivalent in version 1 of the specification.
Parameters
fmpthe FbcModelPlugin_t whose 'strict' attribute is sought.
Returns
the id of the current activeObjective of the given FbcModelPlugin_t, as a pointer to a string.
int FbcModelPlugin_setActiveObjectiveId ( SBasePlugin_t fmp,
const char *  activeObjective 
)

Sets the activeObjective of the given FbcModelPlugin_t to a copy of activeObjective.

Parameters
fmpthe FbcModelPlugin_t structure to set.
activeObjectivethe activeObjective to assign to the given FbcModelPlugin_t's "activeObjective" attribute.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
Note
Using this function with the name set to NULL is equivalent to unsetting the "activeObjective" attribute.
int FbcModelPlugin_setStrict ( SBasePlugin_t fmp,
int  strict 
)

Sets the strict attribute of the given FbcModelPlugin_t.

Note
The 'strict' attribute of the FbcModelPlugin_t is only defined for version 2 of the "Flux Balance Constraints" specification, and has no equivalent in version 1 of the specification.
Parameters
fmpthe FbcModelPlugin_t structure to set.
strictbool value of the "strict" attribute to be set, with 0 indicating 'false', and all other values indicating 'true'.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are: