Skip to content

Commit

Permalink
rebuild docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Palaract committed Jul 30, 2024
1 parent b18a630 commit 9325907
Show file tree
Hide file tree
Showing 4 changed files with 313 additions and 30 deletions.
14 changes: 8 additions & 6 deletions docs/docs/api_reference/CatalyticEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ It contains multiple functions which enable easy mapping and handling of one Eve
class CatalyticEvent(Object)
```

CatalyticEvent is a class for holding information regarding the catalysis of a Reaction in a cobra.Model object.
It serves as an interface between the metabolic reaction and the associated enzyme constraints and variables.
CatalyticEvent is a class for holding information regarding the
catalysis of a Reaction in a cobra.Model object. It serves as an interface
between the metabolic reaction and the associated enzyme constraints and variables.

**Notes**:

Expand Down Expand Up @@ -142,13 +143,14 @@ constraint expressions related to the enzyme.
def change_kcat_values(enzyme_kcat_dict: dict)
```

Change kcat values for the enzyme variable.
changes kcat values for the enzyme variable

**Arguments**:

- `enzyme_kcat_dict` - Dict[str, Dict[str, float]]
A nested dictionary with enzyme identifiers as keys and kcat dictionaries as values.
The kcat dictionary should have `f` and `b` keys for the forward and backward reactions, respectively.
- `enzyme_kcat_dict` - nested Dict
A Dict with enzyme_id, kcat key, value pairs to connect the
enzyme with the associated reaction the kcat is another dict with 'f' and 'b'
for the forward and backward reactions respectively.

#### \_\_copy\_\_

Expand Down
124 changes: 123 additions & 1 deletion docs/docs/api_reference/Enzyme.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,34 @@ Adds a catalytic event associated with a reaction to an enzyme.

- `NoneType` - None

#### add\_genes

```python
def add_genes(gene_list: list,
gene_length: list,
relation: str = 'OR') -> None
```

Add genes to the enzyme and the model related to the enzyme if applicable

**Arguments**:

- `gene_list` _list_ - A list of gene identifiers to be added.
- `gene_length` _list_ - A list of lengths corresponding to each gene.
- `relation` _str, optional_ - The relationship between genes in gene_list.
Defaults to 'OR'. Possible values: 'OR' or 'AND'.


**Raises**:

- `ValueError` - If an invalid relation is provided.


**Notes**:

If relation is 'OR', each gene in gene_list will be treated as coding for an individual isozyme
If relation is 'AND', all genes in gene_list will be treated as coding for peptides in an enzyme complex

#### create\_catalytic\_event

