CoCoMiCo


NameCoCoMiCo JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://gitlab.inria.fr/ccmc/CoCoMiCo
SummaryCOoperation and COmpetition potentials in MIcrobial COmunities
upload_time2023-01-19 17:42:29
maintainer
docs_urlNone
authorMaxime lecomte
requires_python>=3.8
licenseGPLv3+
keywords microbial communities bioinformatics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CoCoMiCo : COoperation and COmpetition in MIcrobial COmmunities

CoCoMiCo aims at characterising the metabolism of microbial communities through genome-scale metabolic networks: it calculates cooperation and competition potentials for the communities.
It has two modes:
* a regular mode: cooperation and competition potentials are computed for a community whose associated genome-scale metabolic networks are located in a directory: (`run` mode)
* a `benchmark` mode: run can be performed systematically for a collection of microbial communities described in a `json` file

CoCoMiCo can be tested on toy data using the following command: `cocomico toys`.

## Install

Required **Python >= 3.7**. The main dependency of CoCoMiCo is an Answer Set Programming (ASP) solver. [Clyngor](https://github.com/Aluriak/clyngor) permits the connection between Python and ASP, whereas [Clyngor_with_clingo](https://github.com/Aluriak/clyngor-with-clingo/) provides the solver binaries in the Python environment. If you work in a conda environment, installing the solvers directly ([clingo](https://anaconda.org/potassco/clingo)) makes it unnecessary to install Clyngor_with_clingo.

```
pip install cocomico
```

or

```
python setyp.py install
```

or after cloning this repository

```
pip install .
```

**If you use CoCoMiCo, please cite:**

Lecomte M, Muller C, Badoual A, Falentin H, Sherman DJ, and Frioux C. 2023. CoCoMiCo: metabolic modelling of cooperation and competition potentials in large-scale bacterial communities.

## Usage

### Single community run

`run` needs the specific architecture as follow:

```
Community_folder
├── species_1.sbml
├── species_4.sbml
├── species_10.sbml
```

Metabolic network file in the community_folder can be in either `.xml` or `.sbml` format. `run` mode creates the `json` community in the appropriate format described in the section **benchmark**.

```
usage: cocomico run [-h] [-folder_path FOLDER_PATH] [-seed_path SEED_PATH] [-output OUTPUT]

optional arguments:
  -h, --help            show this help message and exit
  -i, -folder_path FOLDER_PATH, --folder_path FOLDER_PATH
                        Directory path of a community composed of sbml or xml files.
  -s, -seed_path SEED_PATH, --seed_path SEED_PATH
                        path of seed file
  -o, -output OUTPUT, --output OUTPUT
                        output path
```

#### Exemple of execution

`
cocomico run -folder_path PATH_COMMUNITIES_FOLDER -seed_path  PATH_SEED_FILE -output PATH_OUTPUT
`
### Multiple runs: benchmarking mode

`benchmark` needs the genome-scale metabolic networks used for community construction to be stored in a directory and a json file describing the composition of each sample as follow.
For example:

```
Folder_input
├── communities.json
├── sbml
│   └── species_1.sbml
│   └── species_4.xml
|    ..
```

`communities.json`` must be in the following format:

```
{
    "com_0" :[
            species_1.sbml,
            species_4.xml,
            species_10.sbml
    ],
    "com_1" :[
            species_12.xml,
            species_120.sbml
    ]
}

```

Here, sample `com0` is composed of three species: `species_`, `species_4` and `species_10`.


```
usage: cocomico benchmark [-h] [-json_com JSON_COM] [-seed_path SEED_PATH] [-sbml_path SBML_PATH] [-output OUTPUT]

optional arguments:
  -h, --help            show this help message and exit
  -j, -json_com JSON_COM, --json_com JSON_COM
                        path of the json file
  -s, -seed_path SEED_PATH, --seed_path SEED_PATH
                        path of seed file
  -i, -sbml_path SBML_PATH, --sbml_path SBML_PATH
                        folder path to find sbml model
  -o -output OUTPUT, --output OUTPUT
                        output path

```

#### Exemple of execution

`
cocomico benchmark -json_com PATH_COMMUNITIES_JSON_FILE -seed_path  PATH_SEED_FILE -sbml_path PATH_SBML_DIRECTORY -output PATH_OUTPUT
`


### toys

```
usage: cocomico toys [-h] [-output OUTPUT]

optional arguments:
  -h, --help            show this help message and exit
  -o, -output OUTPUT, --output OUTPUT
                        output path
```

## Output

In a folder `community_scores`, the output is a json file as follow:

```
{
    ""metabolite production value (delta)": 31,
    "metabolite production value_metric": {
        "added value community": 17,
        "all individual can produce": 14
    },
    "cooP": 18.0,
    "cooP_metric": {
        "number of exchanged metabolites": 8,
        "pi producers": 8.5,
        "pi consumers": 9.5
    },
    "reaction production(rho)": 58,
    "reaction production_metric": {
        "added value comunity": 37
    },
    "comP": 3.25,
    "comP_metric": {
        "total number of limited subtrates": 13
    },
    "bacteria": [
        "Com2Org1",
        "Com2Org4",
        "Com2Org2",
        "Com2Org3"
    ]
}
```

In addition, a `scores.tsv` file is generated, in the output directory, containing all information about the communities:

- `ComP` and `Coop` are respectively the competition and the cooperation potentials.
- `rh` is a score describing the gain of activated reactions in the interacting community with respect to activated reaction in a non-interacting community
- `delt` is a score describing the gain of producible metabolites in the interacting community with respect to activated reaction in a non-interacting community
- `com_siz` describes the size of the corresponding community ie the number of genome-scale metabolic networks
- `nb_exc_cpd` denotes the putative number of metabolic exchanges in the community
- `CooP_producers` and `CooP_consumers` calculate respectively the number of producers and consumers of exchanged metabolites, applying an exponential decrease to the score each time a metabolite is produced (respectively consumed) by more than one member.

|   | delta | cooP | rho | comP | com_size | nb_exc_cpd | cooP_producers | cooP_consumers |
|---|-------|------|-----|------|----------|------------|----------------|----------------|
| 0 | 22    | 10.0 | 40  | 2.66 | 3        | 4          | 4.5            | 5.5            |
| 1 | 31    | 18.0 | 58  | 3.25 | 4        | 8          | 8.5            | 9.5            |


# Version
CoCoMiCo version 0.2.1

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.inria.fr/ccmc/CoCoMiCo",
    "name": "CoCoMiCo",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "microbial communities,bioinformatics",
    "author": "Maxime lecomte",
    "author_email": "maxime.lecomte@inria.fr,clemence.frioux@inria.fr",
    "download_url": "https://files.pythonhosted.org/packages/1c/5a/7da477120e0cfd972b8c8aee3f37d79c7e7f4c204a6bae84f38a8e034601/CoCoMiCo-0.2.1.tar.gz",
    "platform": null,
    "description": "# CoCoMiCo : COoperation and COmpetition in MIcrobial COmmunities\n\nCoCoMiCo aims at characterising the metabolism of microbial communities through genome-scale metabolic networks: it calculates cooperation and competition potentials for the communities.\nIt has two modes:\n* a regular mode: cooperation and competition potentials are computed for a community whose associated genome-scale metabolic networks are located in a directory: (`run` mode)\n* a `benchmark` mode: run can be performed systematically for a collection of microbial communities described in a `json` file\n\nCoCoMiCo can be tested on toy data using the following command: `cocomico toys`.\n\n## Install\n\nRequired **Python >= 3.7**. The main dependency of CoCoMiCo is an Answer Set Programming (ASP) solver. [Clyngor](https://github.com/Aluriak/clyngor) permits the connection between Python and ASP, whereas [Clyngor_with_clingo](https://github.com/Aluriak/clyngor-with-clingo/) provides the solver binaries in the Python environment. If you work in a conda environment, installing the solvers directly ([clingo](https://anaconda.org/potassco/clingo)) makes it unnecessary to install Clyngor_with_clingo.\n\n```\npip install cocomico\n```\n\nor\n\n```\npython setyp.py install\n```\n\nor after cloning this repository\n\n```\npip install .\n```\n\n**If you use CoCoMiCo, please cite:**\n\nLecomte M, Muller C, Badoual A, Falentin H, Sherman DJ, and Frioux C. 2023. CoCoMiCo: metabolic modelling of cooperation and competition potentials in large-scale bacterial communities.\n\n## Usage\n\n### Single community run\n\n`run` needs the specific architecture as follow:\n\n```\nCommunity_folder\n\u251c\u2500\u2500 species_1.sbml\n\u251c\u2500\u2500 species_4.sbml\n\u251c\u2500\u2500 species_10.sbml\n```\n\nMetabolic network file in the community_folder can be in either `.xml` or `.sbml` format. `run` mode creates the `json` community in the appropriate format described in the section **benchmark**.\n\n```\nusage: cocomico run [-h] [-folder_path FOLDER_PATH] [-seed_path SEED_PATH] [-output OUTPUT]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -i, -folder_path FOLDER_PATH, --folder_path FOLDER_PATH\n                        Directory path of a community composed of sbml or xml files.\n  -s, -seed_path SEED_PATH, --seed_path SEED_PATH\n                        path of seed file\n  -o, -output OUTPUT, --output OUTPUT\n                        output path\n```\n\n#### Exemple of execution\n\n`\ncocomico run -folder_path PATH_COMMUNITIES_FOLDER -seed_path  PATH_SEED_FILE -output PATH_OUTPUT\n`\n### Multiple runs: benchmarking mode\n\n`benchmark` needs the genome-scale metabolic networks used for community construction to be stored in a directory and a json file describing the composition of each sample as follow.\nFor example:\n\n```\nFolder_input\n\u251c\u2500\u2500 communities.json\n\u251c\u2500\u2500 sbml\n\u2502   \u2514\u2500\u2500 species_1.sbml\n\u2502   \u2514\u2500\u2500 species_4.xml\n|    ..\n```\n\n`communities.json`` must be in the following format:\n\n```\n{\n    \"com_0\" :[\n            species_1.sbml,\n            species_4.xml,\n            species_10.sbml\n    ],\n    \"com_1\" :[\n            species_12.xml,\n            species_120.sbml\n    ]\n}\n\n```\n\nHere, sample `com0` is composed of three species: `species_`, `species_4` and `species_10`.\n\n\n```\nusage: cocomico benchmark [-h] [-json_com JSON_COM] [-seed_path SEED_PATH] [-sbml_path SBML_PATH] [-output OUTPUT]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -j, -json_com JSON_COM, --json_com JSON_COM\n                        path of the json file\n  -s, -seed_path SEED_PATH, --seed_path SEED_PATH\n                        path of seed file\n  -i, -sbml_path SBML_PATH, --sbml_path SBML_PATH\n                        folder path to find sbml model\n  -o -output OUTPUT, --output OUTPUT\n                        output path\n\n```\n\n#### Exemple of execution\n\n`\ncocomico benchmark -json_com PATH_COMMUNITIES_JSON_FILE -seed_path  PATH_SEED_FILE -sbml_path PATH_SBML_DIRECTORY -output PATH_OUTPUT\n`\n\n\n### toys\n\n```\nusage: cocomico toys [-h] [-output OUTPUT]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -o, -output OUTPUT, --output OUTPUT\n                        output path\n```\n\n## Output\n\nIn a folder `community_scores`, the output is a json file as follow:\n\n```\n{\n    \"\"metabolite production value (delta)\": 31,\n    \"metabolite production value_metric\": {\n        \"added value community\": 17,\n        \"all individual can produce\": 14\n    },\n    \"cooP\": 18.0,\n    \"cooP_metric\": {\n        \"number of exchanged metabolites\": 8,\n        \"pi producers\": 8.5,\n        \"pi consumers\": 9.5\n    },\n    \"reaction production(rho)\": 58,\n    \"reaction production_metric\": {\n        \"added value comunity\": 37\n    },\n    \"comP\": 3.25,\n    \"comP_metric\": {\n        \"total number of limited subtrates\": 13\n    },\n    \"bacteria\": [\n        \"Com2Org1\",\n        \"Com2Org4\",\n        \"Com2Org2\",\n        \"Com2Org3\"\n    ]\n}\n```\n\nIn addition, a `scores.tsv` file is generated, in the output directory, containing all information about the communities:\n\n- `ComP` and `Coop` are respectively the competition and the cooperation potentials.\n- `rh` is a score describing the gain of activated reactions in the interacting community with respect to activated reaction in a non-interacting community\n- `delt` is a score describing the gain of producible metabolites in the interacting community with respect to activated reaction in a non-interacting community\n- `com_siz` describes the size of the corresponding community ie the number of genome-scale metabolic networks\n- `nb_exc_cpd` denotes the putative number of metabolic exchanges in the community\n- `CooP_producers` and `CooP_consumers` calculate respectively the number of producers and consumers of exchanged metabolites, applying an exponential decrease to the score each time a metabolite is produced (respectively consumed) by more than one member.\n\n|   | delta | cooP | rho | comP | com_size | nb_exc_cpd | cooP_producers | cooP_consumers |\n|---|-------|------|-----|------|----------|------------|----------------|----------------|\n| 0 | 22    | 10.0 | 40  | 2.66 | 3        | 4          | 4.5            | 5.5            |\n| 1 | 31    | 18.0 | 58  | 3.25 | 4        | 8          | 8.5            | 9.5            |\n\n\n# Version\nCoCoMiCo version 0.2.1\n",
    "bugtrack_url": null,
    "license": "GPLv3+",
    "summary": "COoperation and COmpetition potentials in MIcrobial COmunities",
    "version": "0.2.1",
    "split_keywords": [
        "microbial communities",
        "bioinformatics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "abc317c41b05e5ee39d30eb2878ec1b09b8ce6572f03150de12d6760ace0a3d3",
                "md5": "0eef7a8aa3d0409be4b987942b742760",
                "sha256": "ecbadac6c0d8aff83bd54a5d4d239b172647d6fc587f835c25733f2c13349799"
            },
            "downloads": -1,
            "filename": "CoCoMiCo-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0eef7a8aa3d0409be4b987942b742760",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 34805,
            "upload_time": "2023-01-19T17:42:27",
            "upload_time_iso_8601": "2023-01-19T17:42:27.956508Z",
            "url": "https://files.pythonhosted.org/packages/ab/c3/17c41b05e5ee39d30eb2878ec1b09b8ce6572f03150de12d6760ace0a3d3/CoCoMiCo-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1c5a7da477120e0cfd972b8c8aee3f37d79c7e7f4c204a6bae84f38a8e034601",
                "md5": "86ddf79a139268e72ad2573f947e1ca2",
                "sha256": "d83ee428661124f75bf39491c51b0ae6b5bebdf1772746ac5853c3b8096e8c49"
            },
            "downloads": -1,
            "filename": "CoCoMiCo-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "86ddf79a139268e72ad2573f947e1ca2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 38740,
            "upload_time": "2023-01-19T17:42:29",
            "upload_time_iso_8601": "2023-01-19T17:42:29.712404Z",
            "url": "https://files.pythonhosted.org/packages/1c/5a/7da477120e0cfd972b8c8aee3f37d79c7e7f4c204a6bae84f38a8e034601/CoCoMiCo-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-19 17:42:29",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "cocomico"
}
        
Elapsed time: 0.04976s