public class Reaction extends SBase
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
has a mandatory attribute,
'id', used to give the compartment type 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
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
and/or
ModifierSpeciesReference
instances stored in subelements
'listOfReactants', 'listOfProducts' and 'listOfModifiers'. Certain
restrictions are placed on the appearance of species in reaction
definitions:
Species
for more information.
Reaction
must be declared in at
least one of that Reaction
'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.
A reaction can contain up to one KineticLaw
object in a subelement named
'kineticLaw'. It defines the speed at which the process defined by the
reaction takes place. The description of KineticLaw
provides more
details about its use. Note that although the inclusion of a KineticLaw
object in an instance of a Reaction
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&mdashInitialAssignment
, AssignmentRule
,
RateRule
, AlgebraicRule
, Event
, 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
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
) 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
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
) 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
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). It
is used to indicate that a reaction occurs on a vastly faster time scale
thanothers 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. The attribute's default value is false.
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&ndash4 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 1, the Reaction
object has an
additional optional attribute named 'compartment', whose value must be
the identifier of a compartment defined in the enclosing Model
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
object
defined in the enclosing Model
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
.
Constructor and Description |
---|
Reaction(long level,
long version)
|
Reaction(Reaction orig)
Copy constructor creates a copy of this
Reaction . |
Reaction(SBMLNamespaces sbmlns)
|
Modifier and Type | Method and Description |
---|---|
int |
addModifier(ModifierSpeciesReference msr)
Adds a given
ModifierSpeciesReference object as a product in this
Reaction . |
int |
addProduct(SpeciesReference sr)
Adds a given
SpeciesReference object as a product in this Reaction . |
int |
addReactant(SpeciesReference sr)
Adds a given
SpeciesReference object as a reactant in this Reaction . |
Reaction |
cloneObject()
Creates and returns a deep copy of this
Reaction . |
KineticLaw |
createKineticLaw()
Creates a new
KineticLaw object, installs it as this Reaction 's
'kineticLaw' subelement, and returns it. |
ModifierSpeciesReference |
createModifier()
Creates a new
ModifierSpeciesReference , adds it to this Reaction 's
list of modifiers and returns it. |
SpeciesReference |
createProduct()
Creates a new
SpeciesReference , adds it to this Reaction 's list of
products, and returns it. |
SpeciesReference |
createReactant()
Creates a new
SpeciesReference , adds it to this Reaction 's list of
reactants, and returns it. |
void |
delete()
Explicitly deletes the underlying native object.
|
java.lang.String |
getCompartment()
(SBML Level 3 only) Returns the value of the 'compartment'
attribute on the
Reaction . |
SBase |
getElementByMetaId(java.lang.String metaid)
Returns the first child element it can find with the given
metaid , or
null if no such object is found. |
SBase |
getElementBySId(java.lang.String id)
Returns the first child element found that has the given
id in the
model-wide SId namespace, or null if no such object is found. |
java.lang.String |
getElementName()
Returns the XML element name of this object, which for
Reaction , is
always 'reaction'. |
boolean |
getFast()
Returns the value of the 'fast' attribute of this
Reaction . |
java.lang.String |
getId()
Returns the value of the 'id' attribute of this
Reaction . |
KineticLaw |
getKineticLaw()
Returns the
KineticLaw object contained in this Reaction . |
ListOfSpeciesReferences |
getListOfModifiers()
Returns the list of modifiers in this
Reaction object. |
ListOfSpeciesReferences |
getListOfProducts()
Returns the list of products in this
Reaction object. |
ListOfSpeciesReferences |
getListOfReactants()
Returns the list of reactants in this
Reaction object. |
ModifierSpeciesReference |
getModifier(long n)
Returns the nth modifier species (as a
ModifierSpeciesReference object)
in the list of modifiers of this Reaction . |
ModifierSpeciesReference |
getModifier(java.lang.String species)
Returns the modifier species (as a
ModifierSpeciesReference object)
having a specific identifier in this Reaction . |
java.lang.String |
getName()
Returns the value of the 'name' attribute of this
Reaction . |
long |
getNumModifiers()
Returns the number of modifier species in this
Reaction . |
long |
getNumProducts()
Returns the number of product species in this
Reaction . |
long |
getNumReactants()
Returns the number of reactant species in this
Reaction . |
SpeciesReference |
getProduct(long n)
Returns the nth product species (as a
SpeciesReference object) in
the list of products in this Reaction . |
SpeciesReference |
getProduct(java.lang.String species)
Returns the product species (as a
SpeciesReference object) having
a specific identifier in this Reaction . |
SpeciesReference |
getReactant(long n)
Returns the nth reactant species (as a
SpeciesReference object) in
the list of reactants in this Reaction . |
SpeciesReference |
getReactant(java.lang.String species)
Returns the reactant species (as a
SpeciesReference object) having
a specific identifier in this Reaction . |
boolean |
getReversible()
Returns the value of the 'reversible' attribute on the
Reaction as a
boolean value. |
int |
getTypeCode()
Returns the libSBML type code for this SBML object.
|
boolean |
hasRequiredAttributes()
Predicate returning
true if all the required attributes for this
Reaction object have been set. |
void |
initDefaults()
Initializes the fields of this
Reaction object to 'typical' default
values. |
boolean |
isSetCompartment()
Predicate returning
true if this
Reaction 's 'compartment' attribute is set. |
boolean |
isSetFast()
Predicate returning
true if the value of
the 'fast' attribute on this Reaction . |
boolean |
isSetId()
Predicate returning
true if this
Reaction 's 'id' attribute is set. |
boolean |
isSetKineticLaw()
Predicate returning
true if this
Reaction contains a kinetic law object. |
boolean |
isSetName()
Predicate returning
true if this
Reaction 's 'name' attribute is set. |
boolean |
isSetReversible()
Predicate returning
true if this
Reaction 's 'reversible' attribute is set. |
ModifierSpeciesReference |
removeModifier(long n)
Removes the nth modifier species (ModifierSpeciesReference object) in
the list of modifiers in this
Reaction and returns a pointer to it. |
ModifierSpeciesReference |
removeModifier(java.lang.String species)
Removes the modifier species (ModifierSpeciesReference object) having
the given 'species' attribute in this
Reaction and returns a pointer to it. |
SpeciesReference |
removeProduct(long n)
Removes the nth product species (SpeciesReference object) in the list of
products in this
Reaction and returns a pointer to it. |
SpeciesReference |
removeProduct(java.lang.String species)
Removes the product species (SpeciesReference object) having the given
'species' attribute in this
Reaction and returns a pointer to it. |
SpeciesReference |
removeReactant(long n)
Removes the nth reactant species (SpeciesReference object) in the list of
reactants in this
Reaction and returns a pointer to it. |
SpeciesReference |
removeReactant(java.lang.String species)
Removes the reactant species (SpeciesReference object) having the given
'species' attribute in this
Reaction and returns a pointer to it. |
void |
renameSIdRefs(java.lang.String oldid,
java.lang.String newid)
Renames all the
SIdRef attributes on this element, including any
found in MathML. |
int |
setCompartment(java.lang.String sid)
Sets the value of the 'compartment' attribute of this
Reaction . |
int |
setFast(boolean value)
Sets the value of the 'fast' attribute of this
Reaction . |
int |
setId(java.lang.String sid)
Sets the value of the 'id' attribute of this
Reaction . |
int |
setKineticLaw(KineticLaw kl)
Sets the 'kineticLaw' subelement of this
Reaction to a copy of the
given KineticLaw object. |
int |
setName(java.lang.String name)
Sets the value of the 'name' attribute of this
Reaction . |
int |
setReversible(boolean value)
Sets the value of the 'reversible' attribute of this
Reaction . |
int |
unsetCompartment()
Unsets the value of the 'compartment' attribute of this
Reaction . |
int |
unsetFast()
Unsets the value of the 'fast' attribute of this
Reaction . |
int |
unsetKineticLaw()
Unsets the 'kineticLaw' subelement of this
Reaction . |
int |
unsetName()
Unsets the value of the 'name' attribute of this
Reaction . |
addCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isSetAnnotation, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeFromParentAndDelete, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetId, unsetMetaId, unsetModelHistory, unsetNotes, unsetSBOTerm
public Reaction(long level, long version) throws SBMLConstructorException
level
- a long integer, the SBML Level to assign to this Reaction
version
- a long integer, the SBML Version to assign to this
Reaction
SBMLConstructorException
- Thrown if the given level
and version
combination, or this kind
of SBML object, are either invalid or mismatched with respect to the
parent SBMLDocument
object.
Reaction
object to an SBMLDocument
(e.g.,
using Model.addReaction(Reaction r)
), the SBML Level, SBML Version and
XML namespace of the document override the values used when
creating the Reaction
object via this constructor. This is necessary
to ensure that an SBML document is a consistent structure.
Nevertheless, the ability to supply the values at the time of creation
of a Reaction
is an important aid to producing valid SBML. Knowledge
of the intented 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
.public Reaction(Reaction orig) throws SBMLConstructorException
Reaction
.
orig
- the object to copy.
SBMLConstructorException
- Thrown if the argument orig
is null.
public Reaction(SBMLNamespaces sbmlns) throws SBMLConstructorException
Reaction
using the given SBMLNamespaces
object
sbmlns
.
The SBMLNamespaces
object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and (in
Level 3) packages used in addition to SBML Level 3 Core. A
common approach to using libSBML's SBMLNamespaces
facilities is to create an
SBMLNamespaces
object somewhere in a program once, then hand that object
as needed to object constructors that accept SBMLNamespaces
as arguments.
sbmlns
- an SBMLNamespaces
object.
SBMLConstructorException
- Thrown if the given level
and version
combination, or this kind
of SBML object, are either invalid or mismatched with respect to the
parent SBMLDocument
object.
Reaction
object to an SBMLDocument
(e.g.,
using Model.addReaction(Reaction r)
), the SBML Level, SBML Version and
XML namespace of the document override the values used when
creating the Reaction
object via this constructor. This is necessary
to ensure that an SBML document is a consistent structure.
Nevertheless, the ability to supply the values at the time of creation
of a Reaction
is an important aid to producing valid SBML. Knowledge
of the intented 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
.public int addModifier(ModifierSpeciesReference msr)
ModifierSpeciesReference
object as a product in this
Reaction
.
The ModifierSpeciesReference
instance in msr
is copied.
msr
- a ModifierSpeciesReference
object referring to a Species
in
the enclosing Model
LIBSBML_OPERATION_SUCCESS
LIBSBML_UNEXPECTED_ATTRIBUTE
LIBSBML_LEVEL_MISMATCH
LIBSBML_DUPLICATE_OBJECT_ID
LIBSBML_VERSION_MISMATCH
LIBSBML_OPERATION_FAILED
Reaction.createModifier()
create
)
for alternatives that do not lead to these issues.
public int addProduct(SpeciesReference sr)
SpeciesReference
object as a product in this Reaction
.
The SpeciesReference
instance in sr
is copied.
sr
- a SpeciesReference
object referring to a Species
in the
enclosing Model
Reaction.createProduct()
create
)
for alternatives that do not lead to these issues.
public int addReactant(SpeciesReference sr)
SpeciesReference
object as a reactant in this Reaction
.
The SpeciesReference
instance in sr
is copied.
sr
- a SpeciesReference
object referring to a Species
in the
enclosing Model
LIBSBML_OPERATION_SUCCESS
LIBSBML_LEVEL_MISMATCH
LIBSBML_VERSION_MISMATCH
LIBSBML_DUPLICATE_OBJECT_ID
LIBSBML_INVALID_OBJECT
LIBSBML_OPERATION_FAILED
Reaction.createReactant()
create
)
for alternatives that do not lead to these issues.
public Reaction cloneObject()
Reaction
.
cloneObject
 in class SBase
