Skip to content

Commit

Permalink
improved documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
SamiralVdB committed Dec 16, 2024
1 parent adca4eb commit d9b4fe6
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 66 deletions.
5 changes: 1 addition & 4 deletions docs/PAM_setup_guide.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Protein Allocation Model (PAM) Setup Guide
# Setting up PAMs using PAModelpy

This guide provides step-by-step instructions on how to use the provided Python scripts to build Protein Allocation Models (PAMs) from a genome-scale model and parameter datasets.

Expand Down Expand Up @@ -152,5 +151,3 @@ eco_enzymes_mapped = merge_enzyme_complexes(enzyme_db, gene2protein)

- **Issue: Objective value is zero after optimization**
Solution: Check the input parameter file for consistency and ensure that all reactions are correctly annotated.

---
4 changes: 0 additions & 4 deletions docs/api.rst

This file was deleted.

6 changes: 2 additions & 4 deletions docs/api_reference/Enzyme.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
sidebar_label: Enzyme
title: Enzyme
---
# Enzyme classes

Classes related to enzymes:
- Enzyme: Constraints relating enzymes to reactions. Including upper and lower bound enzyme constraints
- EnzymeComplex: Constraints relating enzyme complexes 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
Expand Down
5 changes: 1 addition & 4 deletions docs/api_reference/EnzymeSectors.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
---
sidebar_label: EnzymeSectors
title: EnzymeSectors
---
# EnzymeSectors

## Sector Objects

Expand Down
5 changes: 1 addition & 4 deletions docs/api_reference/PAMValidator.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
---
sidebar_label: PAMValidator
title: PAMValidator
---
# PAMValidator

## PAMValidator Objects

Expand Down
5 changes: 1 addition & 4 deletions docs/api_reference/PAModel.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
---
sidebar_label: PAModel
title: PAModel
---
# PAModel

## PAModel Objects

Expand Down
5 changes: 1 addition & 4 deletions docs/api_reference/configuration.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
---
sidebar_label: configuration
title: configuration
---
# Configuration

## Config Objects

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
copyright = '2024, iAMB, RWTH Aachen University'
author = 'Samira van den Bogaard'

release = '0.4.1'
version = '0.4.1'
release = '0.4.2'
version = '0.4.2'

# -- General configuration

Expand Down
43 changes: 19 additions & 24 deletions docs/example.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
from PAModelpy.Scripts.protein_costs_analysis import active_enzyme_infofrom PAModelpy.src import merge_enzyme_complexesfrom PAModelpy.Scripts.protein_costs_analysis import active_enzyme_infofrom PAModelpy.Scripts.protein_costs_analysis import active_enzyme_info---
title: 'Examples'
sidebar_position: 2
sidebar_title: 'Examples'
---

# Example usage of PAModelpy
*************

