Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sampling on the flux space of multiple metabolic networks #18

Closed
wants to merge 65 commits into from

Conversation

hariszaf
Copy link
Collaborator

Two main modules are included on this PR:

  • about 6,000 bacterial metabolic models have been converted to .mat format using the embl_model_convert.m script. The The script has been used to convert EMBL models that are publicly available here as well as models that were built using publicly available genomes and the carveme software tool for automatic metabolic modelling reconstruction
  • 2 classes called CommunityMetabolicNetwork and CommunityPolytopeSampler that enable sampling on the flux space of multiple metabolic networks.

To enable testing this new module of dingo an input example has been added under the ext_data directory.

The new module has been integrated in the __init__.py and can be used both from terminal and as a function of the dingo package.

@vissarion vissarion added the enhancement New feature or request label Aug 30, 2021
@@ -0,0 +1,14786 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this file needed to be included in the repo? It is huge and readily available from http://bigg.ucsd.edu/static/models/e_coli_core.json

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similarly for ext_data/community_models/iIT341.json it is that large that github cannot show it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the 2 .json files with a README explaining the reasond for this directory

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could remove the directory completely if you find it of no use.

[`iIT341.json`](http://bigg.ucsd.edu/models/iIT341) files from the [BIGG database](http://bigg.ucsd.edu/models)
and then run `dingo`.

Remember to remove this `README.md` file if you will decide to use this directory.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you leave the README.md file, dingo will give you an
Exception: An unknown input format given to initialize a metabolic network object. message.

We can add a check on the code for the README file if you feel this is necessary.

For example, you may have a community of 2 models, *Escherichia coli* and *Helicobacter pylori*,
in that case you could get the [`e_coli_core.json`](http://bigg.ucsd.edu/models/e_coli_core) and
[`iIT341.json`](http://bigg.ucsd.edu/models/iIT341) files from the [BIGG database](http://bigg.ucsd.edu/models)
and then run `dingo`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please add an example of use i.e. a command from terminal that uses dingo to do some computations to e_coli and iIT341 community

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you have a look now?

@@ -223,3 +223,205 @@ def shut_down_reaction(self, index_val):

self._lb[index_val] = 0
self._ub[index_val] = 0


class CommunityMetabolicNetwork():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a single .py document per class

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done as suggested.

self._comm_parameters["opt_percentage"],
)

def fba(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which objective function do you use here?
I think FBA has to be separately applied in each model to obtain the maximum value per model.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to consider an FBA per organism (single standed network) and something like a community FBA for the total community model a.k.a the μ_c as described in the micom concept..

How about leaving as fba the per organism and build a new function for community growth ?

def fva(self):
"""A member function to apply the FVA method on the community metabolic network."""

if self._comm_parameters["fast_computations"]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should set the objective function to the zero vector before FVA() to study the unbiased case.




class CommunityPolytopeSampler:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a single .py document per class

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done as suggested.

import sys
from dingo.loading_models import read_json_file, read_mat_file
import sys, os
from dingo.loading_models import read_json_file, read_mat_file, getModelList
from dingo.fva import slow_fva
from dingo.fba import slow_fba

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the documentation according to your new implementations

@vissarion vissarion marked this pull request as draft December 15, 2022 13:58
@vissarion
Copy link
Member

This is quite old and should be re-implemented from scratch

@vissarion vissarion closed this Feb 3, 2023
@hariszaf
Copy link
Collaborator Author

Way to go:

  • implement approach from cobra toolbox to build merged model
  • sample by asking biomass of species A to be 0 and biomass of species B to be max
  • sample with the vice versa conditions
  • sample asking for both biomass functions to be max

@vissarion
Copy link
Member

Thanks @hariszaf I added issue #67 to keep track on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants