klamt-lab / straindesign

StrainDesign is a python package for the computational design of metabolic networks and based on COBRApy
Apache License 2.0
36 stars 6 forks source link

Improve support for non-DNF GPR rules #3

Open VonAlphaBisZulu opened 2 years ago

VonAlphaBisZulu commented 2 years ago

Some models, e.g., iCHOv1 from Bigg, do not have GPR rules in DNF form. Improve the handling of such models.

import logging
logging.basicConfig(level=logging.INFO)
import straindesign as sd
import cobra
model = cobra.io.load_model('iCHOv1')
module_suppress = sd.SDModule(model,sd.names.SUPPRESS,constraints='BIOMASS_cho >= 0.001')
# Compute strain designs
sols = sd.compute_strain_designs(model,
                                 sd_modules = module_suppress,
                                 time_limit = 300,
                                 max_solutions = 1,
                                 max_cost = 1,
                                 solution_approach = sd.names.ANY,
                                 gene_kos = True,
                                 solver='cplex')