Skip to main content

mineapy, Minimum network enrichment analysis in Python

Project description

MiNEApy

PyPI license

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

Requirements

You will need to have Git-LFS installed to properly download some binary files:

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:

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 and create an environment using Python 3.7:

conda create -n py37 python=3.7
conda activate py37

Using pip

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

pip install -r requirements.txt

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

pip install mineapy==0.0.4

Installing from Source

If you prefer to install from the source:

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:

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 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 for more information.

License

The software in this repository is licensed under the Apache-2.0 License. Please see the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mineapy-0.0.4.tar.gz (26.5 kB view details)

Uploaded Source

Built Distribution

mineapy-0.0.4-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file mineapy-0.0.4.tar.gz.

File metadata

  • Download URL: mineapy-0.0.4.tar.gz
  • Upload date:
  • Size: 26.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.31.0 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.66.1 CPython/3.8.16

File hashes

Hashes for mineapy-0.0.4.tar.gz
Algorithm Hash digest
SHA256 c7458c946e8d2b5ea49c503da59fc294824a15df3de214a1b4e36c56f84a6be1
MD5 2a3cf510b96bab8f848a705bdb76f419
BLAKE2b-256 7f2459bce5d2306d40be038da69f6d7dd5f5ec94b3a8922b2885efa34875703b

See more details on using hashes here.

File details

Details for the file mineapy-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: mineapy-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.31.0 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.66.1 CPython/3.8.16

File hashes

Hashes for mineapy-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f6e7cf5cd8c32683cb9ff08985d560b41281f4b64bc2d382878cea6e189a1770
MD5 d6102c5ca99819ecbc2ef5df0d85f1bd
BLAKE2b-256 870760ed3419c48c2ff2035c166b6b876c2192b338c864325315b7d4de7755eb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page