## Example 1: setting up an *Escherichia coli* Protein Allocation model (PAM)
*****
*Escherichia coli* (*E.coli*) is a commonly used model organism in Microbiology. When this microorganism is grown
on increasing glucose concentration, it shifts from a purely respiratory metabolism to a respiro-fermentative metabolic
phenotype. This phenomenon is called 'overflow metabolism'. Interestingly, overflow metabolism cannot be simulated using
Expand Down Expand Up @@ -66,7 +58,7 @@ import os
pam = set_up_pam(os.path.join('Data', 'proteinAllocationModel_iML1515_EnzymaticData_py_uniprot.xlsx'),
os.path.join('Models', 'iML1515.xml'))
```
More information can be found in the `PAM_setup_guide`
More information can be found in the :ref:`PAM_setup_guide`

#### 1.1: Active enzyme sector
The active enzyme sector will be build using information about which enzymes catalyzes a specific reaction,
Expand All @@ -89,15 +81,20 @@ object. The main input in this object is the rxn2protein dictionary, where all t
associations required to build the protein-reaction relations in the model. It has the following format:

```json
{'R1':
{'E1':
{'f': forward kcat, 'b': backward kcat,
'molmass': molar mass,
'protein_reaction_relation': [['E1']]},
'E2':
{'f': forward kcat, 'b': backward kcat,
'molmass': molar mass,
'protein_reaction_relation': [['E1']]}
{
"R1": {
"E1": {
"f": "forward kcat",
"b": "backward kcat",
"molmass": "molar mass",
"protein_reaction_relation": [["E1"]]
},
"E2": {
"f": "forward kcat",
"b": "backward kcat",
"molmass": "molar mass",
"protein_reaction_relation": [["E1"]]
}
}
}
```
Expand All @@ -106,7 +103,7 @@ peptides/proteins for one or more reactions), this information can be added in t
of the reaction2protein dictionary. This entry is a list of lists, in which each sublist represent one functional
enzyme (complex). This means if E1 and E2 catalyze the same reaction, the `protein_reaction_relation` becomes `[['E1','E2']]`
for an enzyme complex ('AND' relation), and `[['E1']['E2']]` for isozymes ('OR' relation). In this example we will use
the peptide ids as defined by [UniProt](). The [paper introducting sEnz](https://doi.org/10.1093/bioinformatics/btae691)
the peptide ids as defined by [UniProt](https://www.uniprot.org/). The [paper introducting sEnz](https://doi.org/10.1093/bioinformatics/btae691)
uses a different system, based on EC numbers. How to build those PAMs can be found in the scripts associated to the
publication and in the `Script/pam_generation.py` file. Now we will use gene-protein-reaction relations obtained from a
genome-scale model and uniprot to include different enzyme relations.
Expand Down Expand Up @@ -228,17 +225,15 @@ the model, such as deleting or adding enzymes, changing kcats, changing enzymes
at the following jupyter notebook: `Examples/PAModel_example_script.ipynb`. Have fun!

## Example 2: Determining the most sensitive enzymes in a toy model
******

When looking at the flux distribution resulting from our simulations, we do not get any information about which enzymes
played an important role in prediciting the specific metabolic phenotype. However, with the right model configurations,
we get the sensitivity of the objective function to slight changes in the enzyme availability (enzyme sensitivity
coefficients, ESC) as a result from the model simulations. In this example we'll use a toy model to illustrate how these
sensitivities can help us explain concepts of protein allocation.


<figure id="toy_model_image">

![toy_model_image](assetsoy-model.png)
![toy_model_image](assets/toy-model.png)

<figcaption>**Figure 1. Toy model network and parameters**
*This toy model represents a schematic overview of a microbial metabolism,
Expand Down Expand Up @@ -380,7 +375,7 @@ print_heatmap(x_axis_esc, Cesc, yaxis=substrate_axis)
```

### Step 4: Interpret the results
Compare the [toy model network structure](#toy_model_image) with the results from the heatmap. Did you expect these results? Do they make
Compare the toy model network structure :ref:`toy_model_image` with the results from the heatmap. Did you expect these results? Do they make
sense? Which mechanisms to explain these observations. If the observations are not inline with you're expectations,
you can use the enzyme sensitivities to point to the enzymatic parameters which might need to be adjusted (in this dummy
example this makes no sense off course, but in reality this is a very plausible outcome).
Expand Down
19 changes: 15 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,22 @@ Welcome to PAModelpy
The PAModelpy package is designed to integrate protein constraints and protein sectors into protein allocation models (PAMs).
In this documentation, you can find all the information you need to build and analyze PAMs.

Table of Contents
==================
.. toctree::
:glob:
:maxdepth: 2
:caption: Table of Contents

*.md
introduction.md
example.md
PAM_setup_guide.md

.. toctree::
:maxdepth: 1
:caption: API reference

api_reference/CatalyticEvent.md
api_reference/Constraints.md
api_reference/Enzyme.md
api_reference/EnzymeSectors.md
api_reference/PAMValidator.md
api_reference/PAModel.md
api_reference/configuration.md
8 changes: 0 additions & 8 deletions docs/introduction.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
---
title: 'Introduction'
sidebar_position: 1
sidebar_title: 'Introduction'
slug: '/'
---

# PAModelpy - Protein Allocation Model reconstruction in Python
*******

## What is PAModelpy?
Models of metabolism are powerful tools to explore the metabolic potential of microorganism.
Expand Down
1 change: 1 addition & 0 deletions src/PAModelpy/EnzymeSectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def add(self, model):

del rxn2protein[rxn_id]
except:
print(model.reactions.query(rxn_id))
warn(
f"Reaction {rxn_id} is not in the model, this reaction will be skipped"
)
Expand Down

0 comments on commit d9b4fe6

Please sign in to comment.