Metadata-Version: 2.4
Name: strainOptimizer
Version: 0.1.0
Summary: Computational strain design using enzyme-constrained GEMs and ETFL models
Author-email: Haoyu Wang <wanghy@dicp.ac.cn>
Maintainer-email: Haoyu Wang <wanghy@dicp.ac.cn>
License: MIT
Project-URL: Homepage, https://github.com/hongzhonglu/strainOptimizer
Project-URL: Repository, https://github.com/hongzhonglu/strainOptimizer
Project-URL: Bug Tracker, https://github.com/hongzhonglu/strainOptimizer/issues
Project-URL: Documentation, https://github.com/hongzhonglu/strainOptimizer/blob/main/README.md
Project-URL: Zenodo Archive, https://doi.org/10.5281/zenodo.20770724
Keywords: metabolic engineering,strain design,genome-scale model,enzyme-constrained model,ecGEM,ETFL,systems biology,flux balance analysis,synthetic biology
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Operating System :: OS Independent
Requires-Python: <3.11,>=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cobra==0.24.0
Requires-Dist: python-libsbml>=5.19.0
Requires-Dist: optlang==1.5.2
Requires-Dist: pytfa>=0.9.1
Requires-Dist: sympy==1.6.2
Requires-Dist: numpy<2.0,>=1.23
Requires-Dist: scipy>=1.13
Requires-Dist: pandas<2.0,>=1.3.5
Requires-Dist: matplotlib>=3.9
Requires-Dist: networkx>=3.2
Requires-Dist: biopython>=1.85
Requires-Dist: openpyxl>=3.1
Requires-Dist: xlrd>=2.0
Requires-Dist: pydantic<2.0,>=1.10
Requires-Dist: tqdm>=4.60
Requires-Dist: rich>=13.0
Requires-Dist: six>=1.16
Requires-Dist: python-dateutil>=2.9
Provides-Extra: gurobi
Requires-Dist: gurobipy>=10.0; extra == "gurobi"
Provides-Extra: cplex
Requires-Dist: cplex>=22.1; extra == "cplex"
Provides-Extra: omics
Requires-Dist: troppo>=0.1; extra == "omics"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Requires-Dist: ruff>=0.4; extra == "dev"
Provides-Extra: all
Requires-Dist: strainOptimizer[dev,omics]; extra == "all"
Dynamic: license-file

# strainOptimizer

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.20770724.svg)](https://doi.org/10.5281/zenodo.20770724)

Repo for strain design based on ETFL/ecGEM models.


## Overview
strainOptimizer is a Python package for strain design using enzyme-constrained genome-scale metabolic models (ecGEMs) and ETFL models. It implements advanced strain design algorithms such as ecFactory and ecFSEOF, which leverage the additional constraints provided by enzyme capacity to identify more realistic genetic modifications for enhanced production of target metabolites.

## Installation
1. Clone the repo

```
git clone https://github.com/hongzhonglu/strainOptimizer.git
```

2. Set up the environment

```
conda create -n strainOpitimizer python=3.10
conda activate strainOpitimizer
conda env update --file environment.yml
pip install -e .
```

3. Solvers

We recommend using commercial solvers such as CPLEX or Gurobi. Please install one of them and set up the corresponding Python API.
- GUROBI (version 10.0)

We recommend obtaining a valid Gurobi license. Otherwise, adjust the code to use a different optimizer. To retrieve your license::
```
grbgetkey <YOUR-LICENSE-KEY>
```
For details, see the Gurobi licensing guide: https://www.gurobi.com/documentation/

- CPLEX
After installing CPLEX into the system, set the CPLEX Python API in your environment :
```
python [cplex_path]/python/setup.py install
```
## Usage guide
1. [ecFactory design example](examples/1.ecFactory_design_example.ipynb)
2. [ecFSEOF design example](examples/2.ecFSEOF_design_example.ipynb)

More examples can be found in the [examples](examples) folder.
## Example script
Here is an example script for 2-PE strain design:
```python
from strainOptimizer import strainOptimizer_engine,WorkflowParameters

# Model parameters - model path, type, solver, growth reaction
model_params = {
    'model_path': 'example/models\yeast\ecYeastGEM_batch.xml',
    'model_type': 'ecGEM',
    'solver': 'optlang-gurobi',
    'growth_id': 'r_2111',
}
# Strain parameters - target product and growth conditions
strain_params = {
    'target_id': 'r_1589',
    'product_name': '2-phenylethanol',
    'c_source': 'r_1714_REV',  # glucose exchange reaction
    'c_uptake': 5,  # glucose uptake rate (mmol/gDW/h)
}

# Algorithm control parameters - workflow and output settings
algorithm_params = {
    'design_algorithm': 'ecFactory',
    'simulation_method': 'ppfba',
    'experimental_yield': None, # if without experimental yield data, use the 1/2 
    'remove_essential': True,
    'output_directory': './results',
    'steps':123,
    'action_thresholds':[0.05,0.3,1.1]
    # 'save_results': False,
    # 'only_final_result': True,
    # Note: ecFactory-specific parameters like steps, action_thresholds, etc.
    # would need to be added to AlgorithmControl if they're used
}

# Create WorkflowParameters using the three-level structure
params = WorkflowParameters(
    model=model_params,
    strain=strain_params,
    algorithm=algorithm_params
)

# Create workflow engine using the new framework
engine = strainOptimizer_engine(params)
# Load model
engine.load_model()
# Run the design workflow
final_result=engine.run_design()
# More detailed results can be accessed via engine.all_results. 
# And results at each level have been saved in output_directory.
```
## Contribution

* For contributors: Fork it to your Github account, and create a new branch from [`dev`](https://github.com/hongzhonglu/strainOptimizer/tree/dev).


