libSBML C API  libSBML 5.8.0 C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Reaction.h File Reference

Detailed Description

Definitions of Reaction and ListOfReactions.

Author
Ben Bornstein
Include dependency graph for Reaction.h:
This graph shows which files directly or indirectly include this file:

Functions

Reaction_t * ListOfReactions_getById (ListOf_t *lo, const char *sid)
 
Reaction_t * ListOfReactions_removeById (ListOf_t *lo, const char *sid)
 Removes item in this ListOf items with the given id or NULL if no such item exists. More...
 
int Reaction_addModifier (Reaction_t *r, const SpeciesReference_t *msr)
 Adds a copy of the given modifier (ModifierSpeciesReference) to this Reaction. More...
 
int Reaction_addProduct (Reaction_t *r, const SpeciesReference_t *sr)
 Adds a copy of the given product (SpeciesReference) to this Reaction. More...
 
int Reaction_addReactant (Reaction_t *r, const SpeciesReference_t *sr)
 Adds a copy of the given reactant (SpeciesReference) to this Reaction. 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 for this Reaction and returns it. More...
 
SpeciesReference_t * Reaction_createModifier (Reaction_t *r)
 Creates a new SpeciesReference, adds it to this Reaction's list of modifiers and returns it. More...
 
SpeciesReference_t * Reaction_createProduct (Reaction_t *r)
 Creates a new SpeciesReference, adds it to this Reaction's list of products and returns it. More...
 
SpeciesReference_t * Reaction_createReactant (Reaction_t *r)
 Creates a new SpeciesReference, adds it to this Reaction'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. 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 *c)
 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 *p)
 Predicate returning true or false depending on whether all the required attributes for this Reaction object have been set. More...
 
void Reaction_initDefaults (Reaction_t *r)
 Initializes the fields of this Reaction 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 object from this Reaction_t object and returns a pointer to it. More...
 
SpeciesReference_t * Reaction_removeModifierBySpecies (Reaction_t *r, const char *species)
 Removes the modifier SpeciesReference_t object with the given "species" attribute from this Reaction_t object and returns a pointer to it. More...
 
SpeciesReference_t * Reaction_removeProduct (Reaction_t *r, unsigned int n)
 Removes the nth product SpeciesReference_t object from this Reaction_t object and returns a pointer to it. More...
 
SpeciesReference_t * Reaction_removeProductBySpecies (Reaction_t *r, const char *species)
 Removes the product SpeciesReference_t object with the given "species" attribute from this Reaction_t object and returns a pointer to it. More...
 
SpeciesReference_t * Reaction_removeReactant (Reaction_t *r, unsigned int n)
 Removes the nth reactant SpeciesReference_t object from this Reaction_t object and returns a pointer to it. More...
 
SpeciesReference_t * Reaction_removeReactantBySpecies (Reaction_t *r, const char *species)
 Removes the reactant SpeciesReference_t object with the given "species" attribute from this Reaction_t object and returns a pointer to it. More...
 
int Reaction_setCompartment (Reaction_t *r, const char *compartment)
 Sets the compartment of this Reaction to a copy of compartment. More...
 
int Reaction_setFast (Reaction_t *r, int value)
 Sets the fast status of this Reaction to value (boolean). More...
 
int Reaction_setId (Reaction_t *r, const char *sid)
 Sets the id of this Reaction to a copy of sid. More...
 
int Reaction_setKineticLaw (Reaction_t *r, const KineticLaw_t *kl)
 Sets the KineticLaw of this Reaction to a copy of the given KineticLaw. More...
 
int Reaction_setName (Reaction_t *r, const char *name)
 Sets the name of this Reaction to a copy of name. More...
 
int Reaction_setReversible (Reaction_t *r, int value)
 Sets the reversible status of this Reaction to value (boolean). More...
 
int Reaction_unsetCompartment (Reaction_t *r)
 Unsets the compartment of this Reaction. More...
 
int Reaction_unsetFast (Reaction_t *r)
 Unsets the fast status of this Reation. More...
 
int Reaction_unsetKineticLaw (Reaction_t *r)
 Unsets the KineticLaw of this Reaction. More...
 
int Reaction_unsetName (Reaction_t *r)
 Unsets the name of this Reaction. More...
 

Function Documentation