Reaction
.public KineticLaw createKineticLaw()
KineticLaw
object, installs it as this Reaction
's
'kineticLaw' subelement, and returns it.
If this Reaction
had a previous KineticLaw
, it will be destroyed.
KineticLaw
objectpublic ModifierSpeciesReference createModifier()
ModifierSpeciesReference
, adds it to this Reaction
's
list of modifiers and returns it.
ModifierSpeciesReference
object.public SpeciesReference createProduct()
SpeciesReference
, adds it to this Reaction
's list of
products, and returns it.
SpeciesReference
object.public SpeciesReference createReactant()
SpeciesReference
, adds it to this Reaction
's list of
reactants, and returns it.
SpeciesReference
object.public void delete()
In general, application software will not need to call this method directly. The Java language binding for libSBML is implemented as a language wrapper that provides a Java interface to libSBML's underlying C++/C code. Some of the Java methods return objects that are linked to objects created not by Java code, but by C++ code. The Java objects wrapped around them will be deleted when the garbage collector invokes the corresponding C++ finalize()
methods for the objects. The finalize()
methods in turn call the Reaction.delete()
method on the libSBML object.
This method is exposed in case calling programs want to ensure that the underlying object is freed immediately, and not at some arbitrary time determined by the Java garbage collector. In normal usage, callers do not need to invoke Reaction.delete()
themselves.
public java.lang.String getCompartment()
Reaction
.
public SBase getElementByMetaId(java.lang.String metaid)
metaid
, or
null
if no such object is found.
getElementByMetaId
 in class SBase
