
LibSBML implementation of SBML's AlgebraicRule construct.
The rule type AlgebraicRule is derived from the parent class Rule. It is used to express equations that are neither assignments of model variables nor rates of change. AlgebraicRule does not add any attributes to the basic Rule; its role is simply to distinguish this case from the other cases.
In the context of a simulation, algebraic rules are in effect at all times, t >= 0. For purposes of evaluating expressions that involve the delay 'csymbol' (see the SBML specification), algebraic rules are considered to apply also at t <= 0. Please consult the relevant SBML specification for additional information about the semantics of assignments, rules, and entity values for simulation time t <= 0.
An SBML model must not be overdetermined. The ability to define arbitrary algebraic expressions in an SBML model introduces the possibility that a model is mathematically overdetermined by the overall system of equations constructed from its rules, reactions and events. Therefore, if an algebraic rule is introduced in a model, for at least one of the entities referenced in the rule's 'math' element the value of that entity must not be completely determined by other constructs in the model. This means that at least this entity must not have the attribute 'constant'=true and there must also not be a rate rule or assignment rule for it. Furthermore, if the entity is a Species object, its value must not be determined by reactions, which means that it must either have the attribute 'boundaryCondition'=true or else not be involved in any reaction at all. These restrictions are explained in more detail in the SBML specification documents.
In SBML Levels 2 and 3, Reaction object identifiers can be referenced in the 'math' expression of an algebraic rule, but reaction rates can never be determined by algebraic rules. This is true even when a reaction does not contain a KineticLaw element. (In such cases of missing KineticLaw elements, the model is valid but incomplete; the rates of reactions lacking kinetic laws are simply undefined, and not determined by the algebraic rule.)
In SBML Level 3 as well as Level 2, rules are separated into three subclasses for the benefit of model analysis software. The three subclasses are based on the following three different possible functional forms (where x is a variable, f is some arbitrary function returning a numerical result, V is a vector of variables that does not include x, and W is a vector of variables that may include x):
| Algebraic: | left-hand side is zero | 0 = f(W) |
| Assignment: | left-hand side is a scalar: | x = f(V) |
| Rate: | left-hand side is a rate-of-change: | dx/dt = f(W) |
In their general form given above, there is little to distinguish between assignment and algebraic rules. They are treated as separate cases for the following reasons:
Assignment rules can simply be evaluated to calculate intermediate values for use in numerical methods. They are statements of equality that hold at all times. (For assignments that are only performed once, see InitialAssignment.)
SBML needs to place restrictions on assignment rules, for example the restriction that assignment rules cannot contain algebraic loops.
Some simulators do not contain numerical solvers capable of solving unconstrained algebraic equations, and providing more direct forms such as assignment rules may enable those simulators to process models they could not process if the same assignments were put in the form of general algebraic equations;
Those simulators that can solve these algebraic equations make a distinction between the different categories listed above; and
The approach taken to covering these cases in SBML is to define an abstract Rule structure containing a subelement, 'math', to hold the right-hand side expression, then to derive subtypes of Rule that add attributes to distinguish the cases of algebraic, assignment and rate rules. The 'math' subelement must contain a MathML expression defining the mathematical formula of the rule. This MathML formula must return a numerical value. The formula can be an arbitrary expression referencing the variables and other entities in an SBML model.
Each of the three subclasses of Rule (AssignmentRule, AlgebraicRule, RateRule) inherit the the 'math' subelement and other fields from SBase. The AssignmentRule and RateRule classes add an additional attribute, 'variable'. See the definitions of AssignmentRule, AlgebraicRule and RateRule for details about the structure and interpretation of each one.
An important design goal of SBML rule semantics is to ensure that a model's simulation and analysis results will not be dependent on when or how often rules are evaluated. To achieve this, SBML needs to place two restrictions on rule use. The first concerns algebraic loops in the system of assignments in a model, and the second concerns overdetermined systems.
The combined set of InitialAssignment, AssignmentRule and KineticLaw objects in a model constitute a set of assignment statements that should be considered as a whole. (A KineticLaw object is counted as an assignment because it assigns a value to the symbol contained in the 'id' attribute of the Reaction object in which it is defined.) This combined set of assignment statements must not contain algebraic loops—dependency chains between these statements must terminate. To put this more formally, consider a directed graph in which nodes are assignment statements and directed arcs exist for each occurrence of an SBML species, compartment or parameter symbol in an assignment statement's 'math' subelement. Let the directed arcs point from the statement assigning the symbol to the statements that contain the symbol in their 'math' subelement expressions. This graph must be acyclic.
SBML does not specify when or how often rules should be evaluated. Eliminating algebraic loops ensures that assignment statements can be evaluated any number of times without the result of those evaluations changing. As an example, consider the set of equations x = x + 1, y = z + 200 and z = y + 100. If this set of equations were interpreted as a set of assignment statements, it would be invalid because the rule for x refers to x (exhibiting one type of loop), and the rule for y refers to z while the rule for z refers back to y (exhibiting another type of loop). Conversely, the following set of equations would constitute a valid set of assignment statements: x = 10, y = z + 200, and z = x + 100.
An SBML model must not be overdetermined; that is, a model must not define more equations than there are unknowns in a model. An SBML model that does not contain AlgebraicRule structures cannot be overdetermined.
LibSBML implements the static analysis procedure described in Appendix B of the SBML Level 3 Version 1 Core specification for assessing whether a model is overdetermined.
(In summary, assessing whether a given continuous, deterministic, mathematical model is overdetermined does not require dynamic analysis; it can be done by analyzing the system of equations created from the model. One approach is to construct a bipartite graph in which one set of vertices represents the variables and the other the set of vertices represents the equations. Place edges between vertices such that variables in the system are linked to the equations that determine them. For algebraic equations, there will be edges between the equation and each variable occurring in the equation. For ordinary differential equations (such as those defined by rate rules or implied by the reaction rate definitions), there will be a single edge between the equation and the variable determined by that differential equation. A mathematical model is overdetermined if the maximal matchings of the bipartite graph contain disconnected vertexes representing equations. If one maximal matching has this property, then all the maximal matchings will have this property; i.e., it is only necessary to find one maximal matching.)
SBML Level 1 uses a different scheme than SBML Level 2 and Level 3 for distinguishing rules; specifically, it uses an attribute whose value is drawn from an enumeration of 3 values. LibSBML supports this using methods that work with the enumeration values listed in the following table.
| Enumerator | Meaning |
RULE_TYPE_RATE | Indicates the rule is a 'rate' rule. |
RULE_TYPE_SCALAR | Indicates the rule is a 'scalar' rule. |
RULE_TYPE_INVALID | Indicates the rule type is unknown or not yet set. |
| def libsbml.SBase.addCVTerm | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
addCVTerm(CVTerm term, bool newBag = False)int addCVTerm(CVTerm term)
int
Adds a copy of the given CVTerm object to this SBML object.
| term | the CVTerm to assign | |
| newBag | if true, creates a new RDF bag with the same identifier as a previous bag, and if false, adds the term to an existing RDF bag with the same type of qualifier as the term being added. |
| def libsbml.SBase.appendAnnotation | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
appendAnnotation(XMLNode annotation)int appendAnnotation(string annotation)
int
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
appendAnnotation(XMLNode annotation)
Appends the given annotation to the 'annotation' subelement of this object.
Whereas the SBase 'notes' subelement is a container for content to be shown directly to humans, the 'annotation' element is a container for optional software-generated content not meant to be shown to humans. Every object derived from SBase can have its own value for 'annotation'. The element's content type is XML type 'any', allowing essentially arbitrary well-formed XML data content.
SBML places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the SBML specifications for more details.
Unlike SBase.setAnnotation() or SBase.setAnnotation(), this method allows other annotations to be preserved when an application adds its own data.
| annotation | an XML structure that is to be copied and appended to the content of the 'annotation' subelement of this object |
appendAnnotation(string annotation)
Appends the given annotation to the 'annotation' subelement of this object.
Whereas the SBase 'notes' subelement is a container for content to be shown directly to humans, the 'annotation' element is a container for optional software-generated content not meant to be shown to humans. Every object derived from SBase can have its own value for 'annotation'. The element's content type is XML type 'any', allowing essentially arbitrary well-formed XML data content.
SBML places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the SBML specifications for more details.
Unlike SBase.setAnnotation() or SBase.setAnnotation(), this method allows other annotations to be preserved when an application adds its own data.
| annotation | an XML string that is to be copied and appended to the content of the 'annotation' subelement of this object |
Reimplemented in libsbml.Model, and libsbml.SpeciesReference.
| def libsbml.SBase.appendNotes | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
appendNotes(XMLNode notes)int appendNotes(string notes)
int
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
appendNotes(string notes)
Appends the given notes to the 'notes' subelement of this object.
The content of the parameter notes is copied.
The optional SBML element named 'notes', present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the 'notes' element would be to contain formatted user comments about the model element in which the 'notes' element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for 'notes', allowing users considerable freedom when adding comments to their models.
The format of 'notes' elements must be XHTML 1.0. To help verify the formatting of 'notes' content, libSBML provides the static utility method SyntaxChecker.hasExpectedXHTMLSyntax(); however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how 'notes' element content must be structured.
| notes | an XML string that is to appended to the content of the 'notes' subelement of this object |
appendNotes(XMLNode notes)
Appends the given notes to the 'notes' subelement of this object.
The content of notes is copied.
The optional SBML element named 'notes', present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the 'notes' element would be to contain formatted user comments about the model element in which the 'notes' element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for 'notes', allowing users considerable freedom when adding comments to their models.
The format of 'notes' elements must be XHTML 1.0. To help verify the formatting of 'notes' content, libSBML provides the static utility method SyntaxChecker.hasExpectedXHTMLSyntax(); however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how 'notes' element content must be structured.
| notes | an XML node structure that is to appended to the content of the 'notes' subelement of this object |
| def libsbml.AlgebraicRule.clone | ( | self | ) |
Python method signature(s):
clone()AlgebraicRule
Creates and returns a deep copy of this Rule.
Reimplemented from libsbml.Rule.
| def libsbml.Rule.containsUndeclaredUnits | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
containsUndeclaredUnits()bool containsUndeclaredUnits()
bool
Predicate returning true if the math expression of this Rule contains parameters/numbers with undeclared units.
true if the math expression of this Rule includes parameters/numbers with undeclared units, false otherwise.true indicates that the UnitDefinition returned by getDerivedUnitDefinition() may not accurately represent the units of the expression.| def libsbml.SBase.disablePackage | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
disablePackage(string pkgURI, string pkgPrefix)int
Disables the given SBML Level 3 package
This method enables or disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
| pkgURI | the URI of the package | |
| pkgPrefix | the XML prefix of the package |
| def libsbml.SBase.enablePackage | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
enablePackage(string pkgURI, string pkgPrefix, bool flag)int
Enables or disables the given SBML Level 3 package
This method enables or disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
| pkgURI | the URI of the package | |
| pkgPrefix | the XML prefix of the package | |
| flag | whether to enable (true) or disable (false) the package |
| def libsbml.SBase.getAncestorOfType | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
getAncestorOfType(int type, string pkgName = "core")SBase getAncestorOfType(int type)
SBase getAncestorOfType(int type, string pkgName = "core")
SBase getAncestorOfType(int type)
SBase
Returns the first ancestor object that has the given SBML type code.
LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. In the Python language interface for libSBML, the type codes are defined as static integer constants in the interface class libsbml. The names of the type codes all begin with the characters SBML_.
This method searches the tree of objects that are parents of this object, and returns the first one that has the given SBML type code. If the optional argument pkgName is given, it will cause the search to be limited to the SBML Level 3 package given.
| type | the SBML type code of the object sought | |
| pkgName | (optional) the short name of an SBML Level 3 package to which the sought-after object must belong |
None if no ancestor exists.| def libsbml.SBase.getAnnotation | ( | self | ) | [inherited] |
Python method signature(s):
getAnnotation()XMLNode
Returns the content of the 'annotation' subelement of this object as a tree of XMLNode objects.
Whereas the SBML 'notes' subelement is a container for content to be shown directly to humans, the 'annotation' element is a container for optional software-generated content not meant to be shown to humans. Every object derived from SBase can have its own value for 'annotation'. The element's content type is XML type 'any', allowing essentially arbitrary well-formed XML data content.
SBML places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the SBML specifications for more details.
The annotations returned by this method will be in XML form. LibSBML provides an object model and related interfaces for certain specific kinds of annotations, namely model history information and RDF content. See the ModelHistory, CVTerm and RDFAnnotationParser classes for more information about the facilities available.
| def libsbml.SBase.getAnnotationString | ( | self | ) | [inherited] |
Python method signature(s):
getAnnotationString()string
Returns the content of the 'annotation' subelement of this object as a character string.
Whereas the SBML 'notes' subelement is a container for content to be shown directly to humans, the 'annotation' element is a container for optional software-generated content not meant to be shown to humans. Every object derived from SBase can have its own value for 'annotation'. The element's content type is XML type 'any', allowing essentially arbitrary well-formed XML data content.
SBML places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the SBML specifications for more details.
The annotations returned by this method will be in string form.
| def libsbml.SBase.getColumn | ( | self | ) | [inherited] |
Python method signature(s):
getColumn()long
Returns the column number on which this object first appears in the XML representation of the SBML document.
| def libsbml.SBase.getCVTerm | ( | self, | ||
| args | ||||
| ) | [inherited] |
| def libsbml.SBase.getCVTerms | ( | self | ) | [inherited] |
Python method signature(s):
getCVTerms()CVTermList
Get the CVTermList of CVTerm objects in this SBase.
| def libsbml.Rule.getDerivedUnitDefinition | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
getDerivedUnitDefinition()UnitDefinition getDerivedUnitDefinition()
UnitDefinition
Calculates and returns a UnitDefinition that expresses the units of measurement assumed for the 'math' expression of this Rule.
The units are calculated based on the mathematical expression in the Rule and the model quantities referenced by <ci> elements used within that expression. The getDerivedUnitDefinition() method returns the calculated units.
Note that the functionality that facilitates unit analysis depends on the model as a whole. Thus, in cases where the object has not been added to a model or the model itself is incomplete, unit analysis is not possible and this method will return None.
None if one cannot be constructed.| def libsbml.SBase.getElementByMetaId | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
getElementByMetaId(string metaid)SBase
Returns the first child element it can find with the given metaid, or None if no such object is found.
| metaid | string representing the 'metaid' attribute value of the object to find |
Reimplemented in libsbml.ListOf, libsbml.Model, libsbml.SBMLDocument, libsbml.UnitDefinition, libsbml.Reaction, libsbml.KineticLaw, and libsbml.Event.
| def libsbml.SBase.getElementBySId | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
getElementBySId(string id)SBase
Returns the first child element found that has the given id in the model-wide SId namespace, or None if no such object is found.
| id | string representing the 'id' attribute value of the object to find |
Reimplemented in libsbml.ListOf, libsbml.Model, libsbml.SBMLDocument, libsbml.UnitDefinition, libsbml.ListOfUnitDefinitions, libsbml.ListOfLocalParameters, libsbml.Reaction, libsbml.KineticLaw, and libsbml.Event.
| def libsbml.Rule.getElementName | ( | self | ) | [inherited] |
Python method signature(s):
getElementName()string
Returns the XML element name of this object
The returned value can be any of a number of different strings, depending on the SBML Level in use and the kind of Rule object this is. The rules as of libSBML version 5.3.0 are the following:
'rateRule' 'assignmentRule' 'algebraicRule' 'specieConcentrationRule' 'speciesConcentrationRule' 'compartmentVolumeRule' 'parameterRule' 'unknownRule' Beware that the last ('unknownRule') is not a valid SBML element name.
Reimplemented from libsbml.SBase.
| def libsbml.Rule.getFormula | ( | self | ) | [inherited] |
Python method signature(s):
getFormula()string
Returns the mathematical expression of this Rule in text-string form.
The text string is produced by SBML_formulaToString(); please consult the documentation for that function to find out more about the format of the text-string formula.
| def libsbml.Rule.getId | ( | self | ) | [inherited] |
Python method signature(s):
getId()string
Renames all the UnitSIdRef attributes on this element
| def libsbml.Rule.getL1TypeCode | ( | self | ) | [inherited] |
Python method signature(s):
getL1TypeCode()int
Returns the SBML Level 1 type code for this Rule object.
This method only applies to SBML Level 1 model objects. If this is not an SBML Level 1 rule object, this method will return SBML_UNKNOWN.
| def libsbml.SBase.getLevel | ( | self | ) | [inherited] |
Python method signature(s):
getLevel()long
Returns the SBML Level of the SBMLDocument object containing this object.
| def libsbml.SBase.getLine | ( | self | ) | [inherited] |
Python method signature(s):
getLine()long
Returns the line number on which this object first appears in the XML representation of the SBML document.
| def libsbml.SBase.getListOfAllElements | ( | self | ) | [inherited] |
Python method signature(s):
getListOfAllElements()SBaseList
| def libsbml.SBase.getListOfAllElementsFromPlugins | ( | self | ) | [inherited] |
Python method signature(s):
getListOfAllElementsFromPlugins()SBaseList
| def libsbml.Rule.getMath | ( | self | ) | [inherited] |
Python method signature(s):
getMath()ASTNode
Get the mathematical formula of this Rule as an ASTNode tree.
| def libsbml.SBase.getMetaId | ( | self | ) | [inherited] |
Python method signature(s):
getMetaId()string
Returns the value of the 'metaid' attribute of this object.
The optional attribute named 'metaid', present on every major SBML component type, is for supporting metadata annotations using RDF (Resource Description Format). The attribute value has the data type XML ID, the XML identifier type, which means each 'metaid' value must be globally unique within an SBML file. (Importantly, this uniqueness criterion applies across any attribute with type XML ID, not just the 'metaid' attribute used by SBML—something to be aware of if your application-specific XML content inside the 'annotation' subelement happens to use XML ID.) The 'metaid' value serves to identify a model component for purposes such as referencing that component from metadata placed within 'annotation' subelements.
| def libsbml.SBase.getModel | ( | self | ) | [inherited] |
Python method signature(s):
getModel()Model
Returns the Model object in which the current object is located.
| def libsbml.SBase.getModelHistory | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
getModelHistory()ModelHistory getModelHistory()
ModelHistory
Returns the ModelHistory object, if any, attached to this object.
None if none exist.| def libsbml.SBase.getNamespaces | ( | self | ) | [inherited] |
Python method signature(s):
getNamespaces()XMLNamespaces
Returns a list of the XML Namespaces declared on this SBML document.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces information. It is used to communicate the SBML Level, Version, and (in SBML Level 3) packages used in addition to SBML Level 3 Core.
Reimplemented in libsbml.SBMLDocument.
| def libsbml.SBase.getNotes | ( | self | ) | [inherited] |
Python method signature(s):
getNotes()XMLNode
Returns the content of the 'notes' subelement of this object as a tree of XMLNode objects.
The optional SBML element named 'notes', present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the 'notes' element would be to contain formatted user comments about the model element in which the 'notes' element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for 'notes', allowing users considerable freedom when adding comments to their models.
The format of 'notes' elements must be XHTML 1.0. To help verify the formatting of 'notes' content, libSBML provides the static utility method SyntaxChecker.hasExpectedXHTMLSyntax(); however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how 'notes' element content must be structured.
The 'notes' element content returned by this method will be in XML form, but libSBML does not provide an object model specifically for the content of notes. Callers will need to traverse the XML tree structure using the facilities available on XMLNode and related objects. For an alternative method of accessing the notes, see getNotesString().
| def libsbml.SBase.getNotesString | ( | self | ) | [inherited] |
Python method signature(s):
getNotesString()string
Returns the content of the 'notes' subelement of this object as a string.
The optional SBML element named 'notes', present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the 'notes' element would be to contain formatted user comments about the model element in which the 'notes' element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for 'notes', allowing users considerable freedom when adding comments to their models.
The format of 'notes' elements must be XHTML 1.0. To help verify the formatting of 'notes' content, libSBML provides the static utility method SyntaxChecker.hasExpectedXHTMLSyntax(); however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how 'notes' element content must be structured.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
| def libsbml.SBase.getNumCVTerms | ( | self | ) | [inherited] |
Python method signature(s):
getNumCVTerms()long
Returns the number of CVTerm objects in the annotations of this SBML object.
| def libsbml.SBase.getNumPlugins | ( | self | ) | [inherited] |
Python method signature(s):
getNumPlugins()long
Returns the number of plugin objects (extenstion interfaces) for SBML Level 3 package extensions known.
| def libsbml.SBase.getPackageName | ( | self | ) | [inherited] |
Python method signature(s):
getPackageName()string
Returns the name of the SBML Level 3 package in which this element is defined.
"core" will be returned if this element is defined in SBML Level 3 Core. The string "unknown" will be returned if this element is not defined in any SBML package. | def libsbml.SBase.getPackageVersion | ( | self | ) | [inherited] |
Python method signature(s):
getPackageVersion()long
Returns the Version of the SBML Level 3 package to which this element belongs to.
0 will be returned if this element belongs to the SBML Level 3 Core package.| def libsbml.SBase.getParentSBMLObject | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
getParentSBMLObject()SBase getParentSBMLObject()
SBase
Returns the parent SBML object containing this object.
This returns the immediately-containing object. This method is convenient when holding an object nested inside other objects in an SBML model.
| def libsbml.SBase.getPlugin | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
getPlugin(string package)SBasePlugin getPlugin(string package)
SBasePlugin getPlugin(long n)
SBasePlugin getPlugin(long n)
SBasePlugin
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
getPlugin(long n)
Returns the nth plugin object (extension interface) for an SBML Level 3 package extension.
| n | the index of the plugin to return |
getPlugin(string package)
Returns a plugin object (extension interface) for an SBML Level 3 package extension with the given package name or URI.
| package | the name or URI of the package |
| def libsbml.SBase.getResourceBiologicalQualifier | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
getResourceBiologicalQualifier(string resource)long
Returns the MIRIAM biological qualifier associated with the given resource.
In MIRIAM, qualifiers are an optional means of indicating the relationship between a model component and its annotations. There are two broad kinds of annotations: model and biological. The latter kind is used to qualify the relationship between a model component and a biological entity which it represents. Examples of relationships include 'is' and 'has part', but many others are possible. MIRIAM defines numerous relationship qualifiers to enable different software tools to qualify biological annotations in the same standardized way. In libSBML, the MIRIAM controlled-vocabulary annotations on an SBML model element are represented using lists of CVTerm objects, and the the MIRIAM biological qualifiers are represented using values whose names begin with BQB_ in the interface class libsbml.
This method searches the controlled-vocabulary annotations (i.e., the list of CVTerm objects) on the present object, then out of those that have biological qualifiers, looks for an annotation to the given resource. If such an annotation is found, it returns the type of biological qualifier associated with that resource as a value whose name begins with BQB_ from the interface class libsbml.
| resource | string representing the resource; e.g., 'http://www.geneontology.org/GO:0005892'. |
BQB_ constants defined in libsbml may be expanded in later libSBML releases, to match the values defined by MIRIAM at that later time. | def libsbml.SBase.getResourceModelQualifier | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
getResourceModelQualifier(string resource)long
Returns the MIRIAM model qualifier associated with the given resource.
In MIRIAM, qualifiers are an optional means of indicating the relationship between a model component and its annotations. There are two broad kinds of annotations: model and biological. The former kind is used to qualify the relationship between a model component and another modeling object. An example qualifier is 'isDerivedFrom', to indicate that a given component of the model is derived from the modeling object represented by the referenced resource. MIRIAM defines numerous relationship qualifiers to enable different software tools to qualify model annotations in the same standardized way. In libSBML, the MIRIAM controlled-vocabulary annotations on an SBML model element are represented using lists of CVTerm objects, and the the MIRIAM model qualifiers are represented using values whose names begin with BQM_ in the interface class libsbml.
This method method searches the controlled-vocabulary annotations (i.e., the list of CVTerm objects) on the present object, then out of those that have model qualifiers, looks for an annotation to the given resource. If such an annotation is found, it returns the type of type of model qualifier associated with that resource as a value whose name begins with BQM_ from the interface class libsbml.
| resource | string representing the resource; e.g., 'http://www.geneontology.org/GO:0005892'. |
BQM_ constants defined in libsbml may be expanded in later libSBML releases, to match the values defined by MIRIAM at that later time. | def libsbml.SBase.getSBMLDocument | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
getSBMLDocument()SBMLDocument getSBMLDocument()
SBMLDocument
Returns the SBMLDocument object containing this object instance.
LibSBML uses the class SBMLDocument as a top-level container for storing SBML content and data associated with it (such as warnings and error messages). An SBML model in libSBML is contained inside an SBMLDocument object. SBMLDocument corresponds roughly to the class SBML defined in the SBML Level 3 and Level 2 specifications, but it does not have a direct correspondence in SBML Level 1. (But, it is created by libSBML no matter whether the model is Level 1, Level 2 or Level 3.)
This method allows the caller to obtain the SBMLDocument for the current object.
| def libsbml.SBase.getSBOTerm | ( | self | ) | [inherited] |
Python method signature(s):
getSBOTerm()int
Returns the integer portion of the value of the 'sboTerm' attribute of this object.
Beginning with SBML Level 2 Version 3, objects derived from SBase have an optional attribute named 'sboTerm' for supporting the use of the Systems Biology Ontology. In SBML proper, the data type of the attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a seven digit integer number; libSBML simplifies the representation by only storing the 'NNNNNNN' integer portion. Thus, in libSBML, the 'sboTerm' attribute on SBase has data type int, and SBO identifiers are stored simply as integers. (For convenience, libSBML offers methods for returning both the integer form and a text-string form of the SBO identifier.)
SBO terms are a type of optional annotation, and each different class of SBML object derived from SBase imposes its own requirements about the values permitted for 'sboTerm'. Please consult the SBML Level 2 Version 4 specification for more information about the use of SBO and the 'sboTerm' attribute.
-1 if the value is not set. | def libsbml.SBase.getSBOTermID | ( | self | ) | [inherited] |
Python method signature(s):
getSBOTermID()string
Returns the string representation of the 'sboTerm' attribute of this object.
Beginning with SBML Level 2 Version 3, objects derived from SBase have an optional attribute named 'sboTerm' for supporting the use of the Systems Biology Ontology. In SBML proper, the data type of the attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a seven digit integer number; libSBML simplifies the representation by only storing the 'NNNNNNN' integer portion. Thus, in libSBML, the 'sboTerm' attribute on SBase has data type int, and SBO identifiers are stored simply as integers. This method returns the entire SBO identifier as a text string in the form 'SBO:NNNNNNN'.
SBO terms are a type of optional annotation, and each different class of SBML object derived from SBase imposes its own requirements about the values permitted for 'sboTerm'. Please consult the SBML Level 2 Version 4 specification for more information about the use of SBO and the 'sboTerm' attribute.
| def libsbml.Rule.getType | ( | self | ) | [inherited] |
Python method signature(s):
getType()long
Get the type of rule this is.
| def libsbml.Rule.getTypeCode | ( | self | ) | [inherited] |
Python method signature(s):
getTypeCode()int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. In the Python language interface for libSBML, the type codes are defined as static integer constants in the interface class libsbml. The names of the type codes all begin with the characters SBML_.
Reimplemented from libsbml.SBase.
| def libsbml.Rule.getUnits | ( | self | ) | [inherited] |
| def libsbml.Rule.getVariable | ( | self | ) | [inherited] |
Python method signature(s):
getVariable()string
Get the value of the 'variable' attribute of this Rule object.
In SBML Level 1, the different rule types each have a different name for the attribute holding the reference to the object constituting the left-hand side of the rule. (E.g., for SBML Level 1's SpeciesConcentrationRule the attribute is 'species', for CompartmentVolumeRule it is 'compartment', etc.) In SBML Levels 2 and 3, the only two types of Rule objects with a left-hand side object reference are AssignmentRule and RateRule, and both of them use the same name for attribute: 'variable'. In order to make it easier for application developers to work with all Levels of SBML, libSBML uses a uniform name for all of such attributes, and it is 'variable', regardless of whether Level 1 rules or Level 2–3 rules are being used.
None if this object is an AlgebraicRule object. | def libsbml.SBase.getVersion | ( | self | ) | [inherited] |
Python method signature(s):
getVersion()long
Returns the Version within the SBML Level of the SBMLDocument object containing this object.
| def libsbml.AlgebraicRule.hasRequiredAttributes | ( | self | ) |
Python method signature(s):
hasRequiredAttributes()bool
Predicate returning true if all the required attributes for this AlgebraicRule object have been set.
true if the required attributes have been set, false otherwise. Reimplemented from libsbml.Rule.
| def libsbml.Rule.hasRequiredElements | ( | self | ) | [inherited] |
Python method signature(s):
hasRequiredElements()bool
Predicate returning true if all the required elements for this Rule object have been set.
The only required element for a Rule object is the 'math' subelement.
| def libsbml.SBase.hasValidLevelVersionNamespaceCombination | ( | self | ) | [inherited] |
Python method signature(s):
hasValidLevelVersionNamespaceCombination()bool
| def libsbml.Rule.isAlgebraic | ( | self | ) | [inherited] |
Python method signature(s):
isAlgebraic()bool
Predicate returning true if this Rule is an AlgebraicRule.
true if this Rule is an AlgebraicRule, false otherwise. | def libsbml.Rule.isAssignment | ( | self | ) | [inherited] |
Python method signature(s):
isAssignment()bool
Predicate returning true if this Rule is an AssignmentRule.
true if this Rule is an AssignmentRule, false otherwise. | def libsbml.Rule.isCompartmentVolume | ( | self | ) | [inherited] |
Python method signature(s):
isCompartmentVolume()bool
Predicate returning true if this Rule is an CompartmentVolumeRule or equivalent.
This libSBML method works for SBML Level 1 models (where there is such a thing as an explicit CompartmentVolumeRule), as well as other Levels of SBML. For Levels above Level 1, this method checks the symbol being affected by the rule, and returns true if the symbol is the identifier of a Compartment object defined in the model.
true if this Rule is a CompartmentVolumeRule, false otherwise. | def libsbml.SBase.isPackageEnabled | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
isPackageEnabled(string pkgName)bool
Predicate returning true if the given SBML Level 3 package is enabled with this object.
The search ignores the package version.
| pkgName | the name of the package |
true if the given package is enabled within this object, false otherwise.| def libsbml.SBase.isPackageURIEnabled | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
isPackageURIEnabled(string pkgURI)bool
Predicate returning true if an SBML Level 3 package with the given URI is enabled with this object.
| pkgURI | the URI of the package |
true if the given package is enabled within this object, false otherwise.| def libsbml.Rule.isParameter | ( | self | ) | [inherited] |
Python method signature(s):
isParameter()bool
Predicate returning true if this Rule is an ParameterRule or equivalent.
This libSBML method works for SBML Level 1 models (where there is such a thing as an explicit ParameterRule), as well as other Levels of SBML. For Levels above Level 1, this method checks the symbol being affected by the rule, and returns true if the symbol is the identifier of a Parameter object defined in the model.
true if this Rule is a ParameterRule, false otherwise. | def libsbml.SBase.isPkgEnabled | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
isPkgEnabled(string pkgName)bool
Predicate returning true if the given SBML Level 3 package is enabled with this object.
The search ignores the package version.
| pkgName | the name of the package |
true if the given package is enabled within this object, false otherwise.| def libsbml.SBase.isPkgURIEnabled | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
isPkgURIEnabled(string pkgURI)bool
Predicate returning true if an SBML Level 3 package with the given URI is enabled with this object.
| pkgURI | the URI of the package |
true if the given package is enabled within this object, false otherwise.| def libsbml.Rule.isRate | ( | self | ) | [inherited] |
| def libsbml.Rule.isScalar | ( | self | ) | [inherited] |
Python method signature(s):
isScalar()bool
Predicate returning true if this Rule is an AssignmentRule (SBML Levels 2–3) or has a 'type' attribute value of 'scalar' (SBML Level 1).
true if this Rule is an AssignmentRule (Level 2) or has type 'scalar' (Level 1), false otherwise. | def libsbml.SBase.isSetAnnotation | ( | self | ) | [inherited] |
Python method signature(s):
isSetAnnotation()bool
Predicate returning true if this object's 'annotation' subelement exists and has content.
Whereas the SBase 'notes' subelement is a container for content to be shown directly to humans, the 'annotation' element is a container for optional software-generated content not meant to be shown to humans. Every object derived from SBase can have its own value for 'annotation'. The element's content type is XML type 'any', allowing essentially arbitrary well-formed XML data content.
SBML places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the SBML specifications for more details.
true if a 'annotation' subelement exists, false otherwise.| def libsbml.Rule.isSetFormula | ( | self | ) | [inherited] |
Python method signature(s):
isSetFormula()bool
Predicate returning true if this Rule's mathematical expression is set.
This method is equivalent to isSetMath(). This version is present for easier compatibility with SBML Level 1, in which mathematical formulas were written in text-string form.
true if the mathematical formula for this Rule is set, false otherwise.| def libsbml.Rule.isSetMath | ( | self | ) | [inherited] |
Python method signature(s):
isSetMath()bool
Predicate returning true if this Rule's mathematical expression is set.
This method is equivalent to isSetFormula().
true if the formula (or equivalently the math) for this Rule is set, false otherwise.| def libsbml.SBase.isSetMetaId | ( | self | ) | [inherited] |
Python method signature(s):
isSetMetaId()bool
Predicate returning true if this object's 'metaid' attribute is set.
The optional attribute named 'metaid', present on every major SBML component type, is for supporting metadata annotations using RDF (Resource Description Format). The attribute value has the data type XML ID, the XML identifier type, which means each 'metaid' value must be globally unique within an SBML file. (Importantly, this uniqueness criterion applies across any attribute with type XML ID, not just the 'metaid' attribute used by SBML—something to be aware of if your application-specific XML content inside the 'annotation' subelement happens to use XML ID.) The 'metaid' value serves to identify a model component for purposes such as referencing that component from metadata placed within 'annotation' subelements.
true if the 'metaid' attribute of this SBML object is set, false otherwise.| def libsbml.SBase.isSetModelHistory | ( | self | ) | [inherited] |
Python method signature(s):
isSetModelHistory()bool
Predicate returning true if this object has a ModelHistory object attached to it.
true if the ModelHistory of this object is set, false otherwise.| def libsbml.SBase.isSetNotes | ( | self | ) | [inherited] |
Python method signature(s):
isSetNotes()bool
Predicate returning true if this object's 'notes' subelement exists and has content.
The optional SBML element named 'notes', present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the 'notes' element would be to contain formatted user comments about the model element in which the 'notes' element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for 'notes', allowing users considerable freedom when adding comments to their models.
The format of 'notes' elements must be XHTML 1.0. To help verify the formatting of 'notes' content, libSBML provides the static utility method SyntaxChecker.hasExpectedXHTMLSyntax(); however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how 'notes' element content must be structured.
true if a 'notes' subelement exists, false otherwise.| def libsbml.SBase.isSetSBOTerm | ( | self | ) | [inherited] |
Python method signature(s):
isSetSBOTerm()bool
Predicate returning true if this object's 'sboTerm' attribute is set.
true if the 'sboTerm' attribute of this SBML object is set, false otherwise. | def libsbml.Rule.isSetUnits | ( | self | ) | [inherited] |
Python method signature(s):
isSetUnits()bool
Predicate returning true if this Rule's 'units' attribute is set.
true if the units for this Rule is set, false otherwise| def libsbml.Rule.isSetVariable | ( | self | ) | [inherited] |
Python method signature(s):
isSetVariable()bool
Predicate returning true if this Rule's 'variable' attribute is set.
In SBML Level 1, the different rule types each have a different name for the attribute holding the reference to the object constituting the left-hand side of the rule. (E.g., for SBML Level 1's SpeciesConcentrationRule the attribute is 'species', for CompartmentVolumeRule it is 'compartment', etc.) In SBML Levels 2 and 3, the only two types of Rule objects with a left-hand side object reference are AssignmentRule and RateRule, and both of them use the same name for attribute: 'variable'. In order to make it easier for application developers to work with all Levels of SBML, libSBML uses a uniform name for all such attributes, and it is 'variable', regardless of whether Level 1 rules or Level 2–3 rules are being used.
true if the 'variable' attribute value of this Rule is set, false otherwise. | def libsbml.Rule.isSpeciesConcentration | ( | self | ) | [inherited] |
Python method signature(s):
isSpeciesConcentration()bool
Predicate returning true if this Rule is a SpeciesConcentrationRule or equivalent.
This libSBML method works for SBML Level 1 models (where there is such a thing as an explicit SpeciesConcentrationRule), as well as other Levels of SBML. For Levels above Level 1, this method checks the symbol being affected by the rule, and returns true if the symbol is the identifier of a Species object defined in the model.
true if this Rule is a SpeciesConcentrationRule, false otherwise. | def libsbml.SBase.matchesSBMLNamespaces | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
matchesSBMLNamespaces(SBase sb)bool
Returns true if this object's set of XML namespaces are the same as the given object's XML namespaces.
| sb | an object to compare with respect to namespaces |
true if this object's collection of namespaces is the same as sb's, false otherwise. | def libsbml.SBase.removeFromParentAndDelete | ( | self | ) | [inherited] |
Python method signature(s):
removeFromParentAndDelete()int
Removes itself from its parent. If the parent was storing it as a pointer, it is deleted. If not, it is simply cleared (as in ListOf objects). Pure virutal, as every SBase element has different parents, and therefore different methods of removing itself. Will fail (and not delete itself) if it has no parent object. This function is designed to be overridden, but for all objects whose parent is of the class ListOf, the default implementation will work.
Reimplemented in libsbml.ListOf, libsbml.Model, libsbml.KineticLaw, libsbml.Trigger, libsbml.Delay, libsbml.Priority, and libsbml.StoichiometryMath.
| def libsbml.SBase.renameMetaIdRefs | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
renameMetaIdRefs(string oldid, string newid)
Renames all the MetaIdRef attributes on this element.
This method works by looking at all meta-attribute values, 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.
| oldid | the old identifier | |
| newid | the new identifier |
| def libsbml.Rule.renameSIdRefs | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
renameSIdRefs(string oldid, string newid)
Renames all the SIdRef attributes on this element, including any found in MathML
Reimplemented from libsbml.SBase.
Reimplemented in libsbml.AssignmentRule, and libsbml.RateRule.
| def libsbml.Rule.renameUnitSIdRefs | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
renameUnitSIdRefs(string oldid, string newid)
Renames all the UnitSIdRef attributes on this element
Reimplemented from libsbml.SBase.
| def libsbml.SBase.setAnnotation | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setAnnotation(XMLNode annotation)int setAnnotation(string annotation)
int
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
setAnnotation(XMLNode annotation)
Sets the value of the 'annotation' subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's 'annotation' subelement is deleted.
Whereas the SBase 'notes' subelement is a container for content to be shown directly to humans, the 'annotation' element is a container for optional software-generated content not meant to be shown to humans. Every object derived from SBase can have its own value for 'annotation'. The element's content type is XML type 'any', allowing essentially arbitrary well-formed XML data content.
SBML places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the SBML specifications for more details.
Call this method will result in any existing content of the 'annotation' subelement to be discarded. Unless you have taken steps to first copy and reconstitute any existing annotations into the annotation that is about to be assigned, it is likely that performing such wholesale replacement is unfriendly towards other software applications whose annotations are discarded. An alternative may be to use SBase.appendAnnotation() or SBase.appendAnnotation().
| annotation | an XML structure that is to be used as the new content of the 'annotation' subelement of this object |
setAnnotation(string annotation)
Sets the value of the 'annotation' subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's 'annotation' subelement is deleted.
Whereas the SBase 'notes' subelement is a container for content to be shown directly to humans, the 'annotation' element is a container for optional software-generated content not meant to be shown to humans. Every object derived from SBase can have its own value for 'annotation'. The element's content type is XML type 'any', allowing essentially arbitrary well-formed XML data content.
SBML places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the SBML specifications for more details.
Call this method will result in any existing content of the 'annotation' subelement to be discarded. Unless you have taken steps to first copy and reconstitute any existing annotations into the annotation that is about to be assigned, it is likely that performing such wholesale replacement is unfriendly towards other software applications whose annotations are discarded. An alternative may be to use SBase.appendAnnotation() or SBase.appendAnnotation().
| annotation | an XML string that is to be used as the content of the 'annotation' subelement of this object |
Reimplemented in libsbml.Model, and libsbml.SpeciesReference.
| def libsbml.Rule.setFormula | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setFormula(string formula)int
Sets the 'math' subelement of this Rule to an expression in text-string form.
This is equivalent to setMath(ASTNode math). The provision of using text-string formulas is retained for easier SBML Level 1 compatibility. The formula is converted to an ASTNode internally.
| formula | a mathematical formula in text-string form. |
| def libsbml.Rule.setL1TypeCode | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setL1TypeCode(int type)int
Sets the SBML Level 1 type code for this Rule.
| type | the SBML Level 1 type code for this Rule. The allowable values are SBML_COMPARTMENT_VOLUME_RULE, SBML_PARAMETER_RULE, and SBML_SPECIES_CONCENTRATION_RULE. |
type value is not one of the above. | def libsbml.Rule.setMath | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setMath(ASTNode math)int
Sets the 'math' subelement of this Rule to a copy of the given ASTNode.
| math | the ASTNode structure of the mathematical formula. |
| def libsbml.SBase.setMetaId | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setMetaId(string metaid)int
Sets the value of the 'metaid' attribute of this object.
The string metaid is copied. The value of metaid must be an identifier conforming to the syntax defined by the XML 1.0 data type ID. Among other things, this type requires that a value is unique among all the values of type XML ID in an SBMLDocument. Although SBML only uses XML ID for the 'metaid' attribute, callers should be careful if they use XML ID's in XML portions of a model that are not defined by SBML, such as in the application-specific content of the 'annotation' subelement.
| metaid | the identifier string to use as the value of the 'metaid' attribute |
| def libsbml.SBase.setModelHistory | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setModelHistory(ModelHistory history)int
Sets the ModelHistory of this object.
The content of history is copied, and this object's existing model history content is deleted.
| history | ModelHistory of this object. |
| def libsbml.SBase.setNamespaces | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setNamespaces(XMLNamespaces xmlns)int
Sets the namespaces relevant of this SBML object.
The content of xmlns is copied, and this object's existing namespace content is deleted.
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.
| xmlns | the namespaces to set |
| def libsbml.SBase.setNotes | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setNotes(XMLNode notes)int setNotes(string notes)
int
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
setNotes(string notes)
Sets the value of the 'notes' subelement of this SBML object to a copy of the string notes.
The content of notes is copied, and any existing content of this object's 'notes' subelement is deleted.
The optional SBML element named 'notes', present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the 'notes' element would be to contain formatted user comments about the model element in which the 'notes' element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for 'notes', allowing users considerable freedom when adding comments to their models.
The format of 'notes' elements must be XHTML 1.0. To help verify the formatting of 'notes' content, libSBML provides the static utility method SyntaxChecker.hasExpectedXHTMLSyntax(); however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how 'notes' element content must be structured.
The following code illustrates a very simple way of setting the notes using this method. Here, the object being annotated is the whole SBML document, but that is for illustration purposes only; you could of course use this same approach to annotate any other SBML component.
| notes | an XML string that is to be used as the content of the 'notes' subelement of this object |
setNotes(XMLNode notes)
Sets the value of the 'notes' subelement of this SBML object.
The content of notes is copied, and any existing content of this object's 'notes' subelement is deleted.
The optional SBML element named 'notes', present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the 'notes' element would be to contain formatted user comments about the model element in which the 'notes' element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for 'notes', allowing users considerable freedom when adding comments to their models.
The format of 'notes' elements must be XHTML 1.0. To help verify the formatting of 'notes' content, libSBML provides the static utility method SyntaxChecker.hasExpectedXHTMLSyntax(); however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how 'notes' element content must be structured.
| notes | an XML structure that is to be used as the content of the 'notes' subelement of this object |
| def libsbml.SBase.setSBOTerm | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setSBOTerm(int value)int setSBOTerm(string sboid)
int
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
setSBOTerm(int value)
Sets the value of the 'sboTerm' attribute.
Beginning with SBML Level 2 Version 3, objects derived from SBase have an optional attribute named 'sboTerm' for supporting the use of the Systems Biology Ontology. In SBML proper, the data type of the attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a seven digit integer number; libSBML simplifies the representation by only storing the 'NNNNNNN' integer portion. Thus, in libSBML, the 'sboTerm' attribute on SBase has data type int, and SBO identifiers are stored simply as integers.
SBO terms are a type of optional annotation, and each different class of SBML object derived from SBase imposes its own requirements about the values permitted for 'sboTerm'. Please consult the SBML Level 2 Version 4 specification for more information about the use of SBO and the 'sboTerm' attribute.
| value | the NNNNNNN integer portion of the SBO identifier |
setSBOTerm(string &sboid)
Sets the value of the 'sboTerm' attribute by string.
Beginning with SBML Level 2 Version 3, objects derived from SBase have an optional attribute named 'sboTerm' for supporting the use of the Systems Biology Ontology. In SBML proper, the data type of the attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a seven digit integer number; libSBML simplifies the representation by only storing the 'NNNNNNN' integer portion. Thus, in libSBML, the 'sboTerm' attribute on SBase has data type int, and SBO identifiers are stored simply as integers. This method lets you set the value of 'sboTerm' as a complete string of the form 'SBO:NNNNNNN', whereas setSBOTerm(int value) allows you to set it using the integer form.
SBO terms are a type of optional annotation, and each different class of SBML object derived from SBase imposes its own requirements about the values permitted for 'sboTerm'. Please consult the SBML Level 2 Version 4 specification for more information about the use of SBO and the 'sboTerm' attribute.
| sboid | the SBO identifier string of the form 'SBO:NNNNNNN' |
| def libsbml.Rule.setUnits | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setUnits(string sname)int
Sets the units for this Rule.
| sname | the identifier of the units |
| def libsbml.Rule.setVariable | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setVariable(string sid)int
Sets the 'variable' attribute value of this Rule object.
In SBML Level 1, the different rule types each have a different name for the attribute holding the reference to the object constituting the left-hand side of the rule. (E.g., for SBML Level 1's SpeciesConcentrationRule the attribute is 'species', for CompartmentVolumeRule it is 'compartment', etc.) In SBML Levels 2 and 3, the only two types of Rule objects with a left-hand side object reference are AssignmentRule and RateRule, and both of them use the same name for attribute: 'variable'. In order to make it easier for application developers to work with all Levels of SBML, libSBML uses a uniform name for all such attributes, and it is 'variable', regardless of whether Level 1 rules or Level 2–3 rules are being used.
| sid | the identifier of a Compartment, Species or Parameter elsewhere in the enclosing Model object. |
| def libsbml.SBase.toSBML | ( | self | ) | [inherited] |
Python method signature(s):
toSBML()string
Returns a string consisting of a partial SBML corresponding to just this object.
| def libsbml.SBase.unsetAnnotation | ( | self | ) | [inherited] |
Python method signature(s):
unsetAnnotation()int
Unsets the value of the 'annotation' subelement of this SBML object.
Whereas the SBase 'notes' subelement is a container for content to be shown directly to humans, the 'annotation' element is a container for optional software-generated content not meant to be shown to humans. Every object derived from SBase can have its own value for 'annotation'. The element's content type is XML type 'any', allowing essentially arbitrary well-formed XML data content.
SBML places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the SBML specifications for more details.
| def libsbml.SBase.unsetCVTerms | ( | self | ) | [inherited] |
Python method signature(s):
unsetCVTerms()int
Clears the list of CVTerm objects attached to this SBML object.
| def libsbml.SBase.unsetId | ( | self | ) | [inherited] |
Python method signature(s):
unsetId()int
Unsets the value of the 'id' attribute of this SBML object.
Most (but not all) objects in SBML include two common attributes: 'id' and 'name'. The identifier given by an object's 'id' attribute value is used to identify the object within the SBML model definition. Other objects can refer to the component using this identifier. The data type of 'id' is always either Sid or UnitSId, depending on the object in question. Both data types are defined as follows:
letter ::= 'a'..'z','A'..'Z' digit ::= '0'..'9' idChar ::= letter | digit | '_' SId ::= ( letter | '_' ) idChar*
The equality of SId and UnitSId type values in SBML is determined by an exact character sequence match; i.e., comparisons of these identifiers must be performed in a case-sensitive manner. This applies to all uses of SId and UnitSId.
Reimplemented in libsbml.Model, libsbml.SimpleSpeciesReference, and libsbml.Event.
| def libsbml.SBase.unsetMetaId | ( | self | ) | [inherited] |
Python method signature(s):
unsetMetaId()int
Unsets the value of the 'metaid' attribute of this SBML object.
The optional attribute named 'metaid', present on every major SBML component type, is for supporting metadata annotations using RDF (Resource Description Format). The attribute value has the data type XML ID, the XML identifier type, which means each 'metaid' value must be globally unique within an SBML file. (Importantly, this uniqueness criterion applies across any attribute with type XML ID, not just the 'metaid' attribute used by SBML—something to be aware of if your application-specific XML content inside the 'annotation' subelement happens to use XML ID.) The 'metaid' value serves to identify a model component for purposes such as referencing that component from metadata placed within 'annotation' subelements.
| def libsbml.SBase.unsetModelHistory | ( | self | ) | [inherited] |
Python method signature(s):
unsetModelHistory()int
Unsets the ModelHistory object attached to this object.
| def libsbml.SBase.unsetName | ( | self | ) | [inherited] |
Python method signature(s):
unsetName()int
Unsets the value of the 'name' attribute of this SBML object.
Most (but not all) objects in SBML include two common attributes: 'id' and 'name'. In contrast to the 'id' attribute, the 'name' attribute is optional and is not intended to be used for cross-referencing purposes within a model. Its purpose instead is to provide a human-readable label for the component. The data type of 'name' is the type string defined in XML Schema. SBML imposes no restrictions as to the content of 'name' attributes beyond those restrictions defined by the string type in XML Schema.
The recommended practice for handling 'name' is as follows. If a software tool has the capability for displaying the content of 'name' attributes, it should display this content to the user as a component's label instead of the component's 'id'. If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the 'name' attribute is missing on a given component, then the user interface should display the value of the 'id' attribute instead. (Script language interpreters are especially likely to display 'id' instead of 'name'.)
As a consequence of the above, authors of systems that automatically generate the values of 'id' attributes should be aware some systems may display the 'id''s to the user. Authors therefore may wish to take some care to have their software create 'id' values that are: (a) reasonably easy for humans to type and read; and (b) likely to be meaningful, for example by making the 'id' attribute be an abbreviated form of the name attribute value.
An additional point worth mentioning is although there are restrictions on the uniqueness of 'id' values, there are no restrictions on the uniqueness of 'name' values in a model. This allows software applications leeway in assigning component identifiers.
Reimplemented in libsbml.Model, libsbml.FunctionDefinition, libsbml.UnitDefinition, libsbml.CompartmentType, libsbml.SpeciesType, libsbml.Compartment, libsbml.Species, libsbml.Parameter, libsbml.Reaction, libsbml.SimpleSpeciesReference, and libsbml.Event.
| def libsbml.SBase.unsetNotes | ( | self | ) | [inherited] |
Python method signature(s):
unsetNotes()int
Unsets the value of the 'notes' subelement of this SBML object.
The optional SBML element named 'notes', present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the 'notes' element would be to contain formatted user comments about the model element in which the 'notes' element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for 'notes', allowing users considerable freedom when adding comments to their models.
The format of 'notes' elements must be XHTML 1.0. To help verify the formatting of 'notes' content, libSBML provides the static utility method SyntaxChecker.hasExpectedXHTMLSyntax(); however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how 'notes' element content must be structured.
| def libsbml.SBase.unsetSBOTerm | ( | self | ) | [inherited] |
Python method signature(s):
unsetSBOTerm()int
Unsets the value of the 'sboTerm' attribute of this SBML object.
| def libsbml.Rule.unsetUnits | ( | self | ) | [inherited] |
Python method signature(s):
unsetUnits()int
Unsets the 'units' for this Rule.