Reaction_t* ListOfReactions_getById ( ListOf_t *  lo,
const char *  sid 
)
Returns
item in this ListOfReaction with the given id or NULL if no such item exists.
Reaction_t* ListOfReactions_removeById ( ListOf_t *  lo,
const char *  sid 
)

Removes item in this ListOf items with the given id or NULL if no such item exists.

The caller owns the returned item and is responsible for deleting it.

int Reaction_addModifier ( Reaction_t *  r,
const SpeciesReference_t *  msr 
)

Adds a copy of the given modifier (ModifierSpeciesReference) to this Reaction.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_UNEXPECTED_ATTRIBUTE
  • LIBSBML_LEVEL_MISMATCH
  • LIBSBML_VERSION_MISMATCH
  • LIBSBML_OPERATION_FAILED
int Reaction_addProduct ( Reaction_t *  r,
const SpeciesReference_t *  sr 
)

Adds a copy of the given product (SpeciesReference) to this Reaction.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_LEVEL_MISMATCH
  • LIBSBML_VERSION_MISMATCH
  • LIBSBML_OPERATION_FAILED
int Reaction_addReactant ( Reaction_t *  r,
const SpeciesReference_t *  sr 
)

Adds a copy of the given reactant (SpeciesReference) to this Reaction.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_LEVEL_MISMATCH
  • LIBSBML_VERSION_MISMATCH
  • LIBSBML_OPERATION_FAILED
Reaction_t* Reaction_clone ( const Reaction_t *  r)
Returns
a (deep) copy of this Reaction.
Reaction_t* Reaction_create ( unsigned int  level,
unsigned int  version 
)

Creates a new Reaction_t structure using the given SBML level and version values.

Parameters
levelan unsigned int, the SBML Level to assign to this Reaction
versionan unsigned int, the SBML Version to assign to this Reaction
Returns
a pointer to the newly created Reaction_t structure.
Note
Once a Reaction has been added to an SBMLDocument, the level and version for the document override those used to create the Reaction. Despite this, the ability to supply the values at creation time is an important aid to creating valid SBML. Knowledge of the intended SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument.
KineticLaw_t* Reaction_createKineticLaw ( Reaction_t *  r)

Creates a new KineticLaw for this Reaction and returns it.

If this Reaction had a previous KineticLaw, it will be destroyed.

SpeciesReference_t* Reaction_createModifier ( Reaction_t *  r)

Creates a new SpeciesReference, adds it to this Reaction's list of modifiers and returns it.

SpeciesReference_t* Reaction_createProduct ( Reaction_t *  r)

Creates a new SpeciesReference, adds it to this Reaction's list of products and returns it.

SpeciesReference_t* Reaction_createReactant ( Reaction_t *  r)

Creates a new SpeciesReference, adds it to this Reaction's list of reactants and returns it.

Reaction_t* Reaction_createWithNS ( SBMLNamespaces_t *  sbmlns)

Creates a new Reaction_t structure using the given SBMLNamespaces_t structure.

Parameters
sbmlnsSBMLNamespaces, a pointer to an SBMLNamespaces structure to assign to this Reaction
Returns
a pointer to the newly created Reaction_t structure.
Note
Once a Reaction has been added to an SBMLDocument, the sbmlns namespaces for the document override those used to create the Reaction. Despite this, the ability to supply the values at creation time is an important aid to creating valid SBML. Knowledge of the intended SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument.
void Reaction_free ( Reaction_t *  r)

Frees the given Reaction.

const char* Reaction_getCompartment ( const Reaction_t *  r)
Returns
the compartment of this Reaction.
int Reaction_getFast ( const Reaction_t *  r)
Returns
the fast status of this Reaction.
const char* Reaction_getId ( const Reaction_t *  r)
Returns
the id of this Reaction.
KineticLaw_t* Reaction_getKineticLaw ( Reaction_t *  r)
Returns
the KineticLaw of this Reaction.
ListOf_t* Reaction_getListOfModifiers ( Reaction_t *  r)
Returns
the list of Modifiers for this Reaction.
ListOf_t* Reaction_getListOfProducts ( Reaction_t *  r)
Returns
the list of Products for this Reaction.
ListOf_t* Reaction_getListOfReactants ( Reaction_t *  r)
Returns
the list of Reactants for this Reaction.
SpeciesReference_t* Reaction_getModifier ( Reaction_t *  r,
unsigned int  n 
)
Returns
the nth modifier (ModifierSpeciesReference) of this Reaction.
SpeciesReference_t* Reaction_getModifierBySpecies ( Reaction_t *  r,
const char *  species 
)
Returns
the modifier (ModifierSpeciesReference) in this Reaction with the given species or NULL if no such modifier exists.
const char* Reaction_getName ( const Reaction_t *  r)
Returns
the name of this Reaction.
const XMLNamespaces_t* Reaction_getNamespaces ( Reaction_t *  r)

