#!/usr/bin/env python # coding: utf-8 # In[1]: from cameo import load_model # In[2]: model = load_model("iJR904") # In[3]: model # In[4]: from cameo.flux_analysis import simulation # In[5]: help(simulation) # Step 1: Simulate the flux distribution of the Wild-Type # ---------------------------------------------------- # # FBA and PFBA can be used to compute flux distributions for the Wild-Type (model as it as been described) as well as knockouts (next session) # In[6]: get_ipython().run_line_magic('time', '') fba_result = simulation.fba(model) # In[7]: get_ipython().run_line_magic('time', '') pfba_result = simulation.pfba(model) # Setp 2: Simulate knockouts phenotypes # ----------------------------------- # # Although PFBA and FBA can be used to simulate the effect of knockouts, other methods have been proven more valuable for that task: MOMA and ROOM. In *cameo* we implement a linear version of MOMA. # # ******************************************* # Simulating knockouts: # # * Manipulate the bounds of the reaction (or use the shorthand method knock_out) # In[9]: model.reactions.PGI # In[10]: model.reactions.PGI.knock_out() model.reactions.PGI # * Simulate using different methods: # In[11]: get_ipython().run_line_magic('time', '') fba_knockout_result = simulation.fba(model) fba_knockout_result[model.objective] # In[12]: pfba_knockout_result = simulation.pfba(model) pfba_knockout_result[model.objective] # MOMA and ROOM relly on a reference (wild-type) flux distribution and we can use the one previously computed. # # **Parsimonious FBA references seem to produce better results using this methods** # In[26]: lmoma_result["2 * EX_glc_lp_e_rp_"] # In[14]: get_ipython().run_line_magic('time', '') lmoma_result = simulation.lmoma(model, reference=pfba_result.fluxes) lmoma_result[model.objective] # In[19]: get_ipython().run_line_magic('time', '') room_result = simulation.room(model, reference=pfba_result.fluxes) room_result[model.objective] # In[27]: room_result # In[ ]: