Metadata-Version: 2.4
Name: gMCSpy
Version: 1.1.5
Summary: gMCSpy is a python package for the calculation of Genetic Minimal Cut sets (GMCS). In simple terms, the idea is to take a metabolic model and calculate the genetic vulnerabilities that will render the biomass production impossible. This is done through a Mixed-Integer Linear problem (MILP) formulation and the use of a linear solver.
Home-page: https://github.com/PlanesLab/gMCSpy
Download-URL: https://github.com/PlanesLab/gMCSpy/archive/refs/tags/v1.1.5.tar.gz
Author: Carlos Javier Rodriguez
Author-email: cjrodriguezf@unav.es
License: MIT
Keywords: gMCS,Genetic Minimal Cut Sets,Gurobi,CPLEX
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cobra
Requires-Dist: beartype
Requires-Dist: scipy
Requires-Dist: tqdm
Requires-Dist: joblib
Requires-Dist: gurobipy
Requires-Dist: cplex
Requires-Dist: bidict
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: download-url
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# gMCSpy    
# ![Python versions](https://img.shields.io/pypi/pyversions/gMCSpy?logo=python) ![Downloads](https://img.shields.io/pypi/dm/gMCSpy) ![Tests](https://github.com/PlanesLab/gMCSpy/actions/workflows/tests.yml/badge.svg)


gMCSpy is a python package for the calculation of Genetic Minimal Cut sets (GMCS). In simple terms the idea is to take a metabolic model and calculate the genetic vulnerabilities that will render the biomass production impossible. This is done through a Mixed-Integer Linear problem (MILP) formultion and the use of a linear solver.  
The models must come from the [cobrapy](https://opencobra.github.io/cobrapy/) package and a linear solver must be installed. The package has been design to be used with [Gurobi](https://www.gurobi.com/),  [CPLEX](https://www.ibm.com/analytics/cplex-optimizer) and [SCIP](https://scipopt.org/#scipoptsuite).


## Documentation

[Documentation](https://planeslab.github.io/gMCSpy/)

## Installation

Install gmcspy from pip

```bash
  pip install gmcspy
```
  
## Quick Start

### Calculating Genetic Minimal Interventions

[Genetic Minimal Intervention Sets](https://planeslab.github.io/gMCSpy/gMIS.html)

### E. coli core

```python
#Read the model 
from pathlib import Path
from cobra.io import load_model
model = load_model("textbook")
```

To calculate all the GMCS of length 3 or less; using gurobi as solver

```python
#Calculate the genetic minimal cut sets
from gMCSpy import calculateGeneMCS

calculateGeneMCS(
        cobraModel=model,
        maxKOLength=3,
        solver='gurobi'
)

### Using CPLEX

calculateGeneMCS(
        cobraModel=model,
        maxKOLength=3,
        solver='cplex'
)
```

### Human-GEM (*Requires License Activation: CPLEX and Gurobi)
Using HUMAN GEM (v16) from [here](https://github.com/SysBioChalmers/Human-GEM/releases). 
```bash
mkdir data
curl -o data/Human-GEM16.mat --location --remote-header-name https://github.com/SysBioChalmers/Human-GEM/raw/v1.16.0/model/Human-GEM.mat

```

```python
#Read the model 
from pathlib import Path
from cobra.io import load_matlab_model

mini_mat_path = Path(".") / "./data/Human-GEM16.mat"
model = load_matlab_model(str(mini_mat_path.resolve()))
```

To calculate all the GMCS of length 3 or less; using gurobi as solver

```python
#Calculate the genetic minimal cut sets
from gMCSpy import calculateGeneMCS

calculateGeneMCS(
        cobraModel=model,
        maxKOLength=3,
        solver='gurobi'
)
```
**Table with the results:**

| Order      | Solution                                                             |
|------------|----------------------------------------------------------------------|
| order1_0   | frozenset({'ENSG00000106105'})                                       |
| order1_1   | frozenset({'ENSG00000084774'})                                       |
| ...        | ...                                                                  |
| order3_159 | frozenset({'ENSG00000156471', 'ENSG00000185813', 'ENSG00000213930'}) |

## Authors

- Carlos J. Rodriguez
- Naroa Barrena 
- Danel Olaverri-Mendizabal
- Idoia Ochoa
- Luis V. Valcárcel
- Francisco J. Planes