Returns a list of XMLNamespaces_t associated with this Reaction_t structure.

Parameters
rthe Reaction_t structure
Returns
pointer to the XMLNamespaces_t structure associated with this SBML object
unsigned int Reaction_getNumModifiers ( const Reaction_t *  r)
Returns
the number of modifiers (ModifierSpeciesReferences) in this Reaction.
unsigned int Reaction_getNumProducts ( const Reaction_t *  r)
Returns
the number of products (SpeciesReferences) in this Reaction.
unsigned int Reaction_getNumReactants ( const Reaction_t *  r)
Returns
the number of reactants (SpeciesReferences) in this Reaction.
SpeciesReference_t* Reaction_getProduct ( Reaction_t *  r,
unsigned int  n 
)
Returns
the nth product (SpeciesReference) of this Reaction.
SpeciesReference_t* Reaction_getProductBySpecies ( Reaction_t *  r,
const char *  species 
)
Returns
the product (SpeciesReference) in this Reaction with the given species or NULL if no such product exists.
SpeciesReference_t* Reaction_getReactant ( Reaction_t *  r,
unsigned int  n 
)
Returns
the nth reactant (SpeciesReference) of this Reaction.
SpeciesReference_t* Reaction_getReactantBySpecies ( Reaction_t *  r,
const char *  species 
)
Returns
the reactant (SpeciesReference) in this Reaction with the given species or NULL if no such reactant exists.
int Reaction_getReversible ( const Reaction_t *  r)
Returns
the reversible status of this Reaction.
int Reaction_hasRequiredAttributes ( Reaction_t *  r)

Predicate returning true or false depending on whether all the required attributes for this Reaction object have been set.

Parameters
rthe Reaction_t structure to check.
Note
The required attributes for a Reaction object are:
  • id (name in L1)
  • fast (in L3 only)
  • reversible (in L3 only)
Returns
a true if all the required attributes for this object have been defined, false otherwise.
void Reaction_initDefaults ( Reaction_t *  r)

Initializes the fields of this Reaction to their defaults:

  • reversible = 1 (true)
  • fast = 0 (false) (L1 only)
int Reaction_isSetCompartment ( const Reaction_t *  r)
Returns
true (non-zero) if the KineticLaw of this Reaction is set, false (0) otherwise.
int Reaction_isSetFast ( const Reaction_t *  r)
Returns
true (non-zero) if the fast status of this Reaction is set, false (0) otherwise.

In L1, fast is optional with a default of false, which means it is effectively always set. In L2, however, fast is optional with no default value, so it may or may not be set to a specific value.

int Reaction_isSetId ( const Reaction_t *  r)
Returns
true (non-zero) if the id of this Reaction is set, false (0) otherwise.
int Reaction_isSetKineticLaw ( const Reaction_t *  r)
Returns
true (non-zero) if the KineticLaw of this Reaction is set, false (0) otherwise.
int Reaction_isSetName ( const Reaction_t *  r)
Returns
true (non-zero) if the name of this Reaction is set, false (0) otherwise.
int Reaction_isSetReversible ( const Reaction_t *  r)
Returns
true (non-zero) if the reversible attribute of this Reaction is set, false (0) otherwise.
SpeciesReference_t* Reaction_removeModifier ( Reaction_t *  r,
unsigned int  n 
)

Removes the nth modifier SpeciesReference_t object from this Reaction_t object and returns a pointer to it.

The caller owns the returned object and is responsible for deleting it.

Parameters
rthe Reaction_t structure
nthe integer index of the modifier SpeciesReference_t to remove
Returns
the modifier SpeciesReference_t object removed. As mentioned above, the caller owns the returned object. NULL is returned if the given index is out of range.
SpeciesReference_t* Reaction_removeModifierBySpecies ( Reaction_t *  r,
const char *  species 
)

Removes the modifier SpeciesReference_t object with the given "species" attribute from this Reaction_t object and returns a pointer to it.

The caller owns the returned object and is responsible for deleting it.

