comp
A model instance inside another model.
The Submodel class was introduced by the SBML Level 3 Hierarchical Model Composition package (“comp”) as the principle way by which models are structured hierarchically. Submodels are instantiations of models contained within other models. They reference another Model that is to be instantiated within its parent Model, and additionally define how that Model is to be modified before instantiation.
The Submodel object class has a required attribute 'modelRef', which must reference another Model or ExternalModelDefinition object present in the SBML Document. This referenced Model is the model to be instantiated.
It also has a required attribute, 'id', to give the submodel a unique identifier by which other parts of an SBML model definition can refer to it, and an optional 'name' attribute of type string
. Identifiers and names must be used according to the guidelines described in the SBML specification.
The Submodel class also provides constructs that define how the referenced Model object is to be modified before it is instantiated in the enclosing model. If numerical values in the referenced model must be changed in order to fit them into their new context as part of the submodel, the changes can be handled through conversion factors. If one or more structural features in the referenced model are undesirable and should be removed, the changes can be handled through deletions. (For example, an initial assignment or reaction may not be relevant in its new context and should be removed.)
In some cases, the referenced Model may have been written with different units than the containing model. For most model elements, this is not a problem: it is already possible to have Species and Parameter objects with different units in a single model, for example, so in this case the resulting hierarchical model would be treated in exactly the same way as any other model with Species and Parameters with different units.
However, two units in SBML models are fixed and must not vary between SBML elements: time and extent. The units of time are set once per model, and affect the core elements of RateRule, KineticLaw, Delay, and the csymbols 'time' and 'delay'. Even if the model does not explicitly state what the units of time actually are, they are defined to be consistent across the model, and therefore might differ from the units of time across a parent model. To correct this imbalance, the optional attribute 'timeConversionFactor' may be used, which, if defined, must reference a constant parameter in the parent model. The value of the time conversion factor should be defined such that a single unit of time in the Submodel multiplied by the time conversion factor should equal a single unit of time in the parent model.
Extent is the unit in SBML that defines how the KineticLaw of a Reaction affects species quantities: kinetic laws are defined to be in units of extent/time. No other SBML core construct is defined in terms of extent. If the effective units of extent in a submodel differ from the effective units of extent in the parent model (regardless of whether either defined what those units actually are), the optional attribute 'extentConversionFactor' may be used, which, if defined, must reference a constant parameter in the parent model. The value of the extent conversion factor should be defined such that a single unit of extent in the Submodel multiplied by the extent conversion factor should equal a single unit of extent in the parent model.
If features of the referenced model must be removed, a Deletion should be added to the Submodel object. A Submodel may contain a child ListOfDeletions, which in turn may contain one or more Deletion items. Each Deletion references a single element of the referenced Model that must be removed before instantiating that Model as a submodel of the parent Model.
|
def | __init__ (self, args) |
| comp
A model instance inside another model. More...
|
|
def | addDeletion (self, deletion) |
| Adds a copy of the given Deletion object to the list of deletions. More...
|
|
def | clearInstantiation (self) |
| Delete the instantiated Model, if it exists. More...
|
|
def | clone (self) |
| Creates and returns a deep copy of this Submodel object. More...
|
|
def | connectToChild (self) |
|
def | convertTimeAndExtent (self) |
| Convert all references to time and extent in the instantiated Model, according to the timeConversionFactor and extentConversionFactor attributes. More...
|
|
def | createDeletion (self) |
| Creates a Deletion object, adds it to the end of the deletion objects list and returns a pointer to the newly created object. More...
|
|
def | getDeletion (self, args) |
| This method has multiple variants; they differ in the arguments they accept. 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 | getExtentConversionFactor (self) |
| Returns the value of the 'extentConversionFactor' attribute of this Submodel. More...
|
|
def | getId (self) |
| Returns the value of the 'id' attribute of this Submodel. More...
|
|
def | getInstantiation (self, args) |
| Get the instantiated Model this Submodel contains rules to create. More...
|
|
def | getListOfAllInstantiatedElements (self) |
|
def | getListOfDeletions (self, args) |
| Returns the ListOf object that holds all deletions. More...
|
|
def | getModelRef (self) |
| Returns the value of the 'modelRef' attribute of this Submodel. More...
|
|
def | getName (self) |
| Returns the value of the 'name' attribute of this Submodel. More...
|
|
def | getNumDeletions (self) |
| Returns the number of deletions for this Submodel. More...
|
|
def | getSubstanceConversionFactor (self) |
| Returns an empty string, since 'substanceConversionFactor' is not a part of the comp spec. More...
|
|
def | getTimeConversionFactor (self) |
| Returns the value of the 'timeConversionFactor' attribute of this Submodel. More...
|
|
def | getTypeCode (self) |
| Returns the libSBML type code of this object instance. More...
|
|
def | hasRequiredAttributes (self) |
| Returns true if the 'submodel' attribute is set, and if getNumReferents() is exactly 1. More...
|
|
def | instantiate (self) |
| Find and create a local copy of the Model object referenced by this Submodel. More...
|
|
def | isSetExtentConversionFactor (self) |
| Predicate returning True or False depending on whether this Submodel's 'extentConversionFactor' attribute has been set. More...
|
|
def | isSetId (self) |
| Predicate returning True or False depending on whether this Submodel's 'id' attribute has been set. More...
|
|
def | isSetModelRef (self) |
| Predicate returning True or False depending on whether this Submodel's 'modelRef' attribute has been set. More...
|
|
def | isSetName (self) |
| Predicate returning True or False depending on whether this Submodel's 'name' attribute has been set. More...
|
|
def | isSetSubstanceConversionFactor (self) |
| Returns False , since 'substanceConversionFactor' is not a part of the comp spec. More...
|
|
def | isSetTimeConversionFactor (self) |
| Predicate returning True or False depending on whether this Submodel's 'timeConversionFactor' attribute has been set. More...
|
|
def | performDeletions (self) |
| Delete elements in the instantiated submodel, based on any Deletions from this Submodel's listOfDeletions. More...
|
|
def | removeDeletion (self, args) |
| This method has multiple variants; they differ in the arguments they accept. More...
|
|
def | removeProcessingCallback (args) |
|
def | renameSIdRefs (self, oldid, newid) |
| Renames the conversion factor attributes on this element if oldid matches. More...
|
|
def | replaceElement (self, toReplace, replacement) |
| Delete the element in question from the stored instantiated Model, and replace all references to it with references to the replacement object. More...
|
|
def | setExtentConversionFactor (self, id) |
| Sets the value of the 'extentConversionFactor' attribute of this Submodel. More...
|
|
def | setId (self, id) |
| Sets the value of the 'id' attribute of this Submodel. More...
|
|
def | setModelRef (self, modelRef) |
| Sets the value of the 'modelRef' attribute of this Submodel. More...
|
|
def | setName (self, name) |
| Sets the value of the 'name' attribute of this Submodel. More...
|
|
def | setSubstanceConversionFactor (self, id) |
| Automatically fails, since 'substanceConversionFactor' is not a part of the comp spec. More...
|
|
def | setTimeConversionFactor (self, id) |
| Sets the value of the 'timeConversionFactor' attribute of this Submodel. More...
|
|
def | unsetExtentConversionFactor (self) |
| Unsets the value of the 'extentConversionFactor' attribute of this Submodel. More...
|
|
def | unsetId (self) |
| Unsets the value of the 'id' attribute of this Submodel. More...
|
|
def | unsetModelRef (self) |
| Unsets the value of the 'modelRef' attribute of this Submodel. More...
|
|
def | unsetName (self) |
| Unsets the value of the 'name' attribute of this Submodel. More...
|
|
def | unsetSubstanceConversionFactor (self) |
| Automatically fails, since 'substanceConversionFactor' is not a part of the comp spec. More...
|
|
def | unsetTimeConversionFactor (self) |
| Unsets the value of the 'timeConversionFactor' attribute of this Submodel. More...
|
|