mineapy


Namemineapy JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/vpandey-om/mineapy/
Summarymineapy, Minimum network enrichment analysis in Python
upload_time2024-08-21 09:31:54
maintainerNone
docs_urlNone
authorvikash pandey
requires_python!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,<4,>=3.7
licenseApache 2.0
keywords mineapy minea thermodynamics enrichment analysis
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# MiNEApy

![PyPI](https://img.shields.io/pypi/v/mineapy.svg) ![license](http://img.shields.io/badge/license-APACHE2-blue.svg)

MiNEApy is a Python package for performing Minimum Network Enrichment Analysis (MiNEA), with a focus on thermodynamic and enrichment analysis in biological systems.

Vikash Pandey and Vassily Hatzimanikatis. Investigating the deregulation of metabolic tasks via Minimum Network Enrichment Analysis (MiNEA) as applied to nonalcoholic fatty liver disease using mouse and human omics data. [DOI: https://doi.org/10.1371/journal.pcbi.1006760](https://doi.org/10.1371/journal.pcbi.1006760)

## Requirements

You will need to have [Git-LFS](https://git-lfs.github.com/) installed to properly download some binary files:

```bash
git clone https://github.com/vpandey-om/mineapy.git /path/to/mineapy
cd /path/to/mineapy
git lfs install
git lfs pull
```

**This module was developed in Python 3.7, and it is recommended to run Python 3.7 to ensure compatibility with commercial solvers such as Gurobi and CPLEX.**

MiNEApy depends on several Python packages including:

- [COBRApy](https://github.com/opencobra/cobrapy/)
- [pyTFA](https://github.com/EPFL-LCSB/pytfa/)
- [optlang](https://github.com/biosustain/optlang/)

The installation process should handle these dependencies for you. However, if you are using a dedicated solver, you may need to install it separately. Supported solvers include GLPK, CPLEX, and Gurobi.

## Setup

You will need to install [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/) and create an environment using Python 3.7:

```bash
conda create -n py37 python=3.7
conda activate py37
```

### Using pip

To install MiNEApy with pip, you can use the `requirements.txt` file:

```bash
pip install -r requirements.txt
```

Alternatively, you can install the specific version directly from PyPI:

```bash
pip install mineapy==0.0.4
```

### Installing from Source

If you prefer to install from the source:

```bash
conda create -n py37 python=3.7
conda activate py37

# Inside the py37 environment, download from GitHub and install.
git clone https://github.com/vpandey-om/mineapy.git /path/to/mineapy
cd /path/to/mineapy
pip install -e .
```

## Quick Start

Two tutorial files detail the typical usage of the MiNEApy package. They can be found in the `tutorials` directory:

```
mineapy
└── tutorials
    ├── e_coli_core.py
    └── e_coli_gem.py
```

Here’s a quick example:

```python
import mineapy
from cobra.io import load_matlab_model
import pandas as pd
from mineapy.core.taskEnrich import TaskEnrichment
from mineapy.core.thermo_model import ThermoModel_WithoutInfo
from mineapy.core.rxnExp import ReactionExp

# Load the e_coli_core model
cobra_model = load_matlab_model('./models/e_coli_core.mat')
genes = [g.id for g in cobra_model.genes]

# MiNEA parameters
path_to_params = './input/task_enrichment_params.yaml'

# Add condition- or context-specific expression data
context_df = pd.read_csv('./input/context.txt', sep='\t')
condition_df = pd.read_csv('./input/condition.txt', sep='\t')

# Get genes regulated between different conditions
gene_reg = {'gene_id': condition_df['geneid'].to_list(), 'fold_change': condition_df['fold change'].to_list(), 'up_cutoff': 1.35, 'down_cutoff': float(1/2.5)}
reg_analysis = ReactionExp(cobra_model, gene_reg=gene_reg)

# Set cutoff, e.g., 15% top and bottom in ranking
gene_exp = {'gene_id': context_df['geneid'].to_list(), 'exp_val': context_df['exp_val'].to_list(), 'high_cutoff': 0.15, 'low_cutoff': 0.15}
exp_analysis = ReactionExp(cobra_model, gene_exp=gene_exp)
params_rxns = {'high_rxns': exp_analysis.high_rxns, 'low_rxns': exp_analysis.low_rxns}

# Apply enrichment algorithms
task_enrich = TaskEnrichment(cobra_model, path_to_params, params_rxns)
task_enrich.run()
```

## Usage

First, create your COBRApy model. Make sure to define the additional values required by pyTFA, as mentioned in the "Models" page of the documentation.

If you already have a Matlab model with thermodynamic data, you might want to use `pytfa.io.import_matlab_model`. Otherwise, refer to the [COBRApy documentation](https://cobrapy.readthedocs.io/en/latest/io.html#MATLAB) to add the required properties.

If you're using a specific solver, don't forget to configure COBRApy by setting the `solver` property of your model. See the [COBRApy solvers documentation](https://cobrapy.readthedocs.io/en/latest/solvers.html) for more information.

## License

The software in this repository is licensed under the Apache-2.0 License. Please see the [LICENSE](https://github.com/EPFL-LCSB/pytfa/blob/master/LICENSE.txt) file for more details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/vpandey-om/mineapy/",
    "name": "mineapy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,<4,>=3.7",
    "maintainer_email": null,
    "keywords": "mineapy, minea, thermodynamics, enrichment analysis",
    "author": "vikash pandey",
    "author_email": "vikash.pandey@umu.se",
    "download_url": "https://files.pythonhosted.org/packages/7f/24/59bce5d2306d40be038da69f6d7dd5f5ec94b3a8922b2885efa34875703b/mineapy-0.0.4.tar.gz",
    "platform": null,
    "description": "\n# MiNEApy\n\n![PyPI](https://img.shields.io/pypi/v/mineapy.svg) ![license](http://img.shields.io/badge/license-APACHE2-blue.svg)\n\nMiNEApy is a Python package for performing Minimum Network Enrichment Analysis (MiNEA), with a focus on thermodynamic and enrichment analysis in biological systems.\n\nVikash Pandey and Vassily Hatzimanikatis. Investigating the deregulation of metabolic tasks via Minimum Network Enrichment Analysis (MiNEA) as applied to nonalcoholic fatty liver disease using mouse and human omics data. [DOI: https://doi.org/10.1371/journal.pcbi.1006760](https://doi.org/10.1371/journal.pcbi.1006760)\n\n## Requirements\n\nYou will need to have [Git-LFS](https://git-lfs.github.com/) installed to properly download some binary files:\n\n```bash\ngit clone https://github.com/vpandey-om/mineapy.git /path/to/mineapy\ncd /path/to/mineapy\ngit lfs install\ngit lfs pull\n```\n\n**This module was developed in Python 3.7, and it is recommended to run Python 3.7 to ensure compatibility with commercial solvers such as Gurobi and CPLEX.**\n\nMiNEApy depends on several Python packages including:\n\n- [COBRApy](https://github.com/opencobra/cobrapy/)\n- [pyTFA](https://github.com/EPFL-LCSB/pytfa/)\n- [optlang](https://github.com/biosustain/optlang/)\n\nThe installation process should handle these dependencies for you. However, if you are using a dedicated solver, you may need to install it separately. Supported solvers include GLPK, CPLEX, and Gurobi.\n\n## Setup\n\nYou will need to install [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/) and create an environment using Python 3.7:\n\n```bash\nconda create -n py37 python=3.7\nconda activate py37\n```\n\n### Using pip\n\nTo install MiNEApy with pip, you can use the `requirements.txt` file:\n\n```bash\npip install -r requirements.txt\n```\n\nAlternatively, you can install the specific version directly from PyPI:\n\n```bash\npip install mineapy==0.0.4\n```\n\n### Installing from Source\n\nIf you prefer to install from the source:\n\n```bash\nconda create -n py37 python=3.7\nconda activate py37\n\n# Inside the py37 environment, download from GitHub and install.\ngit clone https://github.com/vpandey-om/mineapy.git /path/to/mineapy\ncd /path/to/mineapy\npip install -e .\n```\n\n## Quick Start\n\nTwo tutorial files detail the typical usage of the MiNEApy package. They can be found in the `tutorials` directory:\n\n```\nmineapy\n\u2514\u2500\u2500 tutorials\n    \u251c\u2500\u2500 e_coli_core.py\n    \u2514\u2500\u2500 e_coli_gem.py\n```\n\nHere\u2019s a quick example:\n\n```python\nimport mineapy\nfrom cobra.io import load_matlab_model\nimport pandas as pd\nfrom mineapy.core.taskEnrich import TaskEnrichment\nfrom mineapy.core.thermo_model import ThermoModel_WithoutInfo\nfrom mineapy.core.rxnExp import ReactionExp\n\n# Load the e_coli_core model\ncobra_model = load_matlab_model('./models/e_coli_core.mat')\ngenes = [g.id for g in cobra_model.genes]\n\n# MiNEA parameters\npath_to_params = './input/task_enrichment_params.yaml'\n\n# Add condition- or context-specific expression data\ncontext_df = pd.read_csv('./input/context.txt', sep='\\t')\ncondition_df = pd.read_csv('./input/condition.txt', sep='\\t')\n\n# Get genes regulated between different conditions\ngene_reg = {'gene_id': condition_df['geneid'].to_list(), 'fold_change': condition_df['fold change'].to_list(), 'up_cutoff': 1.35, 'down_cutoff': float(1/2.5)}\nreg_analysis = ReactionExp(cobra_model, gene_reg=gene_reg)\n\n# Set cutoff, e.g., 15% top and bottom in ranking\ngene_exp = {'gene_id': context_df['geneid'].to_list(), 'exp_val': context_df['exp_val'].to_list(), 'high_cutoff': 0.15, 'low_cutoff': 0.15}\nexp_analysis = ReactionExp(cobra_model, gene_exp=gene_exp)\nparams_rxns = {'high_rxns': exp_analysis.high_rxns, 'low_rxns': exp_analysis.low_rxns}\n\n# Apply enrichment algorithms\ntask_enrich = TaskEnrichment(cobra_model, path_to_params, params_rxns)\ntask_enrich.run()\n```\n\n## Usage\n\nFirst, create your COBRApy model. Make sure to define the additional values required by pyTFA, as mentioned in the \"Models\" page of the documentation.\n\nIf you already have a Matlab model with thermodynamic data, you might want to use `pytfa.io.import_matlab_model`. Otherwise, refer to the [COBRApy documentation](https://cobrapy.readthedocs.io/en/latest/io.html#MATLAB) to add the required properties.\n\nIf you're using a specific solver, don't forget to configure COBRApy by setting the `solver` property of your model. See the [COBRApy solvers documentation](https://cobrapy.readthedocs.io/en/latest/solvers.html) for more information.\n\n## License\n\nThe software in this repository is licensed under the Apache-2.0 License. Please see the [LICENSE](https://github.com/EPFL-LCSB/pytfa/blob/master/LICENSE.txt) file for more details.\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "mineapy, Minimum network enrichment analysis in Python",
    "version": "0.0.4",
    "project_urls": {
        "Download": "https://github.com/vpandey-om/mineapy/archive/v0.0.4-alpha.tar.gz",
        "Homepage": "https://github.com/vpandey-om/mineapy/"
    },
    "split_keywords": [
        "mineapy",
        " minea",
        " thermodynamics",
        " enrichment analysis"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "870760ed3419c48c2ff2035c166b6b876c2192b338c864325315b7d4de7755eb",
                "md5": "d6102c5ca99819ecbc2ef5df0d85f1bd",
                "sha256": "f6e7cf5cd8c32683cb9ff08985d560b41281f4b64bc2d382878cea6e189a1770"
            },
            "downloads": -1,
            "filename": "mineapy-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d6102c5ca99819ecbc2ef5df0d85f1bd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,<4,>=3.7",
            "size": 27786,
            "upload_time": "2024-08-21T09:31:53",
            "upload_time_iso_8601": "2024-08-21T09:31:53.277842Z",
            "url": "https://files.pythonhosted.org/packages/87/07/60ed3419c48c2ff2035c166b6b876c2192b338c864325315b7d4de7755eb/mineapy-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7f2459bce5d2306d40be038da69f6d7dd5f5ec94b3a8922b2885efa34875703b",
                "md5": "2a3cf510b96bab8f848a705bdb76f419",
                "sha256": "c7458c946e8d2b5ea49c503da59fc294824a15df3de214a1b4e36c56f84a6be1"
            },
            "downloads": -1,
            "filename": "mineapy-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "2a3cf510b96bab8f848a705bdb76f419",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,<4,>=3.7",
            "size": 26547,
            "upload_time": "2024-08-21T09:31:54",
            "upload_time_iso_8601": "2024-08-21T09:31:54.638363Z",
            "url": "https://files.pythonhosted.org/packages/7f/24/59bce5d2306d40be038da69f6d7dd5f5ec94b3a8922b2885efa34875703b/mineapy-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-21 09:31:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "vpandey-om",
    "github_project": "mineapy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mineapy"
}
        
Elapsed time: 0.32060s