Parameters
rthe Reaction_t structure
speciesthe "species" attribute of the modifier SpeciesReference_t to remove
Returns
the modifier SpeciesReference_t object removed. As mentioned above, the caller owns the returned object. NULL is returned if no modifier SpeciesReference_t object with the "species" attribute exists in this Reaction.
SpeciesReference_t* Reaction_removeProduct ( Reaction_t *  r,
unsigned int  n 
)

Removes the nth product SpeciesReference_t object from this Reaction_t object and returns a pointer to it.

The caller owns the returned object and is responsible for deleting it.

Parameters
rthe Reaction_t structure
nthe integer index of the product SpeciesReference_t to remove
Returns
the product SpeciesReference_t object removed. As mentioned above, the caller owns the returned object. NULL is returned if the given index is out of range.
SpeciesReference_t* Reaction_removeProductBySpecies ( Reaction_t *  r,
const char *  species 
)

Removes the product SpeciesReference_t object with the given "species" attribute from this Reaction_t object and returns a pointer to it.

The caller owns the returned object and is responsible for deleting it.

Parameters
rthe Reaction_t structure
speciesthe "species" attribute of the product SpeciesReference_t to remove
Returns
the product SpeciesReference_t object removed. As mentioned above, the caller owns the returned object. NULL is returned if no product SpeciesReference_t object with the "species" attribute exists in this Reaction.
SpeciesReference_t* Reaction_removeReactant ( Reaction_t *  r,
unsigned int  n 
)

Removes the nth reactant SpeciesReference_t object from this Reaction_t object and returns a pointer to it.

The caller owns the returned object and is responsible for deleting it.

Parameters
rthe Reaction_t structure
nthe integer index of the reactant SpeciesReference_t to remove
Returns
the reactant SpeciesReference_t object removed. As mentioned above, the caller owns the returned object. NULL is returned if the given index is out of range.
SpeciesReference_t* Reaction_removeReactantBySpecies ( Reaction_t *  r,
const char *  species 
)

Removes the reactant SpeciesReference_t object with the given "species" attribute from this Reaction_t object and returns a pointer to it.

The caller owns the returned object and is responsible for deleting it.

Parameters
rthe Reaction_t structure
speciesthe "species" attribute of the reactant SpeciesReference_t to remove
Returns
the reactant SpeciesReference_t object removed. As mentioned above, the caller owns the returned object. NULL is returned if no reactant SpeciesReference_t object with the "species" attribute exists in this Reaction.
int Reaction_setCompartment ( Reaction_t *  r,
const char *  compartment 
)

Sets the compartment of this Reaction to a copy of compartment.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_UNEXPECTED_ATTRIBUTE
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
Note
Using this function with the compartment set to NULL is equivalent to unsetting the "compartment" attribute.
int Reaction_setFast ( Reaction_t *  r,
int  value 
)

Sets the fast status of this Reaction to value (boolean).

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
int Reaction_setId ( Reaction_t *  r,
const char *  sid 
)

Sets the id of this Reaction to a copy of sid.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
Note
Using this function with an id of NULL is equivalent to unsetting the "id" attribute.
int Reaction_setKineticLaw ( Reaction_t *  r,
const KineticLaw_t *  kl 
)

Sets the KineticLaw of this Reaction to a copy of the given KineticLaw.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_LEVEL_MISMATCH
  • LIBSBML_VERSION_MISMATCH
int Reaction_setName ( Reaction_t *  r,
const char *  name 
)

Sets the name of this Reaction to a copy of name.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
Note
Using this function with the name set to NULL is equivalent to unsetting the "name" attribute.
int Reaction_setReversible ( Reaction_t *  r,
int  value 
)

Sets the reversible status of this Reaction to value (boolean).

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
int Reaction_unsetCompartment ( Reaction_t *  r)

Unsets the compartment of this Reaction.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_UNEXPECTED_ATTRIBUTE
  • LIBSBML_OPERATION_FAILED
int Reaction_unsetFast ( Reaction_t *  r)

Unsets the fast status of this Reation.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
In L1, fast is optional with a default of false, which means it is effectively always set. In L2, however, fast is optional with no default value, so it may or may not be set to a specific value.
int Reaction_unsetKineticLaw ( Reaction_t *  r)

Unsets the KineticLaw of this Reaction.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
int Reaction_unsetName ( Reaction_t *  r)

Unsets the name of this Reaction.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED