Source code for pta.metabolite
"""Description of a metabolite."""
[docs]class Metabolite:
"""Describes the properties of a metabolite relevant for the estimation of Gibbs
free energies.
Parameters
----------
id : str
The unique identifier of the metabolite.
key : str
The key of the metabolite, without its compartment specification.
compartment : str, optional
The identifier of the compartment, by default 'c'.
nH : int, optional
Number of hydrogen atoms in the metabolite, by default 0.
z : int, optional
Charge of the metabolite, by default 0.
"""
def __init__(
self, id: str, key: str, compartment: str = "c", nH: int = 0, z: int = 0
):
self._id = id
self._key = key
self._compartment = compartment
self._nH = nH
self._z = z
@property
@id.setter
def id(self, value: str):
"""Sets the identifier of the metabolite."""
self._id = value
@property
@key.setter
def key(self, value: str):
"""Sets the key of the metabolite."""
self._key = value
@property
[docs] def compartment(self) -> str:
"""Gets the compartment ID of the metabolite."""
return self._compartment
@compartment.setter
def compartment(self, value: str):
"""Sets the compartment ID of the metabolite."""
self._compartment = value
@property
[docs] def nH(self) -> int:
"""Gets the number of hydrogen atoms in the metabolite."""
return self._nH
@nH.setter
def nH(self, value: int):
"""Sets the number of hydrogen atoms in the metabolite."""
self._nH = value
@property
@z.setter
def z(self, value: int):
"""Sets the charge of the metabolite."""
self._z = value