metaid
- string representing the metaid of objects to find
metaid
.public SBase getElementBySId(java.lang.String id)
id
in the
model-wide SId namespace, or null
if no such object is found.
getElementBySId
 in class SBase
id
- string representing the id of objects to find.
id
.public java.lang.String getElementName()
Reaction
, is
always 'reaction'.
getElementName
 in class SBase
'reaction'.
public boolean getFast()
Reaction
.
Reaction
.
true.
Beginning with SBML Level 2 Versions 2, the SBML specifications
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. Readers
are directed to the SBML specifications, which provides more detail about
the conditions under which a reaction can be considered to be fast in this
sense.public java.lang.String getId()
Reaction
.
public KineticLaw getKineticLaw()
KineticLaw
object contained in this Reaction
.
KineticLaw
instance.public ListOfSpeciesReferences getListOfModifiers()
Reaction
object.
ListOfSpeciesReferences
containing the references to the
species acting as modifiers in this reactionpublic ListOfSpeciesReferences getListOfProducts()
Reaction
object.
ListOfSpeciesReferences
containing the references to the
species acting as products in this reactionpublic ListOfSpeciesReferences getListOfReactants()
Reaction
object.
ListOfSpeciesReferences
containing the references to the
species acting as reactants in this reactionpublic ModifierSpeciesReference getModifier(long n)
ModifierSpeciesReference
object)
in the list of modifiers of this Reaction
.
Callers should first call getNumModifiers() to find out how many modifiers there are, to avoid using an invalid index number.
n
- the index of the modifier species sought
ModifierSpeciesReference
object) of
this Reaction
.public ModifierSpeciesReference getModifier(java.lang.String species)
ModifierSpeciesReference
object)
having a specific identifier in this Reaction
.
species
- the identifier of the modifier Species
('species'
attribute of the ModifierSpeciesReference
object)
ModifierSpeciesReference
object, or null
if no species with
the given identifier species
appears as a modifier in this
Reaction
.public java.lang.String getName()
Reaction
.
public long getNumModifiers()
Reaction
.
Reaction
.public long getNumProducts()
Reaction
.
Reaction
.public long getNumReactants()
Reaction
.
Reaction
.public SpeciesReference getProduct(long n)
SpeciesReference
object) in
the list of products in this Reaction
.
Callers should first call getNumProducts() to find out how many products there are, to avoid using an invalid index number.
n
- the index of the product sought.
SpeciesReference
object) of this
Reaction
.public SpeciesReference getProduct(java.lang.String species)
SpeciesReference
object) having
a specific identifier in this Reaction
.
species
- the identifier of the product Species
('species'
attribute of the product SpeciesReference
object)
SpeciesReference
object, or null
if no species with the
given identifier species
appears as a product in this Reaction
.public SpeciesReference getReactant(long n)
SpeciesReference
object) in
the list of reactants in this Reaction
.
Callers should first call getNumReactants() to find out how many reactants there are, to avoid using an invalid index number.
n
- the index of the reactant sought.
SpeciesReference
object) of this
Reaction
.public SpeciesReference getReactant(java.lang.String species)
SpeciesReference
object) having
a specific identifier in this Reaction
.
species
- the identifier of the reactant Species
('species'
attribute of the reactant SpeciesReference
object)
SpeciesReference
object, or null
if no species with the
given identifier species
appears as a reactant in this Reaction
.public boolean getReversible()
Reaction
as a
boolean value.
Reaction
.public int getTypeCode()
LibSBML attaches an identifying code to every kind of SBML object. These
are integer constants known as SBML type codes. The names of all
the codes begin with the characters &ldquoSBML_
&rdquo.
In the Java language interface for libSBML, the
type codes are defined as static integer constants in the interface class
libsbmlConstants
. Note that different Level 3
package plug-ins may use overlapping type codes to identify the package
to which a given object belongs, call the getPackageName()
method on the object.
getTypeCode
 in class SBase
