
When creating fresh models programmatically, the starting point is typically the creation of an SBMLDocument object instance. The SBMLDocument constructor accepts arguments for the SBML Level and Version of the model to be created. After creating the SBMLDocument object, calling programs then typically call SBMLDocument.createModel() almost immediately, and then proceed to call the methods on the Model object to fill out the model's contents.
SBMLDocument corresponds roughly to the class Sbml defined in the SBML Level 2 specification. It does not have a direct correspondence in SBML Level 1. (However, to make matters simpler for applications, libSBML creates an SBMLDocument no matter whether the model is Level 1 or Level 2.) In its barest form, when written out in XML format for SBML Level 2 Version 4, the corresponding structure is the following:
<sbml xmlns='http://www.sbml.org/sbml/level2/version4' level='2' version='4' ... </sbml>
SBMLDocument is derived from SBase, and therefore contains the usual SBase attributes (in SBML Level 2 Version 4) of 'metaid' and 'sboTerm', as well as the subelements 'notes' and 'annotation'. It also contains the attributes 'level' and 'version' indicating the Level and Version of the SBML data structure. These can be accessed using the methods defined by the SBase class for that purpose.
First, a brief explanation of the rationale is in order. In libSBML versions up to and including the version 3.3.x series, the individual methods for creating and setting attributes and other components are quite lenient, and allow a caller to compose SBML entities that may not, in the end, represent valid SBML. This allows applications the freedom to do things such as save incomplete models (which is useful when models are being developed over long periods of time), but at the same time, it means that a separate validation step is necessary when a calling program finally wants to finish a complete SBML document.
The primary interface to this facility is SBMLDocument's SBMLDocument.checkInternalConsistency() and SBMLDocument.checkConsistency(). The former verifies the basic internal consistency and syntax of an SBML document, and the latter implements more elaborate validation rules (both those defined by the SBML specifications, as well as additional rules offered by libSBML).
These methods have slightly different relevance depending on whether a model is created programmaticaly from scratch, or whether it is read in from a file or data stream. The following table summarizes the possible scenarios.
| Scenario | Relevant methods |
|---|---|
| Creating a model from scratch | Before writing out the model:
|
| Reading a model from a file or data stream | After reading the model:
|
Calling will not necessarily lead to a successful conversion. The method will return a boolean value to indicate success or failure. Callers must check the error log (see next section) attached to the SBMLDocument object after calling in order to assess whether any problems arose.
If an application is interested in translating to a lower Level and/or Version of SBML within a Level, the following methods allow for prior assessment of whether there is sufficient compatibility to make a translation possible:
The methods SBMLDocument.getNumErrors(), and SBMLDocument.printErrors() allow callers to interact with the warnings or errors logged. Alternatively, callers may retrieve the entire log as an SBMLErrorLog object using the method SBMLDocument.getErrorLog(). The SBMLErrorLog object provides some alternative methods for interacting with the set of errors and warnings. In either case, applications typically should first call SBMLDocument.getNumErrors() to find out if any issues have been logged after specific libSBML operations such as the ones discussed in the sections above. If they have, then an application will should proceed to inspect the individual reports using either the direct interfaces on SBMLDocument or using the methods on the SBMLErrorLog object.
Definition at line 6073 of file libsbml.py.
| def libsbml.SBase.__eq__ | ( | self, | ||
| rhs | ||||
| ) | [inherited] |
Definition at line 3296 of file libsbml.py.
| def libsbml.SBase.__init__ | ( | self, | ||
| args, | ||||
| kwargs | ||||
| ) | [inherited] |
| def libsbml.SBMLDocument.__init__ | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
__init__(self, unsigned int level = 0, unsigned int version = 0)SBMLDocument __init__(self, unsigned int level = 0)
SBMLDocument __init__(self)
SBMLDocument __init__(self, SBMLDocument rhs)
SBMLDocument
Copy constructor; creates a copy of this SBMLDocument.
Definition at line 6342 of file libsbml.py.
| def libsbml.SBase.__ne__ | ( | self, | ||
| rhs | ||||
| ) | [inherited] |
Definition at line 3303 of file libsbml.py.
| def libsbml.SBase.addCVTerm | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
addCVTerm(self, CVTerm term)int
Adds a copy of the given CVTerm to this SBML object.
| term | the CVTerm to assign |
Definition at line 2974 of file libsbml.py.
| def libsbml.SBase.appendAnnotation | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
appendAnnotation(self, XMLNode annotation)int appendAnnotation(self, string annotation)
int
Appends the annotation content given by annotation to any existing content in 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(const XMLNode* annotation) or SBase.setAnnotation(const std.string& annotation), this method allows other annotations to be preserved when an application adds its own data.
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
| annotation | an XML string that is to be copied and appended to the content of the 'annotation' subelement of this object |
setAnnotation(const XMLNode* annotation)
setAnnotation(const std.string& annotation)
appendAnnotation(const XMLNode* annotation)
Reimplemented in libsbml.Model, and libsbml.SpeciesReference.
Definition at line 2624 of file libsbml.py.
| def libsbml.SBase.appendNotes | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
appendNotes(self, XMLNode notes)int appendNotes(self, string notes)
int
Appends notes content to the 'notes' element attached to this object.
The content in notes is copied.
The optional 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. The SBML Level 2 specification has considerable detail about how 'notes' element content must be handled; please refer to the specifications.
| notes | an XML string that is to appended to the content of the 'notes' subelement of this object |
setNotes(const XMLNode* notes)
setNotes(const std.string& notes)
appendNotes(const XMLNode* notes)
Definition at line 2726 of file libsbml.py.
| def libsbml.SBMLDocument.checkConsistency | ( | self | ) |
Python method signature(s):
checkConsistency(self)unsigned int
Performs consistency checking and validation on this SBML document.
If this method returns a nonzero value (meaning, one or more consistency checks have failed for SBML document), the failures may be due to warnings or errors. Callers should inspect the severity flag in the individual SBMLError objects returned by to determine the nature of the failures.
Definition at line 6712 of file libsbml.py.
| def libsbml.SBMLDocument.checkInternalConsistency | ( | self | ) |
Python method signature(s):
checkInternalConsistency(self)unsigned int
Performs consistency checking on libSBML's internal representation of an SBML Model.
Callers should query the results of the consistency check by calling
Definition at line 6735 of file libsbml.py.
| def libsbml.SBMLDocument.checkL1Compatibility | ( | self | ) |
Python method signature(s):
checkL1Compatibility(self)unsigned int
Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 1 and can be converted to Level 1.
Callers should query the results of the consistency check by calling
Definition at line 6764 of file libsbml.py.
| def libsbml.SBMLDocument.checkL2v1Compatibility | ( | self | ) |
Python method signature(s):
checkL2v1Compatibility(self)unsigned int
Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 2 Version 1 and can be converted to Level 2 Version 1.
Callers should query the results of the consistency check by calling
Definition at line 6784 of file libsbml.py.
| def libsbml.SBMLDocument.checkL2v2Compatibility | ( | self | ) |
Python method signature(s):
checkL2v2Compatibility(self)unsigned int
Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 2 Version 2 and can be converted to Level 2 Version 2.
Callers should query the results of the consistency check by calling
Definition at line 6804 of file libsbml.py.
| def libsbml.SBMLDocument.checkL2v3Compatibility | ( | self | ) |
Python method signature(s):
checkL2v3Compatibility(self)unsigned int
Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 2 Version 3 and can be converted to Level 2 Version 3.
Callers should query the results of the consistency check by calling
Definition at line 6824 of file libsbml.py.
| def libsbml.SBMLDocument.checkL2v4Compatibility | ( | self | ) |
Python method signature(s):
checkL2v4Compatibility(self)unsigned int
Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 2 Version 4 and can be converted to Level 2 Version 4.
Callers should query the results of the consistency check by calling
Definition at line 6844 of file libsbml.py.
| def libsbml.SBMLDocument.clone | ( | self | ) |
Python method signature(s):
clone(self)SBMLDocument
Creates and returns a deep copy of this SBMLDocument.
Reimplemented from libsbml.SBase.
Definition at line 6359 of file libsbml.py.
| def libsbml.SBMLDocument.createModel | ( | self, | ||
sid = "" | ||||
| ) |
Python method signature(s):
createModel(self, string sid = "")Model createModel(self)
Model
Creates a new Model inside this SBMLDocument, and returns a pointer to it.
In SBML Level 2, the use of an identifier on a Model object is optional. This method takes an optional argument, sid, for setting the identifier. If not supplied, the identifier attribute on the Model instance is not set.
| sid | the identifier of the new Model to create. |
Definition at line 6498 of file libsbml.py.
| def libsbml.SBase.getAncestorOfType | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
getAncestorOfType(self, SBMLTypeCode_t type)SBase
Returns the ancestor SBML object that corresponds to the given SBMLTypeCode_t.
This function allows any object to determine its exact location/function within a model. For example a StoichiometryMath object has ancestors of type SpeciesReference, ListOfProducts/ListOfReactants/ListOfModifiers, Reaction, ListOfReactions and Model; any of which can be accessed via this function.
| type | the SBMLTypeCode_t of the ancestor to be returned. |
Definition at line 2115 of file libsbml.py.
| def libsbml.SBase.getAnnotation | ( | self | ) | [inherited] |
Python method signature(s):
getAnnotation(self)XMLNode
Returns the content of the 'annotation' subelement of this object as an XML node tree.
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.
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.
setAnnotation(const XMLNode* annotation)
setAnnotation(const std.string& annotation)
appendAnnotation(const XMLNode* annotation)
appendAnnotation(const std.string& annotation)
Definition at line 1971 of file libsbml.py.
| def libsbml.SBase.getAnnotationString | ( | self | ) | [inherited] |
Python method signature(s):
getAnnotationString(self)string
Returns the content of the 'annotation' subelement of this object as a character string.
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.
The annotations returned by this method will be in string form.
setAnnotation(const XMLNode* annotation)
setAnnotation(const std.string& annotation)
appendAnnotation(const XMLNode* annotation)
appendAnnotation(const std.string& annotation)
Definition at line 2014 of file libsbml.py.
| def libsbml.SBase.getColumn | ( | self | ) | [inherited] |
Python method signature(s):
getColumn(self)unsigned int
Returns the column number on which this object first appears in the XML representation of the SBML document.
Definition at line 2217 of file libsbml.py.
| def libsbml.SBase.getCVTerm | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
getCVTerm(self, unsigned int n)CVTerm
Returns the nth CVTerm in the list of CVTerms of this SBML object.
| n | unsigned int the index of the CVTerm to retrieve |
Definition at line 3042 of file libsbml.py.
| def libsbml.SBase.getCVTerms | ( | self | ) | [inherited] |
Python method signature(s):
getCVTerms(self)CVTermList
Get the CVTermList of CVTerm objects in this SBase.
Definition at line 3010 of file libsbml.py.
| def libsbml.SBMLDocument.getDefaultLevel | ( | ) |
Python method signature(s):
getDefaultLevel()unsigned int
The default SBML Level of new SBMLDocument objects.
This 'default level' corresponds to the most recent SBML specification Level available at the time this version of libSBML was released. For this copy of libSBML, the value is 2. The default Level is used by SBMLDocument if no Level is explicitly specified at the time of the construction of an SBMLDocument instance.
Definition at line 6288 of file libsbml.py.
| def libsbml.SBMLDocument.getDefaultVersion | ( | ) |
Python method signature(s):
getDefaultVersion()unsigned int
The default Version of new SBMLDocument objects.
This 'default version' corresponds to the most recent SBML Version within the most recent Level of SBML available at the time this version of libSBML was released. For this copy of libSBML, the value is 4. The default Version is used by SBMLDocument if no Version is explicitly specified at the time of the construction of an SBMLDocument instance.
Definition at line 6313 of file libsbml.py.
| def libsbml.SBMLDocument.getElementName | ( | self | ) |
Python method signature(s):
getElementName(self)string
Returns the XML element name of this object, which for SBMLDocument, is always 'sbml'.
'sbml'. Reimplemented from libsbml.SBase.
Definition at line 6971 of file libsbml.py.
| def libsbml.SBMLDocument.getError | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
getError(self, unsigned int n)SBMLError
Returns the nth error or warning encountered during parsing, consistency checking, or attempted translation of this model.
Callers can use method XMLError.getSeverity() on the result to assess the severity of the problem. The possible severity levels range from informational messages to fatal errors.
n, or return NULL if n > (getNumErrors() - 1).| n | the integer index of the error sought. |
Definition at line 6864 of file libsbml.py.
| def libsbml.SBMLDocument.getErrorLog | ( | self | ) |
Python method signature(s):
getErrorLog(self)SBMLErrorLog
Returns the list of errors or warnings logged during parsing, consistency checking, or attempted translation of this model.
Definition at line 6987 of file libsbml.py.
| def libsbml.SBase.getId | ( | self | ) | [inherited] |
Python method signature(s):
getId(self)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.
setMetaId(const std.string& metaid)
Reimplemented in libsbml.Model, libsbml.FunctionDefinition, libsbml.UnitDefinition, libsbml.CompartmentType, libsbml.SpeciesType, libsbml.Compartment, libsbml.Species, libsbml.Parameter, libsbml.InitialAssignment, libsbml.Rule, libsbml.Reaction, libsbml.SimpleSpeciesReference, libsbml.Event, and libsbml.EventAssignment.
Definition at line 1823 of file libsbml.py.
| def libsbml.SBase.getLevel | ( | self | ) | [inherited] |
Python method signature(s):
getLevel(self)unsigned int
Returns the SBML Level of the overall SBML document.
Definition at line 3134 of file libsbml.py.
| def libsbml.SBase.getLine | ( | self | ) | [inherited] |
Python method signature(s):
getLine(self)unsigned int
Returns the line number on which this object first appears in the XML representation of the SBML document.
Definition at line 2199 of file libsbml.py.
| def libsbml.SBase.getMetaId | ( | self | ) | [inherited] |
Python method signature(s):
getMetaId(self)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.
setMetaId(const std.string& metaid)
Definition at line 1790 of file libsbml.py.
| def libsbml.SBase.getModel | ( | self | ) | [inherited] |
Python method signature(s):
getModel(self)Model
Returns the Model object in which the current object is located.
Definition at line 3119 of file libsbml.py.
| def libsbml.SBMLDocument.getModel | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
getModel(self)Model getModel(self)
Model
Returns the Model object stored in this SBMLDocument.
It is important to note that this method does not create a Model instance. The model in the SBMLDocument must have been created at some prior time, for example using SBMLDocument.createModel() or . This method returns NULL if a model does not yet exist.
Definition at line 6374 of file libsbml.py.
| def libsbml.SBase.getName | ( | self | ) | [inherited] |
Python method signature(s):
getName(self)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.
setMetaId(const std.string& metaid)
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.
Definition at line 1857 of file libsbml.py.
| def libsbml.SBMLDocument.getNamespaces | ( | self | ) |
Python method signature(s):
getNamespaces(self)XMLNamespaces
Returns a list of XML Namespaces associated with the XML content of this SBML document.
Reimplemented from libsbml.SBase.
Definition at line 7005 of file libsbml.py.
| def libsbml.SBase.getNotes | ( | self | ) | [inherited] |
Python method signature(s):
getNotes(self)XMLNode
Returns the content of the 'notes' subelement of this object as a tree of XML nodes.
The optional 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. The SBML Level 2 specification has considerable detail about how 'notes' element content must be handled; please refer to the specifications.
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.
setNotes(const XMLNode* notes)
setNotes(const std.string& notes)
appendNotes(const XMLNode* notes)
appendNotes(const std.string& notes)
Definition at line 1891 of file libsbml.py.
| def libsbml.SBase.getNotesString | ( | self | ) | [inherited] |
Python method signature(s):
getNotesString(self)string
Returns the content of the 'notes' subelement of this object as a string.
The optional 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. The SBML Level 2 specification has considerable detail about how 'notes' element content must be handled; please refer to the specifications.
setNotes(const XMLNode* notes)
setNotes(const std.string& notes)
appendNotes(const XMLNode* notes)
appendNotes(const std.string& notes)
Definition at line 1934 of file libsbml.py.
| def libsbml.SBase.getNumCVTerms | ( | self | ) | [inherited] |
Python method signature(s):
getNumCVTerms(self)unsigned int
Returns the number of CVTerm objects in the annotations of this SBML object.
Definition at line 3026 of file libsbml.py.
| def libsbml.SBMLDocument.getNumErrors | ( | self | ) |
Python method signature(s):
getNumErrors(self)unsigned int
Returns the number of errors or warnings encountered during parsing, consistency checking, or attempted translation of this model.
Definition at line 6889 of file libsbml.py.
| def libsbml.SBase.getParentSBMLObject | ( | self | ) | [inherited] |
Python method signature(s):
getParentSBMLObject(self)SBase
Returns the parent SBML object.
This method is convenient when holding an object nested inside other objects in an SBML model. It allows direct access to the <model> element containing it.
Definition at line 2096 of file libsbml.py.
| def libsbml.SBase.getResourceBiologicalQualifier | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
getResourceBiologicalQualifier(self, string resource)BiolQualifierType_t
Returns the BiologicalQualifier associated with this resource, or BQB_UNKNOWN if the resource does not exist.
| resource | string representing the resource; e.g., 'http://www.geneontology.org/GO:0005892' |
Definition at line 3081 of file libsbml.py.
| def libsbml.SBase.getResourceModelQualifier | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
getResourceModelQualifier(self, string resource)ModelQualifierType_t
Returns the ModelQualifier associated with this resource, or BQM_UNKNOWN if the resource does not exist.
| resource | string representing the resource; e.g., 'http://www.geneontology.org/GO:0005892' |
Definition at line 3100 of file libsbml.py.
| def libsbml.SBase.getSBMLDocument | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
getSBMLDocument(self)SBMLDocument getSBMLDocument(self)
SBMLDocument
Returns the parent SBMLDocument object.
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 2 specification, 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 or Level 2.)
This method allows the SBMLDocument for the current object to be retrieved.
Definition at line 2068 of file libsbml.py.
| def libsbml.SBase.getSBOTerm | ( | self | ) | [inherited] |
Python method signature(s):
getSBOTerm(self)int
Returns the integer portion of the value of the 'sboTerm' attribute of this object.
In SBML Level 2 Versions 2, 3 and 4, 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.
-1 if the value is not set. Definition at line 2141 of file libsbml.py.
| def libsbml.SBase.getSBOTermID | ( | self | ) | [inherited] |
Python method signature(s):
getSBOTermID(self)string
Returns the string representation of the 'sboTerm' attribute of this object.
In SBML Level 2 Versions 2, 3 and 4, 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 function recreates the string representation from the stored value. 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.
Definition at line 2169 of file libsbml.py.
| def libsbml.SBMLDocument.getTypeCode | ( | self | ) |
Python method signature(s):
getTypeCode(self)SBMLTypeCode_t
Returns the libSBML type code for this SBML object.
SBML_UNKNOWN (default).Reimplemented from libsbml.SBase.
Definition at line 6942 of file libsbml.py.
| def libsbml.SBase.getVersion | ( | self | ) | [inherited] |
Python method signature(s):
getVersion(self)unsigned int
Returns the Version within the SBML Level of the overall SBML document.
Definition at line 3151 of file libsbml.py.
| def libsbml.SBase.hasRequiredAttributes | ( | self | ) | [inherited] |
Python method signature(s):
hasRequiredAttributes(self)bool
Subclasses should override this method to write out their contained SBML objects as XML elements. Be sure to call your parents implementation of this method as well. For example:
SBase.writeElements(stream); mReactans.write(stream); mProducts.write(stream); ...
Reimplemented in libsbml.FunctionDefinition, libsbml.Unit, libsbml.UnitDefinition, libsbml.CompartmentType, libsbml.SpeciesType, libsbml.Compartment, libsbml.Species, libsbml.Parameter, libsbml.InitialAssignment, libsbml.Rule, libsbml.AlgebraicRule, libsbml.AssignmentRule, libsbml.RateRule, libsbml.Reaction, libsbml.KineticLaw, libsbml.SpeciesReference, libsbml.ModifierSpeciesReference, and libsbml.EventAssignment.
Definition at line 3254 of file libsbml.py.
| def libsbml.SBase.hasRequiredElements | ( | self | ) | [inherited] |
Python method signature(s):
hasRequiredElements(self)bool
Subclasses should override this method to write out their contained SBML objects as XML elements. Be sure to call your parents implementation of this method as well. For example:
SBase.writeElements(stream); mReactans.write(stream); mProducts.write(stream); ...
Reimplemented in libsbml.Model, libsbml.FunctionDefinition, libsbml.UnitDefinition, libsbml.InitialAssignment, libsbml.Rule, libsbml.Constraint, libsbml.KineticLaw, libsbml.Event, libsbml.EventAssignment, libsbml.Trigger, libsbml.Delay, and libsbml.StoichiometryMath.
Definition at line 3275 of file libsbml.py.
| def libsbml.SBase.hasValidLevelVersionNamespaceCombination | ( | self | ) | [inherited] |
Python method signature(s):
hasValidLevelVersionNamespaceCombination(self)bool
Predicate returning true or false depending on whether this object's level/version and namespace values correspond to a valid SBML specification.
The valid combinations of SBML Level, Version and Namespace as of this release of libSBML are the following:
true if the level, version and namespace values of this SBML object correspond to a valid set of values, false otherwise. Definition at line 3192 of file libsbml.py.
| def libsbml.SBase.isSetAnnotation | ( | self | ) | [inherited] |
Python method signature(s):
isSetAnnotation(self)bool
Predicate returning true or false depending on whether 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.
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
true if a 'annotation' subelement exists, false otherwise.setAnnotation(const XMLNode* annotation)
setAnnotation(const std.string& annotation)
appendAnnotation(const XMLNode* annotation)
appendAnnotation(const std.string& annotation)
Definition at line 2387 of file libsbml.py.
| def libsbml.SBase.isSetId | ( | self | ) | [inherited] |
Python method signature(s):
isSetId(self)bool
Predicate returning true or false depending on whether this object's 'metaid' attribute has been 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.
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
true if the 'metaid' attribute of this SBML object has been set, false otherwise.setMetaId(const std.string& metaid)
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.
Definition at line 2272 of file libsbml.py.
| def libsbml.SBase.isSetMetaId | ( | self | ) | [inherited] |
Python method signature(s):
isSetMetaId(self)bool
Predicate returning true or false depending on whether this object's 'metaid' attribute has been 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.
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
true if the 'metaid' attribute of this SBML object has been set, false otherwise.setMetaId(const std.string& metaid)
Definition at line 2235 of file libsbml.py.
| def libsbml.SBase.isSetName | ( | self | ) | [inherited] |
Python method signature(s):
isSetName(self)bool
Predicate returning true or false depending on whether this object's 'metaid' attribute has been 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.
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
true if the 'metaid' attribute of this SBML object has been set, false otherwise.setMetaId(const std.string& metaid)
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.
Definition at line 2310 of file libsbml.py.
| def libsbml.SBase.isSetNotes | ( | self | ) | [inherited] |
Python method signature(s):
isSetNotes(self)bool
Predicate returning true or false depending on whether this object's 'notes' subelement exists and has content.
The optional 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. The SBML Level 2 specification has considerable detail about how 'notes' element content must be handled; please refer to the specifications.
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
true if a 'notes' subelement exists, false otherwise.setNotes(const XMLNode* notes)
setNotes(const std.string& notes)
appendNotes(const XMLNode* notes)
appendNotes(const std.string& notes)
Definition at line 2348 of file libsbml.py.
| def libsbml.SBase.isSetSBOTerm | ( | self | ) | [inherited] |
Python method signature(s):
isSetSBOTerm(self)bool
Predicate returning true or false depending on whether this object's 'sboTerm' attribute has been set.
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
true if the 'sboTerm' attribute of this SBML object has been set, false otherwise. Definition at line 2427 of file libsbml.py.
| def libsbml.SBMLDocument.printErrors | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
printErrors(self, ostream stream = cerr) printErrors(self)
Prints to the given output stream all the errors or warnings encountered during parsing, consistency checking, or attempted translation of this model.
If no errors have occurred, i.e., getNumErrors() == 0, no output will be sent to the stream.
The format of the output is:
N error(s):
line NNN: (id) message
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
Definition at line 6905 of file libsbml.py.
| def libsbml.SBase.setAnnotation | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setAnnotation(self, XMLNode annotation)int setAnnotation(self, string annotation)
int
Sets the value of the 'annotation' subelement of this SBML object to a copy of annotation given as a character string.
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(const XMLNode* annotation) or SBase.appendAnnotation(const std.string& annotation).
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
| annotation | an XML string that is to be used as the content of the 'annotation' subelement of this object |
setAnnotation(const XMLNode* annotation)
appendAnnotation(const XMLNode* annotation)
appendAnnotation(const std.string& annotation)
Reimplemented in libsbml.Model, and libsbml.SpeciesReference.
Definition at line 2568 of file libsbml.py.
| def libsbml.SBMLDocument.setConsistencyChecks | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
setConsistencyChecks(self, SBMLErrorCategory_t category, bool apply)
Controls the consistency checks that are performed when SBMLDocument.checkConsistency() is called.
This method works by adding or subtracting consistency checks from the set of all possible checks that SBMLDocument.checkConsistency() knows how to perform. This method may need to be called multiple times in order to achieve the desired combination of checks. The first argument (category) in a call to this method indicates the category of consistency/error checks that are to be turned on or off, and the second argument (apply, a boolean) indicates whether to turn it on (value of true) or off (value of false).
The possible categories (values to the argument category) are the set of values from the enumeration SBMLErrorCategory_t. The following are the possible choices in libSBML version 3.3.x:
LIBSBML_CAT_GENERAL_CONSISTENCY: Correctness and consistency of specific SBML language constructs. Performing this set of checks is highly recommended. With respect to the SBML specification, these concern failures in applying the validation rules numbered 2xxxx in the Level 2 Versions 2, 3 and 4 specifications.LIBSBML_CAT_IDENTIFIER_CONSISTENCY: Correctness and consistency of identifiers used for model entities. An example of inconsistency would be using a species identifier in a reaction rate formula without first having declared the species. With respect to the SBML specification, these concern failures in applying the validation rules numbered 103xx in the Level 2 Versions 2, 3 and 4 specifications.LIBSBML_CAT_UNITS_CONSISTENCY: Consistency of measurement units associated with quantities in a model. With respect to the SBML specification, these concern failures in applying the validation rules numbered 105xx in the Level 2 Versions 2, 3 and 4 specifications.LIBSBML_CAT_MATHML_CONSISTENCY: Syntax of MathML constructs. With respect to the SBML specification, these concern failures in applying the validation rules numbered 102xx in the Level 2 Versions 2, 3 and 4 specifications.LIBSBML_CAT_SBO_CONSISTENCY: Consistency and validity of SBO identifiers (if any) used in the model. With respect to the SBML specification, these concern failures in applying the validation rules numbered 107xx in the Level 2 Versions 2, 3 and 4 specifications.LIBSBML_CAT_OVERDETERMINED_MODEL: Static analysis of whether the system of equations implied by a model is mathematically overdetermined. With respect to the SBML specification, this is validation rule #10601 in the SBML Level 2 Versions 2, 3 and 4 specifications.LIBSBML_CAT_MODELING_PRACTICE: Additional checks for recommended good modeling practice. (These are tests performed by libSBML and do not have equivalent SBML validation rules.)
| category | a value drawn from SBMLErrorCategory_t indicating the consistency checking/validation to be turned on or off | |
| apply | a boolean indicating whether the checks indicated by category should be applied or not. |
Definition at line 6535 of file libsbml.py.
| def libsbml.SBMLDocument.setConsistencyChecksForConversion | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
setConsistencyChecksForConversion(self, SBMLErrorCategory_t category, bool apply)
Controls the consistency checks that are performed when SBMLDocument.setLevelAndVersion(level, version) is called.
This method works by adding or subtracting consistency checks from the set of all possible checks that may be performed to avoid conversion to or from an invalid document. This method may need to be called multiple times in order to achieve the desired combination of checks. The first argument (category) in a call to this method indicates the category of consistency/error checks that are to be turned on or off, and the second argument (apply, a boolean) indicates whether to turn it on (value of true) or off (value of false).
The possible categories (values to the argument category) are the set of values from the enumeration SBMLErrorCategory_t. The following are the possible choices in libSBML version 4.x.x:
LIBSBML_CAT_GENERAL_CONSISTENCY: Correctness and consistency of specific SBML language constructs. Performing this set of checks is highly recommended. With respect to the SBML specification, these concern failures in applying the validation rules numbered 2xxxx in the Level 2 Versions 2, 3 and 4 specifications.LIBSBML_CAT_IDENTIFIER_CONSISTENCY: Correctness and consistency of identifiers used for model entities. An example of inconsistency would be using a species identifier in a reaction rate formula without first having declared the species. With respect to the SBML specification, these concern failures in applying the validation rules numbered 103xx in the Level 2 Versions 2, 3 and 4 specifications.LIBSBML_CAT_UNITS_CONSISTENCY: Consistency of measurement units associated with quantities in a model. With respect to the SBML specification, these concern failures in applying the validation rules numbered 105xx in the Level 2 Versions 2, 3 and 4 specifications.LIBSBML_CAT_MATHML_CONSISTENCY: Syntax of MathML constructs. With respect to the SBML specification, these concern failures in applying the validation rules numbered 102xx in the Level 2 Versions 2, 3 and 4 specifications.LIBSBML_CAT_SBO_CONSISTENCY: Consistency and validity of SBO identifiers (if any) used in the model. With respect to the SBML specification, these concern failures in applying the validation rules numbered 107xx in the Level 2 Versions 2, 3 and 4 specifications.LIBSBML_CAT_OVERDETERMINED_MODEL: Static analysis of whether the system of equations implied by a model is mathematically overdetermined. With respect to the SBML specification, this is validation rule #10601 in the SBML Level 2 Versions 2, 3 and 4 specifications.LIBSBML_CAT_MODELING_PRACTICE: Additional checks for recommended good modeling practice. (These are tests performed by libSBML and do not have equivalent SBML validation rules.)
| category | a value drawn from SBMLErrorCategory_t indicating the consistency checking/validation to be turned on or off | |
| apply | a boolean indicating whether the checks indicated by category should be applied or not. |
Definition at line 6623 of file libsbml.py.
| def libsbml.SBase.setId | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setId(self, string sid)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.
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
| metaid | the identifier string to use as the value of the 'metaid' attribute |
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.
Definition at line 2486 of file libsbml.py.
| def libsbml.SBMLDocument.setLevelAndVersion | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
setLevelAndVersion(self, unsigned int level, unsigned int version, bool strict = True)bool setLevelAndVersion(self, unsigned int level, unsigned int version)
bool
Sets the SBML Level and Version of this SBMLDocument instance, attempting to convert the model as needed.
This method is the principal way in libSBML to convert models between Levels and Versions of SBML. Generally, models can be converted upward without difficulty (e.g., from SBML Level 1 to Level 2, or from an earlier Version of Level 2 to the latest Version of Level 2). Sometimes models can be translated downward as well, if they do not use constructs specific to more advanced Levels of SBML.
Before calling this method, callers may check compatibility directly using the methods SBMLDocument.checkL1Compatibility(), SBMLDocument.checkL2v1Compatibility(), SBMLDocument.checkL2v2Compatibility(), SBMLDocument.checkL2v3Compatibility() and SBMLDocument.checkL2v4Compatibility().
The valid combinations of SBML Level and Version as of this release of libSBML are the following:
| level | the desired SBML Level | |
| version | the desired Version within the SBML Level | |
| strict | boolean indicating whether to check consistency of both the source and target model when performing conversion (defaults to true ) |
Definition at line 6398 of file libsbml.py.
| def libsbml.SBase.setMetaId | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setMetaId(self, 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.
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
| metaid | the identifier string to use as the value of the 'metaid' attribute |
Definition at line 2446 of file libsbml.py.
| def libsbml.SBMLDocument.setModel | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
setModel(self, Model m)int
Sets the Model for this SBMLDocument to a copy of the given Model.
| m | the new Model to use. |
Definition at line 6472 of file libsbml.py.
| def libsbml.SBase.setName | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setName(self, string name)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.
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
| metaid | the identifier string to use as the value of the 'metaid' attribute |
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.
Definition at line 2527 of file libsbml.py.
| def libsbml.SBase.setNamespaces | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setNamespaces(self, XMLNamespaces xmlns)int
Sets the namespaces relevant of this SBML object.
| xmlns | the namespaces to set |
Definition at line 2811 of file libsbml.py.
| def libsbml.SBase.setNotes | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setNotes(self, XMLNode notes)int setNotes(self, string notes)
int
Sets the value of the 'notes' subelement of this SBML object to a copy of the string notes.
Any existing content of the 'notes' subelement is discarded.
The optional 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. The SBML Level 2 specification has considerable detail about how 'notes' element content must be handled; please refer to the specifications.
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
| notes | an XML string that is to be used as the content of the 'notes' subelement of this object |
setNotes(const XMLNode* notes)
appendNotes(const XMLNode* notes)
appendNotes(const std.string& notes)
Definition at line 2676 of file libsbml.py.
| def libsbml.SBase.setSBOTerm | ( | self, | ||
| args | ||||
| ) | [inherited] |
Python method signature(s):
setSBOTerm(self, int value)int setSBOTerm(self, string sboid)
int
Sets the value of the 'sboTerm' attribute.
In SBML Level 2 Versions 2, 3 and 4, the data type of the SBML 'sboTerm' 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.
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
| value | the NNNNNNN integer portion of the SBO identifier |
Definition at line 2774 of file libsbml.py.
| def libsbml.SBase.toSBML | ( | self | ) | [inherited] |
Python method signature(s):
toSBML(self)char
Returns a string that consists of the partial SBML describing this object. This is primarily provided for testing and debugging purposes. It may be removed in a future version of libSBML.
Definition at line 3237 of file libsbml.py.
| def libsbml.SBase.unsetAnnotation | ( | self | ) | [inherited] |
Python method signature(s):
unsetAnnotation(self)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.
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
setAnnotation(const XMLNode* annotation)
setAnnotation(const std.string& annotation)
appendAnnotation(const XMLNode* annotation)
appendAnnotation(const std.string& annotation)
Definition at line 2910 of file libsbml.py.
| def libsbml.SBase.unsetCVTerms | ( | self | ) | [inherited] |
Python method signature(s):
unsetCVTerms(self)int
Clears the list of CVTerms of this SBML object.
Definition at line 3060 of file libsbml.py.
| def libsbml.SBase.unsetMetaId | ( | self | ) | [inherited] |
Python method signature(s):
unsetMetaId(self)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.
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
Definition at line 2832 of file libsbml.py.
| def libsbml.SBase.unsetNotes | ( | self | ) | [inherited] |
Python method signature(s):
unsetNotes(self)int
Unsets the value of the 'notes' subelement of this SBML object.
The optional 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. The SBML Level 2 specification has considerable detail about how 'notes' element content must be handled; please refer to the specifications.
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
setNotes(const XMLNode* notes)
setNotes(const std.string& notes)
appendNotes(const XMLNode* notes)
appendNotes(const std.string& notes)
Definition at line 2869 of file libsbml.py.
| def libsbml.SBase.unsetSBOTerm | ( | self | ) | [inherited] |
Python method signature(s):
unsetSBOTerm(self)int
Unsets the value of the 'sboTerm' attribute of this SBML object.
Some words of explanation about the
set/unset/isSet methods:
SBML Levels 1 and 2 define certain attributes on some classes of objects as
optional. This requires an application to be careful about the distinction
between two cases: (1) a given attribute has never been set to a
value, and therefore should be assumed to have the SBML-defined default
value, and (2) a given attribute has been set to a value, but the value
happens to be an empty string. LibSBML supports these distinctions by
providing methods to set, unset, and query the status of attributes that
are optional. The methods have names of the form
setAttribute(...),
unsetAttribute(), and
isSetAttribute(), where Attribute
is the the name of the optional attribute in question.
Definition at line 2952 of file libsbml.py.