screening metabolites of multiple models to find specific chemical formulas

36 views
Skip to first unread message

Alon Ginatt

unread,
Jun 26, 2022, 5:56:11 AM6/26/22
to cobra pie
Hi All,

I have an array of models, which I simulate their growth under different media (minimal media, currently), and I'm looking for an efficient way to go over each model's exchanges (via their medium), in order to find exchanges of metabolites with a specific chemical formula. for example, an exchange of a metabolite composed of P and C with arbitrary values. I figured out I should use the elements attribute of the metabolites objects, but since I'm dealing with exchanges this has turned quite cumbersome. 

Any ideas?

Thank you in advance!

Alon   

Matthias König

unread,
Jun 29, 2022, 5:02:50 AM6/29/22
to cobra pie
You could just iterate over the boundary reactions of the models and get the chemical formulas from the respective species.
Something along the line of

```python
for model in models:
    for rb in model.boundaries:
        # only interested in reactions with a single metabolite
        if len(rb.metabolites) == 1:
            metabolite = rb.keys()[0]
            formula = metabolite.formula
```
Nothing tested, just typed in the email ;), so names/syntax could be a bit different. But you should get the idea.

Best M

Alon Ginatt

unread,
Aug 23, 2022, 4:18:35 AM8/23/22
to cobra pie
Got it!
Thank you!

(and sorry for the late response)

Reply all
Reply to author
Forward
0 new messages