SBML_REACTION
(default).
Reaction.getElementName()
,
SBase.getPackageName()
public boolean hasRequiredAttributes()
true
if all the required attributes for this
Reaction
object have been set.
hasRequiredAttributes
 in class SBase
Reaction
object are:
public void initDefaults()
Reaction
object to 'typical' default
values.
The SBML Reaction
component has slightly different aspects and
default attribute values in different SBML Levels and Versions.
This method sets the values to certain common defaults, based
mostly on what they are in SBML Level 2. Specifically:
true
false
true.
Beginning with SBML Level 2 Versions 2, the SBML specifications
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. Readers
are directed to the SBML specifications, which provides more detail about
the conditions under which a reaction can be considered to be fast in this
sense.public boolean isSetCompartment()
true
if this
Reaction
's 'compartment' attribute is set.
public boolean isSetFast()
true
if the value of
the 'fast' attribute on this Reaction
.
true
if the 'fast' attribute is true, false
otherwise.
true.
Beginning with SBML Level 2 Versions 2, the SBML specifications
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. Readers
are directed to the SBML specifications, which provides more detail about
the conditions under which a reaction can be considered to be fast in this
sense.public boolean isSetId()
true
if this
Reaction
's 'id' attribute is set.
public boolean isSetKineticLaw()
true
if this
Reaction
contains a kinetic law object.
true
if a KineticLaw
is present in this Reaction
,, false
otherwise.public boolean isSetName()
true
if this
Reaction
's 'name' attribute is set.
public boolean isSetReversible()
true
if this
Reaction
's 'reversible' attribute is set.
true
if the 'reversible' attribute of this Reaction
is
set, false
otherwise.public ModifierSpeciesReference removeModifier(long n)
Reaction
and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it. The caller should first call getNumModifiers() to find out how many modifiers there are, to avoid using an invalid index number.
n
- the index of the ModifierSpeciesReference
object to remove
ModifierSpeciesReference
object, or null
if the
given index is out of range.public ModifierSpeciesReference removeModifier(java.lang.String species)
Reaction
and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
species
- the 'species' attribute of the ModifierSpeciesReference
object
ModifierSpeciesReference
object, or null
if no
ModifierSpeciesReference
object with the given 'species' attribute @p
species exists in this Reaction
.public SpeciesReference removeProduct(long n)
Reaction
and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it. The caller should first call getNumProducts() to find out how many products there are, to avoid using an invalid index number.
n
- the index of the product SpeciesReference
object to remove
SpeciesReference
object, or null
if the
given index is out of range.public SpeciesReference removeProduct(java.lang.String species)
Reaction
and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
species
- the 'species' attribute of the product SpeciesReference
object
SpeciesReference
object, or null
if no
product SpeciesReference
object with the given 'species' attribute
species
exists in this Reaction
.public SpeciesReference removeReactant(long n)
Reaction
and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it. The caller should first call getNumReactants() to find out how many reactants there are, to avoid using an invalid index number.
n
- the index of the reactant SpeciesReference
object to remove
SpeciesReference
object, or null
if the
given index is out of range.public SpeciesReference removeReactant(java.lang.String species)
Reaction
and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
species
- the 'species' attribute of the reactant SpeciesReference
object
SpeciesReference
object, or null
if no
reactant SpeciesReference
object with the given 'species' attribute
species
exists in this Reaction
.public void renameSIdRefs(java.lang.String oldid, java.lang.String newid)
SIdRef
attributes on this element, including any
found in MathML.
In SBML, object identifiers are of a data type called SId
.
In SBML Level 3, an explicit data type called SIdRef
was
introduced for attribute values that refer to SId
values in
previous Levels of SBML, this data type did not exist and attributes were
simply described to as 'referring to an identifier', but the effective
data type was the same as SIdRef
in Level 3. These and
other methods of libSBML refer to the type SIdRef
for all
Levels of SBML, even if the corresponding SBML specification did not
explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas, comparing the identifiers to the value of
oldid
. If any matches are found, the matching identifiers are replaced
with newid
. The method does not descend into child elements.
renameSIdRefs
 in class SBase
