An SBML reaction between species in an SBML model.
A reaction represents any transformation, transport or binding process, typically a chemical reaction, that can change the quantity of one or more species. In SBML, a reaction is defined primarily in terms of the participating reactants and products (and their corresponding stoichiometries), along with optional modifier species, an optional rate at which the reaction takes place, and optional parameters.
As with other major objects in SBML, Reaction_t has a mandatory attribute, "id", used to give the reaction an identifier. The identifier must be a text string conforming to the identifer syntax permitted in SBML. In SBML Level 2 and Level 3, the reaction "id" identifier can be used in mathematical formulas elsewhere in an SBML model to represent the rate of that reaction; this usage is explained below. Reaction_t also has an optional "name" attribute, of type string
. The "id" and "name" must be used according to the guidelines described in the SBML specification.
The species participating as reactants, products, and/or modifiers in a reaction are declared using lists of SpeciesReference_t and/or ModifierSpeciesReference_t instances stored in subelements "listOfReactants", "listOfProducts" and "listOfModifiers". Certain restrictions are placed on the appearance of species in reaction definitions:
-
The ability of a species to appear as a reactant or product of any reaction in a model is governed by certain flags in that species' definition; see the definition of Species_t for more information.
-
Any species appearing in the mathematical formula of the subelement "kineticLaw" (described below) of a Reaction_t must be declared in at least one of that Reaction_t's lists of reactants, products, and/or modifiers. Put another way, it is an error for a reaction's kinetic law formula to refer to species that have not been declared for that reaction.
-
For SBML Levels 1, 2, and SBML Level 3 Version 1, a reaction definition can contain an empty list of reactants or an empty list of products, but it must have at least one reactant or product; in other words, a reaction without any reactant or product species is not permitted. (This restriction does not apply to modifier species, which remain optional in all cases.) In SBML Level 3 Version 2, this requirement was dropped, allowing the creation of reactions with neither reactants nor products.
A reaction can contain up to one KineticLaw_t object in a subelement named "kineticLaw". It defines the speed at which the process defined by the reaction takes place. The description of KineticLaw_t provides more details about its use. Note that although the inclusion of a KineticLaw_t object in an instance of a Reaction_t component is optional, there is no useful default that can be substituted in place of a missing rate expression in a reaction. Moreover, a reaction's rate cannot be defined in any other way in SBML—InitialAssignment_t, AssignmentRule_t, RateRule_t, AlgebraicRule_t, Event_t, and other constructs in SBML cannot be used to set the reaction rate separately. Nevertheless, for some modeling applications, reactions without any defined rate can be perfectly acceptable.
Reaction_t also has a boolean attribute named "reversible" for indicating whether the reaction is reversible. This attribute is optional in SBML Level 2, with a default of true
; it is mandatory in SBML Level 3 (with no default value). To say that a reaction is reversible is to say it can proceed in either the forward or the reverse direction. Although the reversibility of a reaction can sometimes be deduced by inspecting its rate expression, this is not always the case, especially for complicated expressions. Moreover, the need in SBML to allow rate expressions (i.e., KineticLaw_t) to be optional leads to the need for a separate flag indicating reversibility. Note that labeling a reaction as irreversible is an assertion that the reaction always proceeds in the given forward direction. (Why else would it be flagged as irreversible?) This implies the rate expression in the KineticLaw_t always has a non-negative value during simulations. Software tools could provide a means of optionally testing that this condition holds. The presence of reversibility information in two places (i.e., the rate expression and the "reversible" attribute on Reaction_t) leaves open the possibility that a model could contain contradictory information, but the creation of such a model would be an error on the part of the software generating it.
The Reaction_t object class has another boolean attribute called "fast". This attribute is optional in SBML Level 2, with a default of false
; it is mandatory in SBML Level 3 (with no default value). In SBML Level 3 Version 2, a value of true
for the "fast" attribute is deprecated in favor of all reactions having a "fast" value of false
. It is used to indicate that a reaction occurs on a vastly faster time scale than others in a system. Readers are directed to the SBML Level 2 Version 4 specification, which provides more detail about the conditions under which a reaction can be considered to be fast in this sense. SBML Level 1 and Level 2 Version 1 incorrectly claimed that software tools could ignore this attribute if they did not implement support for the corresponding concept; however, further research in SBML has revealed that this is not true, and "fast" cannot be ignored if it is set to true
. SBML Level 2 Versions 2–4 therefore stipulate that if a model has any reactions with "fast" set to true
, a software tool must be able to respect the attribute or else indicate to the user that it does not have the capacity to do so. Analysis software cannot ignore the value of the "fast" attribute because doing so may lead to different results as compared to a software system that does make use of "fast".
- In SBML Level 3 Version 2, the "fast" attribute was removed. All reactions are assumed to be equivalent to reactions in previous levels/versions that have a "fast" attribute value of
false
. Users should be aware that even for previous levels/versions of the specification, "fast" attribute values of true
never achieved widespread support, and many software packages may ignore it. To achieve the same or similar effects as setting the fast attribute to true
for a given reaction, the KineticLaw_t attribute should be constructed to produce a value in the desired time scale, or else the reaction could be replaced with an AssignmentRule_t or AlgebraicRule_t.
In SBML Level 3, the Reaction_t object has an additional optional attribute named "compartment", whose value must be the identifier of a compartment defined in the enclosing Model_t object. The "compartment" attribute can be used to indicate the compartment in which the reaction is assumed to take place. If the attribute is present, its value must be the identifier of a Compartment_t object defined in the enclosing Model_t object. Similar to the "reversible" attribute, the value of the "compartment" attribute has no direct impact on the construction of mathematical equations for the SBML model. When a kinetic law is given for a reaction, the compartment location may already be implicit in the kinetic law (although this cannot always be guaranteed). Nevertheless, software tools may find the "compartment" attribute value useful for such purposes as analyzing the structure of the model, guiding the modeler in constructing correct rate formulas, and visualization purposes.
Readers are urged to read the SBML specification for more details about the proper use of Reaction_t.
- Examples:
- addingEvidenceCodes_1.c, createExampleSBML.c, printAnnotation.c, printMath.c, printNotes.c, printUnits.c, spec_example1.c, unsetAnnotation.c, and unsetNotes.c.
|
int | Reaction_addModifier (Reaction_t *r, const SpeciesReference_t *msr) |
| Adds a copy of the given modifier (modifier SpeciesReference_t) to this Reaction_t. More...
|
|
int | Reaction_addModifierBySpecies (Reaction_t *r, const Species_t *s, const char *id) |
| Adds a copy of the given Species_t object as a modifier to this Reaction_t. More...
|
|
int | Reaction_addProduct (Reaction_t *r, const SpeciesReference_t *sr) |
| Adds a copy of the given product (SpeciesReference_t) to this Reaction_t. More...
|
|
int | Reaction_addProductBySpecies (Reaction_t *r, const Species_t *s, double stoichiometry, const char *id, int constant) |
| Adds a copy of the given Species_t object as a product to this Reaction_t. More...
|
|
int | Reaction_addReactant (Reaction_t *r, const SpeciesReference_t *sr) |
| Adds a copy of the given reactant (SpeciesReference_t) to this Reaction_t. More...
|
|
int | Reaction_addReactantBySpecies (Reaction_t *r, const Species_t *s, double stoichiometry, const char *id, int constant) |
| Adds a copy of the given Species_t object as a reactant to this Reaction_t. More...
|
|
Reaction_t * | Reaction_clone (const Reaction_t *r) |
|
Reaction_t * | Reaction_create (unsigned int level, unsigned int version) |
| Creates a new Reaction_t structure using the given SBML level and version values. More...
|
|
KineticLaw_t * | Reaction_createKineticLaw (Reaction_t *r) |
| Creates a new KineticLaw_t for this Reaction_t and returns it. More...
|
|
SpeciesReference_t * | Reaction_createModifier (Reaction_t *r) |
| Creates a new SpeciesReference_t, adds it to this Reaction_t's list of modifiers and returns it. More...
|
|
SpeciesReference_t * | Reaction_createProduct (Reaction_t *r) |
| Creates a new SpeciesReference_t, adds it to this Reaction_t's list of products and returns it. More...
|
|
SpeciesReference_t * | Reaction_createReactant (Reaction_t *r) |
| Creates a new SpeciesReference_t, adds it to this Reaction_t's list of reactants and returns it. More...
|
|
Reaction_t * | Reaction_createWithNS (SBMLNamespaces_t *sbmlns) |
| Creates a new Reaction_t structure using the given SBMLNamespaces_t structure. More...
|
|
void | Reaction_free (Reaction_t *r) |
| Frees the given Reaction_t. More...
|
|
const char * | Reaction_getCompartment (const Reaction_t *r) |
|
int | Reaction_getFast (const Reaction_t *r) |
|
const char * | Reaction_getId (const Reaction_t *r) |
|
KineticLaw_t * | Reaction_getKineticLaw (Reaction_t *r) |
|
ListOf_t * | Reaction_getListOfModifiers (Reaction_t *r) |
|
ListOf_t * | Reaction_getListOfProducts (Reaction_t *r) |
|
ListOf_t * | Reaction_getListOfReactants (Reaction_t *r) |
|
SpeciesReference_t * | Reaction_getModifier (Reaction_t *r, unsigned int n) |
|
SpeciesReference_t * | Reaction_getModifierBySpecies (Reaction_t *r, const char *species) |
|
const char * | Reaction_getName (const Reaction_t *r) |
|
const XMLNamespaces_t * | Reaction_getNamespaces (Reaction_t *r) |
| Returns a list of XMLNamespaces_t associated with this Reaction_t structure. More...
|
|
unsigned int | Reaction_getNumModifiers (const Reaction_t *r) |
|
unsigned int | Reaction_getNumProducts (const Reaction_t *r) |
|
unsigned int | Reaction_getNumReactants (const Reaction_t *r) |
|
SpeciesReference_t * | Reaction_getProduct (Reaction_t *r, unsigned int n) |
|
SpeciesReference_t * | Reaction_getProductBySpecies (Reaction_t *r, const char *species) |
|
SpeciesReference_t * | Reaction_getReactant (Reaction_t *r, unsigned int n) |
|
SpeciesReference_t * | Reaction_getReactantBySpecies (Reaction_t *r, const char *species) |
|
int | Reaction_getReversible (const Reaction_t *r) |
|
int | Reaction_hasRequiredAttributes (Reaction_t *r) |
| Predicate returning 1 (true) or 0 (false) depending on whether all the required attributes for this Reaction_t structure have been set. More...
|
|
void | Reaction_initDefaults (Reaction_t *r) |
| Initializes the fields of this Reaction_t to their defaults: More...
|
|
int | Reaction_isSetCompartment (const Reaction_t *r) |
|
int | Reaction_isSetFast (const Reaction_t *r) |
|
int | Reaction_isSetId (const Reaction_t *r) |
|
int | Reaction_isSetKineticLaw (const Reaction_t *r) |
|
int | Reaction_isSetName (const Reaction_t *r) |
|
int | Reaction_isSetReversible (const Reaction_t *r) |
|
SpeciesReference_t * | Reaction_removeModifier (Reaction_t *r, unsigned int n) |
| Removes the nth modifier SpeciesReference_t structure from this Reaction_t structure and returns a pointer to it. More...
|
|
SpeciesReference_t * | Reaction_removeModifierBySpecies (Reaction_t *r, const char *species) |
| Removes the modifier SpeciesReference_t structure with the given "species" attribute from this Reaction_t structure and returns a pointer to it. More...
|
|
SpeciesReference_t * | Reaction_removeProduct (Reaction_t *r, unsigned int n) |
| Removes the nth product SpeciesReference_t structure from this Reaction_t structure and returns a pointer to it. More...
|
|
SpeciesReference_t * | Reaction_removeProductBySpecies (Reaction_t *r, const char *species) |
| Removes the product SpeciesReference_t structure with the given "species" attribute from this Reaction_t structure and returns a pointer to it. More...
|
|
SpeciesReference_t * | Reaction_removeReactant (Reaction_t *r, unsigned int n) |
| Removes the nth reactant SpeciesReference_t structure from this Reaction_t structure and returns a pointer to it. More...
|
|
SpeciesReference_t * | Reaction_removeReactantBySpecies (Reaction_t *r, const char *species) |
| Removes the reactant SpeciesReference_t structure with the given "species" attribute from this Reaction_t structure and returns a pointer to it. More...
|
|
int | Reaction_setCompartment (Reaction_t *r, const char *compartment) |
| Sets the compartment of this Reaction_t to a copy of compartment. More...
|
|
int | Reaction_setFast (Reaction_t *r, int value) |
| Sets the fast status of this Reaction_t to value (boolean). More...
|
|
int | Reaction_setId (Reaction_t *r, const char *sid) |
| Sets the id of this Reaction_t to a copy of sid . More...
|
|
int | Reaction_setKineticLaw (Reaction_t *r, const KineticLaw_t *kl) |
| Sets the KineticLaw_t of this Reaction_t to a copy of the given KineticLaw_t. More...
|
|
int | Reaction_setName (Reaction_t *r, const char *name) |
| Sets the name of this Reaction_t to a copy of name. More...
|
|
int | Reaction_setReversible (Reaction_t *r, int value) |
| Sets the reversible status of this Reaction_t to value (boolean). More...
|
|
int | Reaction_unsetCompartment (Reaction_t *r) |
| Unsets the compartment of this Reaction_t. More...
|
|
int | Reaction_unsetFast (Reaction_t *r) |
| Unsets the fast status of this Reation_t. More...
|
|
int | Reaction_unsetKineticLaw (Reaction_t *r) |
| Unsets the KineticLaw_t of this Reaction_t. More...
|
|
int | Reaction_unsetName (Reaction_t *r) |
| Unsets the name of this Reaction_t. More...
|
|
int | Reaction_unsetReversible (Reaction_t *r) |
| Unsets the reversible status of this Reaction_t. More...
|
|