Skip to content

Commit

Permalink
Some bugfixes changing kcat values
Browse files Browse the repository at this point in the history
  • Loading branch information
SamiralVdB committed Dec 18, 2024
1 parent 3a21a75 commit 7922db9
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/PAModelpy/EnzymeSectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,33 @@ def _get_model_genes_from_enzyme(self, enzyme_id: str, model: Model) -> list:
def change_kcat_values(self, rxn_id:str, enzyme_id:str,
kcat_f_b:dict[Literal['f', 'b'], float]
) -> None:
self.rxn2protein.setdefault(rxn_id, {}).update(kcat_f_b)
"""
Updates the kcat values for a specific enzyme associated with a given reaction.
This method modifies the `rxn2protein` dictionary by either adding or updating
the kcat values (forward and backward) for the specified enzyme in the context
of the provided reaction.
Args:
rxn_id (str): The identifier for the reaction.
enzyme_id (str): The identifier for the enzyme.
kcat_f_b (dict[Literal['f', 'b'], float]): A dictionary containing the
forward ('f') and backward ('b') kcat values for the enzyme.
For example: {'f': 1.5, 'b': 0.8}.
Returns:
None: This method updates the instance's `rxn2protein` attribute in-place.
Example:
```python
model.change_kcat_values(
rxn_id="RXN001",
enzyme_id="ENZYME123",
kcat_f_b={'f': 2.0, 'b': 1.0}
)
```
"""
self.rxn2protein.setdefault(rxn_id, {}).update({enzyme_id:kcat_f_b})

def __setstate__(self, state):
# Restore state from the unpickled state
Expand Down

0 comments on commit 7922db9

Please sign in to comment.