oldid
- the old identifiernewid
- the new identifierpublic int setCompartment(java.lang.String sid)
Reaction
.
The string sid
is copied.
sid
- the string to use as the compartment of this Reaction
Reaction
in
lower Levels of SBML.public int setFast(boolean value)
Reaction
.
value
- the value of the 'fast' attribute.
true.
Beginning with SBML Level 2 Versions 2, the SBML specifications
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. Readers
are directed to the SBML specifications, which provides more detail about
the conditions under which a reaction can be considered to be fast in this
sense.public int setId(java.lang.String sid)
Reaction
.
The string sid
is copied.
SBML has strict requirements for the syntax of identifiers, that is, the
values of the 'id' attribute present on most types of SBML objects.
The following is a summary of the definition of the SBML identifier type
SId
, which defines the permitted syntax of identifiers. We
express the syntax using an extended form of BNF notation:
letter .= 'a'..'z','A'..'Z' digit .= '0'..'9' idChar .= letter | digit | '_' SId .= ( letter | '_' ) idChar*The characters
(
and )
are used for grouping, the
character *
'zero or more times', and the character
|
indicates logical 'or'. The equality of SBML identifiers is
determined by an exact character sequence match i.e., comparisons must be
performed in a case-sensitive manner. In addition, there are a few
conditions for the uniqueness of identifiers in an SBML model. Please
consult the SBML specifications for the exact details of the uniqueness
requirements.
public int setKineticLaw(KineticLaw kl)
Reaction
to a copy of the
given KineticLaw
object.
kl
- the KineticLaw
object to use.
public int setName(java.lang.String name)
Reaction
.
The string in name
is copied.
public int setReversible(boolean value)
Reaction
.
value
- the value of the 'reversible' attribute.
public int unsetCompartment()
Reaction
.
Reaction
in
lower Levels of SBML.public int unsetFast()
Reaction
.
true.
Beginning with SBML Level 2 Versions 2, the SBML specifications
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. Readers
are directed to the SBML specifications, which provides more detail about
the conditions under which a reaction can be considered to be fast in this
sense.public int unsetKineticLaw()
Reaction
.