```python
Expand Down Expand Up @@ -311,13 +339,107 @@ The enzyme concentration equals the flux value.

- `float` - Enzyme concentration in mmol/gDW.

#### concentration

```python
@concentration.setter
def concentration(conc: Union[float, int]) -> None
```

Sets the concentration of the enzyme by creating or updating a constraint
that enforces the concentration to be equal to the sum of the forward and reverse
variable primals.

**Arguments**:

conc : float, int
The concentration value to be set for the enzyme. This value will be used
as both the lower and upper bound for the constraint, effectively fixing the
concentration to this value.

Notes
-----
- If a concentration constraint for the enzyme does not already exist in the model,
this function creates a new constraint named '<enzyme_id>_conc'.
- The concentration constraint is defined as:
concentration = forward_variable.primal + reverse_variable.primal
- If the constraint already exists, the linear coefficients for the forward and reverse
variables are updated to ensure the constraint remains valid.

Raises
------
ValueError
If `conc` is not a valid numerical value.

#### set\_forward\_concentration

```python
def set_forward_concentration(conc: Union[float, int]) -> None
```

Sets the concentration of the enzyme by creating or updating a constraint
that enforces the concentration to be equal to the sum of only the forward
variable primals. This forces a reaction to be active in the forward direction.
It used the concentration setter functionality and subsequently sets the
coefficient for the reverse variable in the constraint to 0.

**Arguments**:

conc : float, int
The concentration value to be set for the enzyme. This value will be used
as both the lower and upper bound for the constraint, effectively fixing the
concentration to this value.

Notes
-----
- If a concentration constraint for the enzyme does not already exist in the model,
this function creates a new constraint named '<enzyme_id>_conc'.
- The concentration constraint is defined as:
concentration = forward_variable.primal

Raises
------
ValueError
If `conc` is not a valid numerical value.

#### set\_reverse\_concentration

```python
def set_reverse_concentration(conc: Union[float, int]) -> None
```

Sets the concentration of the enzyme by creating or updating a constraint
that enforces the concentration to be equal to the sum of only the reverse
variable primals. This forces a reaction to be active in the reverse direction.
It used the concentration setter functionality and subsequently sets the
coefficient for the forward variable in the constraint to 0.

**Arguments**:

conc : float, int
The concentration value to be set for the enzyme. This value will be used
as both the lower and upper bound for the constraint, effectively fixing the
concentration to this value.

Notes
-----
- If a concentration constraint for the enzyme does not already exist in the model,
this function creates a new constraint named '<enzyme_id>_conc'.
- The concentration constraint is defined as:
concentration = reverse_variable.primal

Raises
------
ValueError
If `conc` is not a valid numerical value.

#### add\_catalytic\_events

```python
def add_catalytic_events(catalytic_events: list, kcats: list)
```

Adding catalytic events to an enzyme variable.
Adding a catalytic event to an enzyme variable

**Arguments**:

Expand Down
56 changes: 44 additions & 12 deletions docs/docs/api_reference/EnzymeSectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ mean enzymes mass E.coli [g/mol]
#### \_\_init\_\_

```python
def __init__(rxn2protein: dict, configuration: Config = Config)
def __init__(rxn2protein: dict,
protein2gene: dict = {},
configuration: Config = Config)
```

_summary_
Expand All @@ -73,8 +75,9 @@ _summary_
with information about the enzyme as values. The information included in this dict includes the turnover number for
the forward and backward reaction (1/s), molar mass of the enzyme (mol/g), gene identifiers related to the enzyme,
and with which other enzymes it forms a complex.
- `configuration` _Config object, optional_ - Information about the general configuration of the model, including identifier conventions.
Default is as defined in the `PAModelpy.configuration` script for the E.coli iML1515 model.
- `protein2gene` - dict
enzyme_id, gene_list key, value pairs for each enzyme.The gene_list value is a list of lists which indicates
'and' or 'or' relationships between the genes which code for the enzyme(complex).


**Example**:
Expand All @@ -83,33 +86,62 @@ _summary_
For the Parameter rxn2protein a dictionary may look like this:
{
'R1':
{
'E1': {'f': forward kcat, 'b': backward kcat, 'molmass': molar mass, 'genes': ['G1', 'G2'],
'complex_with': 'E2'},
'E2': {'f': forward kcat, 'b': backward kcat, 'molmass': molar mass, 'genes': ['G3', 'G4'],
'complex_with': 'E1'}
{E1:
{'f': forward kcat, 'b': backward kcat, 'molmass': molar mass, 'genes': [G1, G2],
'protein_reaction_association': [[E1, E2]]
},
E2:
{'f': forward kcat, 'b': backward kcat, 'molmass': molar mass, 'genes': [G3, G4],
'protein_reaction_association': [[E1, E2]]
}
}

For the Parameter protein2gene a dictionary may look like this:
{E1:
[[gene1], [gene2, gene3]],
E2:
[[gene4]]
}
where the gene-protein-reaction associations are the following:
E1: gene1 or (gene2 and gene3)
E2: gene4
```

**Arguments**:

rxn2protein : nested dict
reaction id, enzymes_dict key, value pairs for each reaction in the active_enzyme sector.
The enzymes_dict contains the enzyme identifiers of the enzymes which are related to the specific reaction
as keys and a dict with information about the enzyme as values. The information included in this dict is:
turnover number for forward and backward reaction [1/s], molar mass of the enzyme [mol/g], gene identifiers
related to the enzyme, with which other enzymes it forms a complex.

- `protein2gene` - dict
enzyme_id, gene_list key, value pairs for each enzyme.The gene_list value is a list of lists which indicates
'and' or 'or' relationships between the genes which code for the enzyme(complex).

- `configuration` - Config object, optional
Information about general configuration of the model including identifier conventions.
Default as defined in the `PAModelpy.configuration` script for the E.coli iML1515 model.

#### check\_kcat\_values

```python
def check_kcat_values(model, reaction, kcat)
def check_kcat_values(model, reaction, enzyme_dict)
```

Function to check if the kcat values provided for an enzyme are consistent with the direction of the reaction.
Function to check if the kcat values provided for an enzyme are consistent with the direction of the reaction

**Arguments**:

- `model` _cobra.Model or PAModel_ - Model to which the kcat values should be added.
- `reaction` _cobra.Reaction_ - Reaction that is catalyzed with the enzyme related to the kcats.
- `kcat` _dict_ - A dictionary with the turnover values for the forward and/or backward reaction for different enzymes [/s].
- `enzyme_dict` _dict_ - A dictionary with the turnover values for the forward and/or backward reaction for different enzymes [/s].


**Example**:

Example dictionary for the `kcat` parameter
Example dictionary for the `enzyme_dict` parameter
```
{'E1': {'f': forward kcat, 'b': backward kcat}}
```
Expand Down
Loading

0 comments on commit 9325907

Please sign in to comment.