Commit 05919eb5 authored by Vítor Pereira's avatar Vítor Pereira
Browse files

[UPDATE] omics

parent 7f49dbd5
......@@ -33,7 +33,7 @@ jupyter notebook
### Credits and License
Vítor Pereira, CEB-UMINHO, 2021
Vítor Pereira and Lucas Carvalho, CEB-UMINHO, 2022
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a>
......
bNum,Gene,Rule
b0008,b0008,TRUE
b0080,FruR,NOT surplusFDP
b0113,PdhR,NOT surplusPYR
b0114,aceE, NOT PdhR OR Fis
b0115,aceF, NOT PdhR OR Fis
b0116,b0116,TRUE
b0118,b0118,TRUE
b0351,b0351,TRUE
b0356,b0356,TRUE
b0399,PhoB,PhoR
b0400,PhoR,(NOT (pi_e > 0))
b0451,b0451,TRUE
b0474,b0474,TRUE
b0485,b0485,TRUE
b0720,b0720,TRUE
b0721,sdhC, (NOT (ArcA OR Fnr)) OR Crp OR Fis
b0722,sdhD, (NOT (ArcA OR Fnr)) OR Crp OR Fis
b0723,sdhA, (NOT (ArcA OR Fnr)) OR Crp OR Fis
b0724,sdhB, (NOT (ArcA OR Fnr)) OR Crp OR Fis
b0726,b0726,TRUE
b0727,b0727,TRUE
b0728,b0728,TRUE
b0729,b0729,TRUE
b0733,cydA, (NOT Fnr) OR ArcA
b0734,cydB, (NOT Fnr) OR ArcA
b0755,b0755,TRUE
b0767,b0767,TRUE
b0809,b0809,TRUE
b0810,b0810,TRUE
b0811,b0811,TRUE
b0875,b0875,TRUE
b0902,pflA, ArcA OR (Fnr AND Crp)
b0903,pflB, ArcA OR (Fnr AND Crp)
b0904,focA, ArcA OR (Fnr AND Crp)
b0978,b0978,TRUE
b0979,b0979,TRUE
b1101,ptsG, (NOT Mlc) OR (NOT FruR)
b1136,b1137,TRUE
b1187,FadR,(glc__D_e > 0) OR (NOT ((ac_e > 0)))
b1241,adhE, (NOT (o2_e > 0)) OR (NOT ((o2_e > 0) AND FruR)) OR Fis
b1276,b1276,TRUE
b1297,b1297,TRUE
b1334,Fnr,NOT (o2_e > 0)
b1380,b1380,TRUE
b1478,b1478,TRUE
b1479,b1479,TRUE
b1524,yneH, (NOT (glc__D_e > 0)) OR ((nh4_e > 0) AND (NOT Crp))
b1594,Mlc,(NOT (glc__D_e > 0))
b1602,b1602,TRUE
b1603,b1603,TRUE
b1611,fumC, NOT ArcA
b1612,fumA, NOT (ArcA OR Fnr)
b1621,b1622,TRUE
b1676,pykF, NOT FruR
b1702,pps, FruR
b1723,b1724,TRUE
b1761,gdhA,NOT (Nac OR (glu__L_e > 0))
b1773,b1773,TRUE
b1779,b1779,TRUE
b1812,b1812,TRUE
b1817,manX,CRPnoGLM OR (NOT Mlc)
b1818,manY,CRPnoGLM OR (NOT Mlc)
b1819,manZ,CRPnoGLM OR (NOT Mlc)
b1849,b1849,TRUE
b1852,b1852,TRUE
b1854,b1854,TRUE
b1988,Nac,NRI_low
b2029,b2029,TRUE
b2097,b2097,TRUE
b2133,b2133,TRUE
b2276,nuoN, (NOT (ArcA OR Fnr))
b2277,nuoM, (NOT (ArcA OR Fnr))
b2278,nuoL, (NOT (ArcA OR Fnr))
b2279,nuoK, (NOT (ArcA OR Fnr))
b2280,nuoJ, (NOT (ArcA OR Fnr))
b2281,nuoI, (NOT (ArcA OR Fnr))
b2282,nuoH, (NOT (ArcA OR Fnr))
b2283,nuoG, (NOT (ArcA OR Fnr))
b2284,nuoF, (NOT (ArcA OR Fnr))
b2285,nuoE, (NOT (ArcA OR Fnr))
b2286,nuoC, (NOT (ArcA OR Fnr))
b2287,nuoB, (NOT (ArcA OR Fnr))
b2288,nuoA, (NOT (ArcA OR Fnr))
b2296,b2296,TRUE
b2297,b2297,TRUE
b2415,b2415,TRUE
b2416,b2416,TRUE
b2417,b2417,TRUE
b2458,b2458,TRUE
b2463,b2463,TRUE
b2464,b2464,TRUE
b2465,b2465,TRUE
b2492,focB, ArcA OR (Fnr AND Crp)
b2579,b2579,TRUE
b2587,b2587,TRUE
b2779,b2779,TRUE
b2914,b2914,TRUE
b2925,b2925,TRUE
b2926,b2926,TRUE
b2935,b2935,TRUE
b2975,glcA, (NOT ArcA) AND GlcC
b2976,glcB, (NOT ArcA) AND GlcC
b2980,GlcC,(ac_e > 0)
b2987,pitB, NOT PhoB
b3114,tdcE, Crp OR Fnr
b3115,tdcD, Crp OR Fnr
b3212,gltB, (NOT (NRI_hi AND (glu__L_e > 0)))
b3213,gltD, (NOT (NRI_hi AND (glu__L_e > 0)))
b3236,mdh, NOT ArcA
b3261,Fis,(Biomass_Ecoli_core > 0)
b3357,Crp,CRPnoGLC
b3386,b3386,TRUE
b3403,b3403,TRUE
b3493,b3493,TRUE
b3528,dctA,CRPnoGLM AND (NOT ArcA) AND DcuR
b3603,lldP, NOT ArcA
b3612,b3612,TRUE
b3731,b3731,TRUE
b3732,b3732,TRUE
b3733,b3733,TRUE
b3734,b3734,TRUE
b3735,b3735,TRUE
b3736,b3736,TRUE
b3737,b3737,TRUE
b3738,b3738,TRUE
b3739,b3739,TRUE
b3868,GlnG,NOT (nh4_e > 0)
b3870,glnA,Crp
b3916,b3916,TRUE
b3919,b3919,TRUE
b3925,b3925,TRUE
b3951,pflD, ArcA OR Fnr
b3952,pflC, ArcA OR Fnr
b3956,b3956,TRUE
b3962,b3962,TRUE
b4014,aceB, (NOT IclR) AND ((NOT ArcA) OR FruR)
b4015,aceA, (NOT IclR) AND ((NOT ArcA) OR FruR)
b4018,IclR,FadR
b4025,b4025,TRUE
b4077,b4077,TRUE
b4090,b4090,TRUE
b4122,fumB, Fnr OR Crp OR DcuR
b4124,DcuR,DcuS
b4125,DcuS,(succ_e > 0) OR (fum_e > 0) OR (mal__L_e > 0)
b4151,frdD, Fnr OR DcuR
b4152,frdC, Fnr OR DcuR
b4153,frdB, Fnr OR DcuR
b4154,frdA, Fnr OR DcuR
b4232,b4232,TRUE
b4301,b4301,TRUE
b4395,b4395,TRUE
b4401,ArcA,NOT (o2_e > 0)
s0001,s0001,TRUE
CRPnoGLC,CRPnoGLC,(NOT (glc__D_e > 0))
CRPnoGLM,CRPnoGLM,NOT ((glc__D_e > 0) OR (mal__L_e > 0) OR (lac__D_e > 0))
NRI_hi,NRI_hi,NRI_low
NRI_low,NRI_low,GlnG
surplusFDP,surplusFDP,((NOT (FBP > 0)) AND (NOT ((TKT2 > 0) OR (TALA > 0) OR (PGI > 0)))) OR (fru_e > 0)
surplusPYR,surplusPYR,(NOT ((ME2 > 0) OR (ME1 > 0))) AND (NOT ((GLCpts > 0) OR (PYK > 0) OR (PFK > 0) OR (LDH_D > 0) OR (SUCCt2_2 > 0)))
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
%% Cell type:markdown id: tags:
# Exercice 3
In this exercice we will try to increase the production of succinate in Yeast.
%% Cell type:markdown id: tags:
## GECKO models
We will begin by doing the necessary imports and load a GECKO yeast model.
%% Cell type:code id: tags:
``` python
from mewpy.model import GeckoModel
from geckopy.gecko import GeckoModel
from mewpy.simulation import get_simulator
from mewpy.problems import GeckoOUProblem
from mewpy.optimization import EA
from mewpy.optimization.evaluation import BPCY,WYIELD, ModificationType
```
%% Cell type:code id: tags:
``` python
model = GeckoModel('single-pool')
```
%% Cell type:markdown id: tags:
Next we define the required identifier, the medium, and create a simulation instance:
Next we define the required identifiers, the medium, and create a simulation instance:
%% Cell type:code id: tags:
``` python
BIOMASS = 'r_2111'
GLC = 'r_1714_REV'
O2 = 'r_1992'
SUCC = 'r_2056'
envcond = {GLC:(-10,10000),O2:(0,0)}
simul = get_simulator(model,envcond= envcond)
simul = get_simulator(model,envcond=envcond)
```
%% Cell type:markdown id: tags:
We can now idendify the essential proteins
%% Cell type:code id: tags:
``` python
simul.essential_proteins()
```
%% Cell type:markdown id: tags:
Similarly to the strain optimization task using metabolic model, with or without enzymatic constraint (sMOMENT), we can use GECKO model to find genetic modifications that favor the production of succinate.
Similarly to strain optimization task using metabolic model, with or without enzymatic constraint (sMOMENT), we can use GECKO model to find genetic modifications that favor the production of succinate. However, instead of applying genetic modifications (deletions / up / down-regulations) by evaluating GPR rules, the modifications are imposed on the enzyme usage pseudo-reactions.
%% Cell type:code id: tags:
``` python
from mewpy.problems import GeckoKOProblem, GeckoOUProblem
```
%% Cell type:markdown id: tags:
## Exercice
Build and run a GECKO optimization problem for succinate.
%% Cell type:code id: tags:
``` python
```
%% Cell type:code id: tags:
``` python
```
%% Cell type:markdown id: tags:
## OptRAM optimization problem
OptRAM requires besides a metabolic model, the regulatory network and the identification of genes and transcription factores. The algorithm treat each differently.
OptRAM requires besides a metabolic model, the regulatory network and the identification of genes and transcription factores. The algorithm treats each differently.
%% Cell type:code id: tags:
``` python
gene_file = 'data/mgene.csv'
ft_file = 'data/TFnames.csv'
tf_file = 'data/TFnames.csv'
matrix_file = 'data/regnet.csv'
model_file = 'data/yeast_7.6-optram.xml'
```
%% Cell type:markdown id: tags:
We may now load the files
%% Cell type:code id: tags:
``` python
from mewpy.regulation.optram import load_optram
# adds the prefix 'G_' to genes. Only for REFRAMED models
regnet = load_optram(gene_file, ft_file, matrix_file, gene_prefix='G_')
# the general objective is to maximize the target
from reframed.io.sbml import load_cbmodel
model = load_cbmodel(model_file)
from mewpy.problems import load_optram, OptRamProblem
from cobra.io.sbml import read_sbml_model
regnet = load_optram(gene_file, tf_file, matrix_file)
model = read_sbml_model(model_file)
model.objective= BIOMASS
```
%% Cell type:markdown id: tags:
OptRAM problems definition
%% Cell type:code id: tags:
``` python
from mewpy.regulation.optram import OptRamProblem
obj =[ BPCY(BIOMASS, SUCC, method='lMOMA'),
WYIELD(BIOMASS, SUCC)]
# OptRAM problem
problem = OptRamProblem(model, obj, regnet, envcond=envcond, candidate_max_size=10)
```
%% Cell type:markdown id: tags:
## Exercice
Run an optimization for the optRAM problem.
%% Cell type:code id: tags:
``` python
```
%% Cell type:code id: tags:
``` python
```
......
%% Cell type:markdown id: tags:
# Exercice 4
## OptORF
This exercice illustrates how to use OptORF to optimize succinate production
%% Cell type:code id: tags:
``` python
import os
from mewpy.analysis import (FBA, pFBA, fva, single_reaction_deletion, single_gene_deletion, SRFBA, RFBA, ifva,
isingle_reaction_deletion, isingle_gene_deletion, isingle_regulator_deletion)
from mewpy.io import read_model, Engines, Reader
from mewpy.optimization import EA
from mewpy.optimization.evaluation import BPCY, WYIELD
from mewpy.regulation import OptORFProblem
from mewpy.simulation import get_simulator
from mewpy.util.io import population_to_csv
```
%% Cell type:markdown id: tags:
Create the regulatory-metabolic model by firstly loading the metabolic model and then the regulatory network.
%% Cell type:code id: tags:
``` python
# E. coli core constraint-based model directory
cbm_model_f = 'data/e_coli_core.xml'
# E. coli core Transcriptional Regulatory Network directory
reg_model_f = 'data/e_coli_core_trn.csv'
# reader for the metabolic model
metabolic_reader = Reader(Engines.MetabolicSBML, cbm_model_f)
# reader for the regulatory model
regulatory_reader = Reader(Engines.RegulatoryCSV,
reg_model_f,
sep=',',
id_col=1,
rule_col=2,
aliases_cols=[0],
header=0)
# reading the integrated metabolic-regulatory model
model = read_model(metabolic_reader, regulatory_reader)
```
%% Cell type:markdown id: tags:
Identify the necessary reactions
%% Cell type:code id: tags:
``` python
# Biomass reaction identifier. The model objective function is set to be the biomass reaction, as regular practice.
_BIOMASS_ID = 'Biomass_Ecoli_core'
model.objective = {_BIOMASS_ID: 1}
# glucose-exchange reaction identifier. Glucose is the main carbon source for E. coli.
# Thus, the glucose exchange reaction bounds are set to -10 and 100000.0
_GLC = 'EX_glc__D_e'
model.get(_GLC).bounds = (-10.0, 100000.0)
# setting each metabolic gene state/coefficient to 1 (active state)
for gene in model.yield_genes():
gene.coefficient.coefficients = (1,)
# Succinate is a compound of interest that can be synthesized by E. coli.
# In this case, it will be the target product for the optimization
_SUC = 'EX_succ_e'
```
%% Cell type:markdown id: tags:
Create the optimization problem and run the optimization.
%% Cell type:code id: tags:
``` python
# The evaluators Biomass-Product Coupled Yield and Weighted Yield will be used as evaluation metrics
# of each set of candidates
evaluator_1 = BPCY(_BIOMASS_ID, _SUC)
evaluator_2 = WYIELD(_BIOMASS_ID, _SUC)
# A OptORFProblem problem is created.
# The OptORF approach is based on gene and regulator deletion to identify optimization strategies.
# This problem uses a RFBA-like flux analysis to simulate a model constraints derived
# from the gene and regulator deletions
problem = OptORFProblem(model, [evaluator_1, evaluator_2], candidate_max_size=6)
# setting up the Evolutionary Algorithm runner with multiprocessing and maximum of 10 generations
ea = EA(problem, max_generations=10, mp=True)
final_pop = ea.run()
```
%% Cell type:code id: tags:
``` python
```
2021-07-07 16:48:36,497 - ME modelSlackModel iJO1366_ETFL_v_0.12_431_enz_128_bins__20200605_072641.json - INFO - # ETFL Model SlackModel iJO1366_ETFL_v_0.12_431_enz_128_bins__20200605_072641.json initialized
2021-07-07 16:48:36,498 - ME modelSlackModel iJO1366_ETFL_v_0.12_431_enz_128_bins__20200605_072641.json - INFO - Empty model initialized
2021-07-07 16:53:30,100 - ME modelSlackModel iJO1366_ETFL_v_0.12_431_enz_128_bins__20200605_072641.json - INFO - # ETFL Model SlackModel iJO1366_ETFL_v_0.12_431_enz_128_bins__20200605_072641.json initialized
2021-07-07 16:53:30,101 - ME modelSlackModel iJO1366_ETFL_v_0.12_431_enz_128_bins__20200605_072641.json - INFO - Empty model initialized
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment