AuReMe / metage2metabo

From annotated genomes to metabolic screening in large scale microbiotas
https://metage2metabo.readthedocs.io
GNU Lesser General Public License v3.0
53 stars 7 forks source link

Create a list of targets for the content of the community metabolic potential #21

Closed cfrioux closed 8 months ago

cfrioux commented 3 years ago

An interesting analysis can be to select minimal communities suitable to sustain the producibility of all compounds the community can produce. This consists in building a set of targets consisting of the metabolites in the community scope (community metabolic potential).

An easy solution can be to create a SBML file containing compounds occurring in the community scope (community_analysis/comm_scopes.json).

alsmadin01 commented 2 years ago

Hi @cfrioux, Hi @ArnaudBelcour,

This would be great! When will this option become available?

Best regards,

Noor Alsmadi

cfrioux commented 2 years ago

Creating a list of targets for all the reachable compounds of the community (community scope) is not implemented yet. I do not have time to properly include it in m2m these days, but, I've got a snippet to do it, if you're interested.

import sys
import json
from metage2metabo.sbml_management import create_species_sbml

# inputs
jsonfile = sys.argv[1]
output_file_sbml = sys.argv[2]

# read scope file and retrieve targets
with open(jsonfile, "r") as f:
    raw = json.load(f)

targets = raw["com_scope"]

# create a SBML with the targets
create_species_sbml(targets, output_file_sbml)

You write the above script in a file (let's say scope_to_targets.py) and call it this way:

python scope_to_targets.py community_analysis/comm_scopes.json community_analysis/comm_scopes.sbml

ArnaudBelcour commented 8 months ago

Added in #61.