Classes related to enzymes:
Enzyme: Constraints relating enzymes to reactions. Including upper and lower bound enzyme constraints
EnzymeVariable: Variable related to an enzyme. The value of this variable represent the concentration.
Enzyme Objects
class Enzyme(Object)
Upper level Enzyme object containing information about the enzyme and links to the EnzymeVariables for each reaction the enzyme catalyzes.
Arguments:
id (str): Identifier for the enzyme (e.g., Uniprot ID).
rxn2kcat (Dict): Dictionary with reaction ID, kcat value pairs for the forward (f) and backward (b) reaction, e.g.
{'PGI': {'f': 30, 'b': 0.1}}upper_bound (float): Upper bound for the enzyme variable (default 1000.0).
lower_bound (float): Lower bound for the enzyme variable (default 0).
name (str): Name of the enzyme (default None).
molmass (float): Molar mass of the enzyme (default 3.947778784340140e04).
Notes:
This class is used to generate enzyme instances from kcat values and contains information about the forward as well as the backward catalysis.
The enzyme is linked to individual cobra.Reaction variables with CatalyticEvent objects.
There are two scenarios:
Promiscuous enzymes: a single enzyme can catalyze multiple reactions.
Other: a single enzyme catalyzes a single reaction.
DEFAULT_ENZYME_MOL_MASS
mean enzymes mass E.coli [g/mol]
kcat_values
@property
def kcat_values()
Returns a dictionary with kcat values for each associated reaction.
Returns:
dict- A dictionary containing kcat values for associated reactions.
concentration
@property
def concentration(units: str = "mmol/gDW",
return_units: bool = False) -> float
Returns the enzyme’s total concentration considering any associated reactions.
Arguments:
unitsstr, optional - Units in which the concentration is calculated (default is ‘mmol/gDW’), other option is ‘g/gDW’.return_unitsbool, optional - Determines whether the units should be returned as well.
Returns:
float- Enzyme concentration as a float.
add_catalytic_event
def add_catalytic_event(ce: CatalyticEvent, kcats: Dict)
Adds a catalytic event associated with a reaction to an enzyme.
Arguments:
cePAModelpy.Variables.CatalyticEvent - A CatalyticEvent object to which the enzyme should be added.kcatsdict - A dictionary containing direction and kcat key-value pairs.
Returns:
NoneType- None
create_catalytic_event
def create_catalytic_event(rxn_id: str, kcats: Dict)
Creates enzyme variables that link to reactions.
Arguments:
rxn_idstr - ID of the associated reaction in the model.kcatsDict - A dictionary containing kcat values for the forward and backward reaction.
Returns:
Variables.CatalyticEvent- Enzyme variable object of type Variables.CatalyticEvent.
create_enzyme_variable
def create_enzyme_variable()
Creates enzyme variables that link enzyme to reactions.
change_kcat_values
def change_kcat_values(rxn2kcat: Dict)
Changes the kcat values for the enzyme and updates the enzyme variable (enzymatic reaction) accordingly.
Arguments:
rxn2kcatDict - A dictionary with reaction ID, kcat value pairs for the forward (f) and backward (b) reaction, e.g.{'PGI': {'f': 30, 'b': 0.1}}
get_kcat_values
def get_kcat_values(rxn_ids: Union[str, list] = None) -> Dict
Returns the kcat values for a specific enzyme and all enzyme-associated reactions.
Arguments:
rxn_idsUnion[str, list], optional - ID of the reactions for which the kcat values should be returned. It can be a single reaction ID (str) or a list of reaction IDs.
Returns:
Dict- A dictionary containing kcat values for the forward (f) and backward (b) reactions.
remove_catalytic_event
def remove_catalytic_event(catalytic_event: Union[CatalyticEvent, str])
Function to remove a catalytic event from an enzyme.
Arguments:
catalytic_eventUnion[CatalyticEvent, str] - CatalyticEvent or str, catalytic event or identifier to remove.
__copy__
def __copy__() -> "Enzyme"
Copy the enzyme variable.
Returns:
PAModelpy.Enzyme.Enzyme- A new enzyme that is a copy of the original enzyme.
__deepcopy__
def __deepcopy__(memo: dict) -> "Enzyme"
Copy the enzyme variable with memo.
Arguments:
memodict - Automatically passed parameter.
Returns:
PAModelpy.Enzyme.Enzyme- A new enzyme that is a copy of the original enzyme with memo.
EnzymeComplex Objects
class EnzymeComplex(Enzyme)
Upper-level EnzymeComplex object containing information about the enzymes in a complex and a link to the enzyme variables (CatalyticEvents) for each reaction the enzyme complex catalyzes.
This class is used to generate enzyme instances from kcat values and contains information about the forward as well as the backward catalysis.
Arguments:
idstr - Identifier for the enzyme complex (e.g., Uniprot ID).enzymesDictList of cobra.core.Enzyme - Enzyme objects associated with the enzyme complex.rxn2kcatDict - Dictionary with reaction ID, kcat value pairs for the forward (f) and backward (b) reaction, e.g.{'PGI': {'f': 30, 'b': 0.1}}upper_boundfloat, optional - Upper bound for the enzyme variable (default 1000.0).namestr, optional - Name of the enzyme (default None).molmassfloat, optional - Molar mass of the enzyme (default 3.947778784340140e04).
DEFAULT_ENZYME_MOL_MASS
mean enzymes mass E.coli [g/mol]
EnzymeVariable Objects
class EnzymeVariable(Reaction)
EnzymeVariable is a class for holding information regarding the variable representing an enzyme in the model. For each reaction, the enzyme variables are summarized in a CatalyticEvent.
There are three different scenarios:
Enzyme complex: multiple enzymes together are associated with an EnzymeComplex object.
Isozymes: multiple enzymes independently associated with a single catalytic event.
Other: a single enzyme is associated with a single catalytic event.
Arguments:
kcats2rxnsDict - A dictionary with reaction_id, kcat key, value pairs to connect the enzyme with the associated reaction. The kcat is another dictionary withfandbfor the forward and backward reactions, respectively.idstr, optional - The identifier to associate with this enzyme (default None).namestr, optional - A human-readable name for the enzyme (default “”).subsystemstr, optional - Subsystem where the enzyme is meant to function (default “”).lower_boundfloat - The lower flux bound (default 0.0).upper_boundfloat, optional - The upper flux bound (default None).**kwargs- Additional keyword arguments are passed on to the parent class.
DEFAULT_ENZYME_MOL_MASS
mean enzymes mass E.coli [g/mol]
kcat_values
@property
def kcat_values()
Returns a dictionary with kcat values and reactions.
Returns:
dict- A dictionary containing kcat values and their associated reactions.
flux
@property
def flux() -> float
Get the flux value in the most recent solution.
Flux is the primal value of the corresponding variable in the model.
Returns:
float- Flux, which is the primal value of the corresponding variable in the model.
Raises:
RuntimeError- If the underlying model was never optimized beforehand or the reaction is not part of a model.OptimizationError- If the solver status is anything other than ‘optimal’.AssertionError- If the flux value is not within the bounds.
Warnings:
Accessing reaction fluxes through a
Solutionobject is the safer, preferred, and only guaranteed to be correct way.Reaction flux is retrieved from the currently defined
self._model.solver. The solver status is checked but there are no guarantees that the current solver state is the one you are looking for.If you modify the underlying model after an optimization, you will retrieve the old optimization values.
Examples:
```
>>> from cobra.io import load_model
>>> model = load_model("textbook")
>>> solution = model.optimize()
>>> model.variables.PFK.flux
7.477381962160283
>>> solution.fluxes.PFK
7.4773819621602833
```
concentration
@property
def concentration() -> float
Get the enzyme concentration value of the most recent solution.
The enzyme concentration equals the flux value.
Returns:
float- Enzyme concentration in mmol/gDW.
add_catalytic_events
def add_catalytic_events(catalytic_events: list, kcats: list)
Adding catalytic events to an enzyme variable.
Arguments:
catalytic_eventslist - A list of catalytic events to add.kcatslist - A list with dictionaries containing direction and kcat key-value pairs.
add_reactions
def add_reactions(reaction_kcat_dict: dict)
Add reactions to the enzyme variable and create bindings to the related model. If there are multiple reactions related to a single enzyme, this is an isozyme.
Arguments:
reaction_kcat_dictdict - A nested dictionary with the reaction_id, kcat key, value pairs to connect the enzyme with the associated reaction. The kcat is another dictionary withfandbfor the forward and backward reactions, respectively.
remove_catalytic_event
def remove_catalytic_event(catalytic_event: Union[CatalyticEvent, str])
Remove a catalytic event from an enzyme.
Arguments:
catalytic_eventUnion[CatalyticEvent, str] - CatalyticEvent or str, catalytic event or identifier to remove.
remove_reactions
def remove_reactions(reaction_list: list)
Remove reactions from the enzyme variable and remove the reactions from the constraint expressions related to the enzyme.
Arguments:
reaction_listlist - A list with Cobra.Reaction objects which should be removed. If a list of identifiers (str) is provided, the corresponding enzyme will be obtained from the EnzymeVariables.reaction attribute.
change_kcat_values
def change_kcat_values(reaction_kcat_dict: dict)
Changes kcat values for the enzyme variable.
Arguments:
reaction_kcat_dictdict - A nested dictionary with Cobra.Reaction, kcat key, value pairs to connect the enzyme with the associated reaction. The kcat is another dictionary withfandbfor the forward and backward reactions, respectively.
__copy__
def __copy__() -> "PAModelpy.Enzyme.EnzymeVariable"
Copy the enzyme variable.
Returns:
PAModelpy.Enzyme.EnzymeVariable- A new enzyme variable that is a copy of the original enzyme variable.
__deepcopy__
def __deepcopy__(memo: dict) -> "PAModelpy.Enzyme.EnzymeVariable"
Copy the enzyme variable with memo.
Arguments:
memodict - Automatically passed parameter.
Returns:
PAModelpy.Enzyme.EnzymeVariable- A new enzyme variable that is a copy of the original enzyme variable with memo.