Skip to main content

MEWpy - Metabolic Engineering in Python

Project description

License: GPL v3 PyPI version Documentation Status Build Status

MEWpy

MEWpy is an integrated Metabolic Engineering Workbench for strain design optimization. It offers methods to explore different classes of constraint-based models (CBM) for:

  • Metabolic Modeling: Simulate steady-state metabolic models with different formulations (GECKO, ETFL) and kinetic models
  • Strain Design Optimization: Evolutionary computation-based optimization by knocking out (KO) or over/under expressing (OU) reactions, genes, or enzymes
  • Omics Integration: Integration of transcriptomics and expression data (eFlux, GIMME, iMAT)
  • Regulatory Networks: Integrated metabolic-regulatory modeling (PROM, SRFBA, RFBA, CoRegFlux)
  • Community Modeling: Microbial community simulation and optimization (SteadyCOM, SMETANA)

MEWpy supports REFRAMED and COBRApy simulation environments. The optimization engine relies on either inspyred or jMetalPy packages.

Key Features

Metabolic and Integrated Modeling

  • Unified Simulator API: Seamless integration with COBRApy and REFRAMED models
  • GERM Framework: Generic representation supporting metabolic, regulatory, and integrated models
  • Analysis Methods: FBA, pFBA, FVA, MOMA, lMOMA, ROOM, gene/reaction deletions
  • Regulatory Integration: PROM, SRFBA, RFBA, CoRegFlux for integrated metabolic-regulatory analysis
  • Expression Data Integration: eFlux, GIMME, iMAT with built-in tools for processing omics data
  • Enzyme-Constrained Models: Support for GECKO and ETFL formulations

Strain Design Optimization

  • Multi-Objective Optimization: Evolutionary algorithms for strain design using inspyred or jMetalPy
  • Flexible Design Strategies: Reaction/gene/enzyme knockouts (KO) and over/under expression (OU)
  • Custom Objectives: BPCY, product yield, biomass-product coupled yield, and custom fitness functions
  • Problem Types: Support for metabolic, kinetic, GECKO, ETFL, and community optimization problems

Community Modeling

  • SteadyCOM: Simulate microbial communities at steady-state
  • SMETANA: Species METabolic interaction ANAlysis for studying metabolic interactions
  • Community Optimization: Strain design for microbial consortia
  • Cross-feeding Analysis: Identify and optimize metabolic dependencies

Kinetic Modeling

  • ODE-based Simulation: Support for kinetic metabolic models
  • Parameter Optimization: Fit kinetic parameters to experimental data
  • Dynamic Strain Design: Knockout optimization for kinetic models
  • Hybrid Approaches: Integration of kinetic and constraint-based models

Solver Support

  • Commercial Solvers: CPLEX (recommended for large problems), Gurobi
  • Open-Source Solvers: SCIP (pip install pyscipopt), GLPK
  • Automatic Fallback: Seamlessly switches between available solvers

Quick Start

from mewpy.io import read_sbml
from mewpy.simulation import get_simulator, SimulationMethod

# Load a model
model = read_sbml('path/to/model.xml')

# Create simulator
simulator = get_simulator(model)

# Run FBA
result = simulator.simulate(method=SimulationMethod.FBA)
print(f"Objective value: {result.objective_value}")

# Perform FVA
from mewpy.germ.analysis import fva
fva_result = fva(model)

For integrated metabolic-regulatory models:

from mewpy.io import read_model, Reader, Engines
from mewpy.germ.analysis import SRFBA, PROM

# Load integrated model
gem_reader = Reader(Engines.MetabolicSBML, 'metabolic_model.xml')
trn_reader = Reader(Engines.BooleanRegulatoryCSV, 'regulatory_network.csv',
                    sep=',', id_col=0, rule_col=2, header=0)
model = read_model(gem_reader, trn_reader)

# Run SRFBA
srfba = SRFBA(model).build()
solution = srfba.optimize()

For strain design optimization:

from mewpy.optimization import EA
from mewpy.problems import GKOProblem
from mewpy.simulation import get_simulator

# Load model
model = read_sbml('path/to/model.xml')
simulator = get_simulator(model)

# Define optimization problem
problem = GKOProblem(
    model=model,
    fevaluation=['BPCY'],  # Biomass-Product Coupled Yield
    product='EX_succ_e',    # Target product (e.g., succinate)
    max_candidate_size=10   # Maximum number of gene knockouts
)

# Run evolutionary algorithm
ea = EA(problem, max_generations=50, mp=True)
final_pop = ea.run()

# Display results
ea.dataframe()

Examples

Examples are provided as jupyter notebooks and as python scripts.

Documentation

The package documentation is available at mewpy.readthedocs.io.

Installation

From PyPI

pip install mewpy

From GitHub

git clone https://github.com/vmspereira/MEWpy.git
cd MEWpy
pip install -e .

Development Installation

pip install -e ".[dev]"     # Install with development dependencies
pip install -e ".[test]"    # Install with testing dependencies
pip install -e ".[solvers]" # Install with SCIP solver support

Solver Requirements

MEWpy requires at least one compatible linear programming solver. Supported solvers:

  • CPLEX (commercial, recommended for large problems)
  • Gurobi (commercial)
  • SCIP (open-source, install via pip install pyscipopt)
  • GLPK (open-source)

For open-source solver installation:

pip install pyscipopt  # Installs SCIP solver

Cite

If you use MEWpy in your research, please cite:

Vítor Pereira, Fernando Cruz, Miguel Rocha, MEWpy: a computational strain optimization workbench in Python, Bioinformatics, 2021; https://doi.org/10.1093/bioinformatics/btab013

Credits and License

Developed by Vítor Pereira and Centre of Biological Engineering, University of Minho. MEWpy received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement number 814408 (2019-2023).

MEWpy is currently maintained by Vítor Pereira.

Released under the GNU General Public License v3.0.

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

mewpy-1.0.0.tar.gz (23.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mewpy-1.0.0-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file mewpy-1.0.0.tar.gz.

File metadata

  • Download URL: mewpy-1.0.0.tar.gz
  • Upload date:
  • Size: 23.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for mewpy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 04babb3fb3d7a27fe03155edc59fde18dc4b7fcd7dedd43fa2a1dccc9a05b437
MD5 7812bbc87375a0329d14d42fc9f999d5
BLAKE2b-256 3623dec118fb33228717cfa44d723f9f80eedea4923e77129fe7baae7fa5b19b

See more details on using hashes here.

File details

Details for the file mewpy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mewpy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for mewpy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14852feaacb58165cef592331fca39b66844a26f664a04a929ab7fd62bad5e17
MD5 ff45ff973b65cb56aaa11d852a09481c
BLAKE2b-256 be63707013467a147af9fdef7a2c355373d48072b4ae166ad2ed8d4a90f3b1d9

See more details on using hashes here.

Supported by

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