libSBML Python API
5.11.0
|
The ReplacedBy class was introduced by the SBML Level 3 Hierarchical Model Composition
package (“comp”) to allow submodel elements to be 'canonical' versions of the element while still allowing the parent model to reference those elements. Whereas a ReplacedElement object indicates that the containing object replaces another, a ReplacedBy object indicates the converse: the parent object is to be replaced by another object. As is the case with ReplacedElement, the ReplacedBy class inherits from SBaseRef. It additionally defines one required attribute ('submodelRef'), defined in libSBML in the Replacing class.
Public Member Functions | |
def | __init__ (self, args) |
comp
Indicates an object replaced by another. More... | |
def | clearReferencedElement (self) |
Removes the saved referenced element, if it had been saved earlier. More... | |
def | clone (self) |
Creates and returns a deep copy of this ReplacedBy object. More... | |
def | connectToChild (self) |
def | createSBaseRef (self) |
Creates a new, empty SBaseRef, adds it to this SBaseRef and returns the created SBaseRef. More... | |
def | getElementByMetaId (self, metaid) |
Returns the first child element it can find with the given metaid , or itself if it has the given metaid , or None if no such object is found. More... | |
def | getElementBySId (self, id) |
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. More... | |
def | getElementName (self) |
Returns the XML element name of this SBML object. More... | |
def | getIdRef (self) |
Returns the value of the 'idRef' attribute of this SBaseRef. More... | |
def | getMetaIdRef (self) |
Returns the value of the 'metaIdRef' attribute of this SBaseRef. More... | |
def | getNumReferents (self) |
Returns how many elements are being referred to by this SBaseRef. More... | |
def | getPortRef (self) |
Returns the value of the 'portRef' attribute of this SBaseRef. More... | |
def | getReferencedElement (self) |
Returns the object pointed to by this element. More... | |
def | getReferencedElementFrom (self, model) |
Examines the referenced Model for the referenced object, and returns it, if found. More... | |
def | getSBaseRef (self, args) |
Get the child sBaseRef of this sBaseRef. More... | |
def | getSubmodelRef (self) |
comp
Convenience class. More... | |
def | getTypeCode (self) |
Returns the libSBML type code of this object instance. More... | |
def | getUnitRef (self) |
Returns the value of the 'unitRef' attribute of this SBaseRef. More... | |
def | hasRequiredAttributes (self) |
Returns true if getNumReferents() is exactly 1 and if the submodelRef is set. More... | |
def | isSetIdRef (self) |
Predicate returning True or False depending on whether this SBaseRef's 'idRef' attribute has been set. More... | |
def | isSetMetaIdRef (self) |
Predicate returning True or False depending on whether this SBaseRef's 'metaIdRef' attribute has been set. More... | |
def | isSetPortRef (self) |
Predicate returning True or False depending on whether this SBaseRef's 'portRef' attribute has been set. More... | |
def | isSetSBaseRef (self) |
Predicate for testing whether the sBaseRef for this SBaseRef is set. More... | |
def | isSetSubmodelRef (self) |
Predicate returning True or False depending on whether this SBaseRef's 'submodelRef' attribute has been set. More... | |
def | isSetUnitRef (self) |
Predicate returning True or False depending on whether this SBaseRef's 'unitRef' attribute has been set. More... | |
def | performDeletion (self) |
DEPRECATED FUNCTION: DO NOT USE. More... | |
def | performReplacement (self) |
DEPRECATED FUNCTION: DO NOT USE. More... | |
def | removeFromParentAndDelete (self) |
Finds this ReplacedBy's SBase parent, gets the “comp” plugin from it, and tells that to remove this. More... | |
def | renameSIdRefs (self, oldid, newid) |
Replaces all uses of a given SIdRef type attribute value with another value. More... | |
def | saveReferencedElement (self) |
Finds and stores the referenced object. More... | |
def | setIdRef (self, id) |
Sets the value of the 'idRef' attribute of this SBaseRef. More... | |
def | setMetaIdRef (self, id) |
Sets the value of the 'metaIdRef' attribute of this SBaseRef. More... | |
def | setPortRef (self, id) |
Sets the value of the 'portRef' attribute of this SBaseRef. More... | |
def | setSBaseRef (self, sBaseRef) |
Sets the sBaseRef definition of this SBaseRef to a copy of the given SBaseRef object instance. More... | |
def | setSubmodelRef (self, id) |
Sets the value of the 'submodelRef' attribute of this SBaseRef. More... | |
def | setUnitRef (self, id) |
Sets the value of the 'unitRef' attribute of this SBaseRef. More... | |
def | unsetIdRef (self) |
Unsets the value of the 'idRef' attribute of this SBaseRef. More... | |
def | unsetMetaIdRef (self) |
Unsets the value of the 'metaIdRef' attribute of this SBaseRef. More... | |
def | unsetPortRef (self) |
Unsets the value of the 'portRef' attribute of this SBaseRef. More... | |
def | unsetSBaseRef (self) |
Unsets the child SBaseRef of this SBaseRef. More... | |
def | unsetSubmodelRef (self) |
Unsets the value of the 'SubmodelRef' attribute of this SBaseRef. More... | |
def | unsetUnitRef (self) |
Unsets the value of the 'unitRef' attribute of this SBaseRef. More... | |
|
inherited |
Removes the saved referenced element, if it had been saved earlier.
clearReferencedElement()
def libsbml.ReplacedBy.clone | ( | self | ) |
Creates and returns a deep copy of this ReplacedBy object.
clone() ReplacedBy
|
inherited |
connectToChild()
|
inherited |
|
inherited |
Returns the first child element it can find with the given metaid
, or itself if it has the given metaid
, or None
if no such object is found.
getElementByMetaId(string metaid) SBase
metaid | string representing the metaid of objects to find |
metaid
.
|
inherited |
def libsbml.ReplacedBy.getElementName | ( | self | ) |
Returns the XML element name of this SBML object.
getElementName() string
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Returns the object pointed to by this element.
getReferencedElement() SBase
If that element was previously found and set with 'saveReferencedElement', that element is returned; otherwise, 'saveReferencedElement' is called first, and the found element is returned.
|
inherited |
|
inherited |
def libsbml.ReplacedBy.getTypeCode | ( | self | ) |
Returns the libSBML type code of this object instance.
getTypeCode() int
SBML_
. In the Python language interface for libSBML, the type codes are defined as static integer constants in the interface class libsbml. Note that different Level 3 package plug-ins may use overlapping type codes; to identify the package to which a given object belongs, call the getPackageName()
method on the object.
|
inherited |
|
inherited |
Returns true if getNumReferents() is exactly 1 and if the submodelRef is set.
hasRequiredAttributes() bool
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
DEPRECATED FUNCTION: DO NOT USE.
Deletes the referenced object, plus any other elements that element points to through ReplacedElement or ReplacedBy children.
performDeletion() int
Instead of calling this function directly, use 'CompModelPlugin::instantiateSubmodels' instead, which deals with all the intricacies of replacements and deletions, and gives you access to the non-flattened hierarchical form of the model.
|
inherited |
DEPRECATED FUNCTION: DO NOT USE.
To retain old functionality, this function calls performReplacementAndCollect, and then actually removes the now-redundant element.
performReplacement() int
However, this can lead to doubly-deleted elements, as well as the incorrect interpretation of some models. The replacement function performReplacementAndCollect has been marked protected, in the hopes that people will instead simply use CompModelPlugin::instantiateSubmodels, which hides all the complexity while still allowing access to a non-flattened version of a hierarchical model.
def libsbml.ReplacedBy.removeFromParentAndDelete | ( | self | ) |
Finds this ReplacedBy's SBase parent, gets the “comp” plugin from it, and tells that to remove this.
removeFromParentAndDelete() int
|
inherited |
Replaces all uses of a given SIdRef
type attribute value with another value.
renameSIdRefs(string oldid, string newid)
SId
. In SBML Level 3, an explicit data type called SIdRef
was introduced for attribute values that refer to SId
values; in previous Levels of SBML, this data type did not exist and attributes were simply described to as 'referring to an identifier', but the effective data type was the same as SIdRef
in Level 3. These and other methods of libSBML refer to the type SIdRef
for all Levels of SBML, even if the corresponding SBML specification did not explicitly name the data type.This method works by looking at all attributes and (if appropriate) mathematical formulas in MathML content, comparing the referenced identifiers to the value of oldid
. If any matches are found, the matching values are replaced with newid
. The method does not descend into child elements.
oldid | the old identifier |
newid | the new identifier |
|
inherited |
Finds and stores the referenced object.
saveReferencedElement() int
Finds the Submodel to which it refers, getting the instantiated Model inside that Submodel, calling 'getReferencedElementFrom' on that model, and storing the result.
|
inherited |
Sets the value of the 'idRef' attribute of this SBaseRef.
setIdRef(string id) int
This method fails if the id is not a valid syntax for an SIdRef (LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already points to an element of the submodel using a different interface (LIBSBML_OPERATION_FAILED). A sBaseRef must use exactly one method to point to a submodel element.
|
inherited |
Sets the value of the 'metaIdRef' attribute of this SBaseRef.
setMetaIdRef(string id) int
This method fails if the id is not a valid syntax for an IDREF (LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already points to an element of the submodel using a different interface (LIBSBML_OPERATION_FAILED). An sBaseRef must use exactly one method to point to a submodel element.
|
inherited |
Sets the value of the 'portRef' attribute of this SBaseRef.
setPortRef(string id) int
Fails if the id is not a valid syntax for a PortSIdRef (LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already points to an element of the submodel using a different interface (LIBSBML_OPERATION_FAILED). An SBaseRef must use exactly one method to point to a submodel element.
|
inherited |
Sets the sBaseRef definition of this SBaseRef to a copy of the given SBaseRef object instance.
setSBaseRef(SBaseRef sBaseRef) int
This method fails if the added sBaseRef does not match the level/version/package of the parent object or if the added sBaseRef cannot be copied.
sBaseRef | the SBaseRef object instance to use. |
|
inherited |
Sets the value of the 'submodelRef' attribute of this SBaseRef.
setSubmodelRef(string id) int
Fails if the id is not a valid syntax for an SIdRef.
|
inherited |
Sets the value of the 'unitRef' attribute of this SBaseRef.
setUnitRef(string id) int
This method fails if the id is not a valid syntax for a UnitSIdRef (LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already points to an element of the submodel using a different interface (LIBSBML_OPERATION_FAILED). A sBaseRef must use exactly one method to point to a submodel element.
|
inherited |
Unsets the value of the 'idRef' attribute of this SBaseRef.
unsetIdRef() int
|
inherited |
Unsets the value of the 'metaIdRef' attribute of this SBaseRef.
unsetMetaIdRef() int
|
inherited |
Unsets the value of the 'portRef' attribute of this SBaseRef.
unsetPortRef() int
|
inherited |
|
inherited |
Unsets the value of the 'SubmodelRef' attribute of this SBaseRef.
unsetSubmodelRef() int
|
inherited |
Unsets the value of the 'unitRef' attribute of this SBaseRef.
unsetUnitRef() int