Skip to main content

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.

Metadata

Release files for mineapy 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mineapy 0.0.4
File Size Uploaded Provenance Actions
mineapy-0.0.4.tar.gz 26.5 kB Without provenance Details for mineapy-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mineapy 0.0.4
File Interpreter ABI Platform Actions
mineapy-0.0.4-py3-none-any.whl Python 3 none any Details for mineapy-0.0.4-py3-none-any.whl

Total release size: 54.3 kB

Release files / mineapy-0.0.4.tar.gz

Download URL mineapy-0.0.4.tar.gz
Size 26.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c7458c946e8d2b5ea49c503da59fc294824a15df3de214a1b4e36c56f84a6be1
BLAKE2b-256 checksum
How to use checksums
7f2459bce5d2306d40be038da69f6d7dd5f5ec94b3a8922b2885efa34875703b
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / mineapy-0.0.4-py3-none-any.whl

Download URL mineapy-0.0.4-py3-none-any.whl
Size 27.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6e7cf5cd8c32683cb9ff08985d560b41281f4b64bc2d382878cea6e189a1770
BLAKE2b-256 checksum
How to use checksums
870760ed3419c48c2ff2035c166b6b876c2192b338c864325315b7d4de7755eb
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for mineapy 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page