EnergyDiff
- class pyomexmeta.EnergyDiff(energy_diff_ptr: ctypes.c_longlong)
Interface for creating EnergyDiff (Energy Differential) types of Composite annotations.
From Section 2.3.7.4 of the OmexMeta specification Composite annotations can also be used to represent the properties of energy differentials. These include, for example, membrane potentials, chemical potentials and fluid pressures. The structure of annotations for these properties is similar to process properties. Because energy differences are not conventionally
named or represented explicitly in model code, we use a local resource in the RDF with its energetic sources and sinks specified. (Mediators and stoichiometries are only used for process annotations.)
The following is an example that represents the electrical potential caused by a difference in the amount of charged ions on either side of a cell membrane. For this example, we assume a model element with metadata ID “parameter metaid 0” represents this biological property. We assert triples stating that the model element represents a property of an energy difference, and specifically that it represents a voltage (OPB:OPB 01058):
- myOMEX:MyModel.sbml#parameter_metaid_0
bqbiol:isPropertyOf local:EnergyDiff_0 ; bqbiol:isVersionOf opb:OPB_01058 .
We add triples that indicate the physical entity participants (energetic sources and sinks) whose properties define that energy difference:
- local:EnergyDiff_0
semsim:hasSourceParticipant :source_23 ; semsim:hasSinkParticipant :sink_12 .
- local:source_23
semsim:hasPhysicalEntityReference myOMEX:MyModel.sbml#species_metaid_42 .
- local:sink_12
semsim:hasPhysicalEntityReference myOMEX:MyModel.sbml#species_metaid_37 .
For SBML models, the URI fragments species metaid 42 and species metaid 37 would correspond to metadata IDs on <species> elements in the SBML code (species such as intra- and extra-cellular calcium ions, for example). Importantly, for models in CellML or other formats that do not include the explicit representation of physical entities, these metadata IDs would point to physical entity resources instantiated elsewhere in the RDF metadata.
- __init__(energy_diff_ptr: ctypes.c_longlong)
Constructor for
EnergyDiff
.This constructor is not designed to be used directly by users. Instead users should create a
EnergyDiff
directly from the an instance ofEditor
.- Parameters
energy_diff_ptr – A ctypes int64 integer representing the memory address (pointer) of this EnergyDiff.
- __weakref__
list of weak references to the object (if defined)
- about(about: str, uri_type: pyomexmeta.pyomexmeta_api.eUriType) → pyomexmeta.pyomexmeta.EnergyDiff
Sets the about (subject) portion of the EnergyDiff.
- This can be either:
a uri of a metaid that exists in the model xml, such as the case with sbml
could need creating in this local namespace (i.e. internal to the RDF graph), such as the case with CellML
Users need to know which use case they need for their annotation language.
- Parameters
about – The string to use as the metaid. When type is eUriType.MODEL_URI then this string must be an existing metaid in the xml. When type is eUriType.LOCAL_URI, this name can be arbitrary, as long as its unique within the RDF graph.
type – either eUriType.MODEL_URI or eUriType.LOCAL_URI
- Returns
PhysicalProcess
. Reference to self
- add_sink(physical_entity_reference: str, uri_type: pyomexmeta.pyomexmeta_api.eUriType) → pyomexmeta.pyomexmeta.EnergyDiff
Adds an energetic sink to this
EnergyDiff
, such as a product in a reactionNote
A source in a
EnergyDiff
does not have a multiplier, like thePhysicalProcess
does- Parameters
physical_entity_reference – The string of the metaid for the energetic sink. If uri_type is eUriType.MODEL_URI (for instance when annotating sbml), this string needs to exist as a metaid on an element of xml. If uri_type is eUriType.LOCAL_URI (i.e. CellML) then this identifier can be string that is unique in the rdf document
uri_type – One of eUriType.LOCAL_URI or eUriType.MODEL_URI
- Returns
EnergyDiff
. Reference to self.
- add_source(physical_entity_reference: str, uri_type: pyomexmeta.pyomexmeta_api.eUriType) → pyomexmeta.pyomexmeta.EnergyDiff
Adds an energetic source to this
PhysicalProcess
, such as a reactant in a reactionNote
A source in a
EnergyDiff
does not have a multiplier, like thePhysicalProcess
does- Parameters
physical_entity_reference – The string of the metaid for the energetic source. If uri_type is eUriType.MODEL_URI (for instance when annotating sbml), this string needs to exist as a metaid on an element of xml. If uri_type is eUriType.LOCAL_URI (i.e. CellML) then this identifier can be string that is unique in the rdf document
uri_type – One of eUriType.LOCAL_URI or eUriType.MODEL_URI
- Returns
EnergyDiff
. Reference to self.
- delete() → None
Clear up resources used by this
PhysicalProcess
- get_ptr() → ctypes.c_longlong
Returns the memory address that points to this PhysicalEntity
- has_property(property_about: Optional[str] = None, about_uri_type: Optional[pyomexmeta.pyomexmeta_api.eUriType] = None, is_version_of: Optional[str] = None, property: Optional[pyomexmeta.pyomexmeta.PhysicalProperty] = None) → pyomexmeta.pyomexmeta._PropertyBearer
Create a PhysicalProperty associated with a PhysicalEntity, EnergyDiff or PhysicalProcess.
This method has 3 signatures in the underlying C++ library. This method unpacks the user supplied arguments and passes them to the correct signature, depending on what is supplied.
The first signature is used with sbml models and requires only the is_version_of arument. This is commonly used for annotating sbml models and therefore, when only one string argument is passed to
has_property()
the argument is used for the is_version_of argument (see example below).- Parameters
is_version_of – (str) represents an OPB term from the Ontology of Physical Biology.
In the above case, the necessary local identifiers are created automatically and are guarenteed to be unique throughout your RDF graph. In some circumstances, you might want to have control over the metaids used for local uri’s. The above would create a
PhysicalProperty
with the subject or “about” portion equal to local:EntityProperty0000. We can set this ourselves using the second overload, which requires three arguments:- Parameters
property_about – The subject or “about” portion of the
PhysicalProperty
triples.eUriType.LOCAL_URI if the uri for property_about should be local to the (about_uri_type) – annotation (rdf) graph or eUriType.MODEL_URI if it instead points to a element of the model (which is common in CellML).
The OPB term to use for the "isVersionOf" predicate (is_version_of) –
Finally, you can create the
Property
yourself and pass that tohas_property()
instead. This is often more useful in CellML models.