#!/usr/bin/env python # coding: utf-8 # ## Ethanol yield from glucose # # https://groups.google.com/forum/#!topic/cobra-pie/-sPHjNsB974 # # This is definitely doable. # # Steps are: # 1. Get a genome scale metabolic model for yeast such as iMM904. http://bigg.ucsd.edu/ has it. # 2. [hardest part - should take a beginner about 1 hour depending on molecule] Add reactions needed to make your molecule and a "demand reaction" for it to leave the cell. Decide if you want to account for transport costs or not. # 3. Optimize (maximize) flux just to this demand reaction. This flux is the molar yield assuming you provided 1 mmol glucose gDW-1 h-1 and have no other demands (turn off ATP maintenance reaction, etc.) # 4. Convert to a g/g yield basis as is typical using the molecular weights of glucose and your product. # 5. Verify overall stoichiometry is plausible (look at all the exchanges of what is going in and out of the cell in the max yield simulation) # # I'm happy to peer review your progress! Perhaps write back with the Ethanol max yield? That is easily doable as the molecule is native and you can skip #2. # https://cobrapy.readthedocs.io/en/latest/simulating.html# for the basics. # # Good luck! # Josh # # # ---- # # Hi Björn, # # In addition to what Josh said, take a look at the following materials: # # https://cobrapy.readthedocs.io/en/latest/phenotype_phase_plane.html # # Our general materials for the software carpentry course on cell design: # https://biosustain.github.io/cell-factory-design-course/ # # In particular: # https://biosustain.github.io/cell-factory-design-course/08-Predict-heterologous-pathways/ # # https://biosustain.github.io/cell-factory-design-course/07-Theoretical-maximum-yields/ # # Also take a look at the documentation for cameo, our strain design library # https://cameo.readthedocs.io/en/latest/ # # Happy to answer any specific question and congrats to your acquiring a very experienced peer reviewer ;) # In[1]: import cobra # In[2]: cobra.__version__ # In[3]: iMM904 = cobra.io.load_json_model("iMM904.json") # In[4]: model = iMM904.copy() # In[5]: print(model.objective) # I have to change the model objective from biomass to ethanol # In[6]: model.objective = model.reactions.EX_etoh_e # In[7]: print(model.objective) # This optimises the model using fba and parsimonius fba (trying to minimize overall fluxes?). # In[8]: fba_solution = model.optimize() pfba_solution = cobra.flux_analysis.pfba(model) # In[9]: model.summary() # In[10]: fba_solution.fluxes.EX_glc__D_e, fba_solution.fluxes.EX_etoh_e # In[11]: pfba_solution.fluxes.EX_glc__D_e, pfba_solution.fluxes.EX_etoh_e # The parsimonius fba solution seems similar to the normal fba. # https://cobrapy.readthedocs.io/en/latest/simulating.html # Dividing the ethanol flux by the glucose flux gives the molar yield, expected to be two moles of ethanol for each mole glucose. # In[12]: molar_yeld = round( (-1. * fba_solution.fluxes.EX_etoh_e) / fba_solution.fluxes.EX_glc__D_e ) molar_yeld # In[13]: mw_et, mw_glc = model.metabolites.etoh_e.formula_weight, model.metabolites.glc__D_c.formula_weight mw_et, mw_glc # In[14]: print(f"{molar_yeld * (mw_et/mw_glc)} g ethanol / g glucose") # The expected ethanol yield in g etoh per g glucose should be around 0.51 g/g # As can be seen below the fba and pfba solutions are similar but not identical. # In[15]: fba_solution.fluxes[fba_solution.fluxes.abs() >= 10.0] # In[16]: pfba_solution.fluxes[pfba_solution.fluxes.abs() >= 10.0] # In[17]: import escher # In[18]: reaction_data = pfba_solution.fluxes[pfba_solution.fluxes.abs() > 1E-07].to_dict() # In[19]: escher.Builder( map_name='iMM904.Central carbon metabolism', model_name='iMM904', reaction_data=reaction_data ).display_in_notebook() # In[20]: model.reactions.HEX1 # In[21]: model.reactions.GLUK # see here for how to overlay solution on metabolic map # # https://nbviewer.jupyter.org/github/zakandrewking/escher/blob/master/docs/notebooks/JavaScript%20development%20and%20offline%20maps.ipynb # In[22]: pfba_solution.fluxes.HEX1 # In[23]: pfba_solution.fluxes.GLUK # In[24]: fba_solution.fluxes.HEX1 # In[25]: fba_solution.fluxes.GLUK