Example #1
0
 def __init__(
     self,
     id: Union[str, Metabolite] = None,
     concentration: float = None,
     molecular_weight: float = 0.0,
     name: str = "",
 ):
     """Initialize with id."""
     self.concentration = concentration
     self.mw = molecular_weight
     self._flux = None
     self.lower_bound = 0
     self._reaction = set()
     self._ub = config.upper_bound
     self.compartment = "c"
     self.__metabolites = {}
     self._annotation = {}
     if isinstance(id, Metabolite):
         self.from_metabolite(id)
     else:
         Object.__init__(self, id, name)
         self.formula = ""
         self.charge = 0.0
     self.kcats = Kcats(self)
     self._reaction.add(self)
Example #2
0
 def from_metabolite(self, met: Metabolite):
     """Initialize `Protein` from `Metabolite`; i.e., when reading from SBML."""
     if not UNIPROT_PATTERN.match(met.id):
         LOGGER.warning(f"Metabolite {met.id} does not use Uniprot ID.")
     Object.__init__(self, met.id, met.name)
     self.compartment = met.compartment
     self._reaction = met._reaction
     self.charge = met.charge
     self.formula = ""
     self._annotation = met._annotation