Size: 5182
Comment:
|
← Revision 42 as of 2024-12-12 09:03:16 ⇥
Size: 2900
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
== Part 1 == | |
Line 7: | Line 8: |
1. We can now generate a linear programming object: | 1. We can now generate a linear programming object: |
Line 10: | Line 11: |
1. lp.SetObjective(m.sm.cnames) | 1. lp.!SetObjective(m.sm.cnames) |
Line 12: | Line 13: |
1. lp.SetFixedFlux({"TAG_Exp_tx":-1}) 1. We can now solve te lp: 1. lp.Sovle() |
1. lp.!SetFixedFlux({"TAG_Exp_tx":-1}) 1. We can now solve the lp: 1. lp.Solve() |
Line 16: | Line 17: |
1. sol = lp.GetPrimSol() | 1. sol = lp.!GetPrimSol() |
Line 20: | Line 21: |
for r in sol: | . for r in sol: |
Line 22: | Line 23: |
if "_tx" in r: | . if "_tx" in r: . print(r, sol[r]) |
Line 24: | Line 26: |
print(r, sol[r]) | Reaction and metabolite names are derived from [[https://metacyc.org|MetaCyc]] so you can use thses to find out more about individual reactions in the solution. NB: the `_Cyto suffix` is added to differentiate compartmentalisation in the model and is not part of !MetaCyc identifier, and should be removed before searching on !MetaCyc. |
Line 26: | Line 28: |
. ''' ''' <<BR>> | |
Line 27: | Line 30: |
== Part 2 - Constraint Scanning == Part 1 describes how to examine a single lp solution. Now we can move on to exploring multiple solutions and examine how Phaeo can rearange its metabolism in response to increasing TAG demand. The "Analysis" directory contains a simple Python module, LipidScan.py, to facilitate this. |
|
Line 28: | Line 33: |
Having started !ScrumPy and loaded the model as in Part 1, we import the !LipidScan module: | |
Line 29: | Line 35: |
. >>> import !LipidScan | |
Line 30: | Line 37: |
The code that you will be using is stored in module “!LipidScan.py” in the “Analysis” directory. (Note: Model directory contains the model definition files i.e .spy files and analysis contains the python modules, i.e., the ` .py` files you will need for this practical) | (The model must be loaded first) |
Line 32: | Line 39: |
The module "!LipidScan.py" contains tNow exaine wo functions. Following is their code: | We can now generate some results: |
Line 34: | Line 41: |
'''a. BuildLP ''''''function''' | . >>> res = [[LipidScan|!LipidScan]].LipidScan(m) |
Line 36: | Line 43: |
{{{#!python def BuildLP(m): lp = m.GetLP() lp.SetObjective(m.sm.cnames) lp.SetFluxBounds({"RIBULOSE-BISPHOSPHATE-CARBOXYLASE-RXN_Plas":(0,400.0)}) if "GLYCEROL_Cyto_tx" in m.sm.cnames: lp.SetFluxBounds({"GLYCEROL_Cyto_tx":(0,20)}) return lp }}} '''b. !LipidScan ''''''function''' |
"res" is a !DataSet, (matrix-like) object that contains 100 lp solutions, for the model, subject to a varying demand for TAG and satisfyng demand for biomass precursors. We are only interested in the reactions that change: |
Line 47: | Line 45: |
{{{#!python def LipidScan(m,lp=None,lo=1.0,hi=20.0): ds = DataSets.DataSet() ranges = numpy.arange(lo,hi) if lp == None: lp = BuildLP(m) for t in ranges: lp.SetFixedFlux({"TAG_synthesis_Cyto":t}) lp.Solve() if lp.GetStatusMsg() == "optimal": sol = lp.GetPrimSol() ds.UpdateFromDic(sol) ds.SetPlotX("TAG_synthesis_Cyto") ds.AddToPlot("RIBULOSE-BISPHOSPHATE-CARBOXYLASE-RXN_Plas") return ds }}} To use these methods you need to import the "!LipidScan" module. On ScrumPy window execute the following statements. |
. >>> chs = !LipidScan.Changers(res) |
Line 65: | Line 47: |
{{{#!python import sys sys.path.append('../Analysis') import LipidScan }}} Now the methods in the "!LipidScan" module can be used. |
Commonly, we start by examining the transport processes, which can be conveniently plotted: |
Line 72: | Line 49: |
a. Generate LP problem where the objective is to minimise total flux. Constrain the maximum Rubisco flux and glycerol transporter flux to 400 and 20 respectively (make use of !SetFluxBounds() function). | . >>> res.!SetPlotX("TAG_Exp_tx") >>> for ch in chs: . if "_tx" in ch: . res.!AddToPlot(ch) |
Line 74: | Line 53: |
{{{#!python lp = LipidScan.BuildLP(m) }}} . b. Solve this LP repeatedly (using for loop) while increasing flux in TAG synthesis reaction in range between 1 to 20. Save each of the solution in a dataset. |
This more than is immediately convenient, so we can remove the plasted transporters, to leave only the cytosolic transporters: |
Line 79: | Line 55: |
{{{#!python ds = LipidScan.LipidScan(m, lp=lp) }}} . c. Examine the flux pattern in Rubisco reaction with respect to increasing flux in TAG synthesis. What is the maximum flux in Rubisco reaction? |
. >>> res.!RemoveMatchesFromPlot("_Plas") |
Line 84: | Line 57: |
{{{#!python ds.SetPlotX("TAG_synthesis_Cyto") #setting x-axis ds.AddToPlot("RIBULOSE-BISPHOSPHATE-CARBOXYLASE-RXN_Plas") }}} . d. Add inorganic carbon transporters (Hint: “CO2_Cyto_tx” and “HCO3_Cyto_tx”) and organic carbon transporter (“GLYCEROL_Cyto_tx”) to the plot ''' ''' . e. What is the maximum flux in TAG synthesis? ''' ''' |
At which point an interpretable pattern starts to emerge. |
Line 91: | Line 59: |
4. As you would have noticed TAG synthesis in above example is through mixotrophic mode (i.e model uses light energy and organic carbon, glycerol, for lipid production). As you remember from the lecture, ''P. tricornutum'' can grow under phototrophic condition too (i.e in the absence of glycerol). You will simulate the model in autotrophic condition. For this, constrain the flux in glycerol transporter to zero. ''' ''' {{{#!python lp = LipidScan.BuildLP(m) lp.SetFixedFlux({"GLYCEROL_Cyto_tx":0}) res = LipidScan.LipidScan(m, lp=lp) }}} * Plot reactions as above. Examine the difference in flux patterns.' * What is the maximum feasible flux in TAG synthesis under phototrophic condition? * Is is higher or lower than that in mixotrophic condition (in question 3)? 5. Find the reactions that are active in mixotrophic condition but not in phototrophic condition? {{{#!python from ScrumPy.Util import Set Set.Complement(ds.cnames,res.cnames) }}} Try and identify which pathways these reactions belong to, see the digrams in the previous slides or search on the [[https://metacyc.org|MetaCyc]] website. NB: the `_Cyto suffix` is added to differentiate compartmentalisation in the model and is not part of !MetaCyc identifier, and should be removed before searching on !MetaCyc. . ''' ''' |
Over to you! |
Practical 5: Identifying pathways for TAG synthesis in Phaeodactylum tricornutum
Part 1
Here, we will investigate the genome-scale metabolic model of P. tricornutum to identify pathways for TAG synthesis. See Villanova et al (2021). Front. Plant Sci. 12:642199. doi: 10.3389/fpls.2021.642199
Download the archive containing the model from here and extract the files.This will generate a new directory,"srcs", containing two sub-directories: "Model" and "Analysis". Start ScrumPy.
- Load the Model:
m = ScrumPy.Model("../Model/Phaeo.spy")
- We can now generate a linear programming object:
- lp = m.GetLP()
- And specify minimising total flux as the objective:
lp.SetObjective(m.sm.cnames)
- With the constraint that we must generate 1 mole of TAG:
lp.SetFixedFlux({"TAG_Exp_tx":-1})
- We can now solve the lp:
- lp.Solve()
- And obtain the solution:
sol = lp.GetPrimSol()
Sol is a dictionary, mapping reactions to fluxes, satisfying our constraints and objectives. Examine its properties. e.g. what transport processes are involved?
- for r in sol:
- if "_tx" in r:
- print(r, sol[r])
Reaction and metabolite names are derived from MetaCyc so you can use thses to find out more about individual reactions in the solution. NB: the _Cyto suffix is added to differentiate compartmentalisation in the model and is not part of MetaCyc identifier, and should be removed before searching on MetaCyc.
Part 2 - Constraint Scanning
Part 1 describes how to examine a single lp solution. Now we can move on to exploring multiple solutions and examine how Phaeo can rearange its metabolism in response to increasing TAG demand. The "Analysis" directory contains a simple Python module, LipidScan.py, to facilitate this.
Having started ScrumPy and loaded the model as in Part 1, we import the LipidScan module:
>>> import LipidScan
(The model must be loaded first)
We can now generate some results:
>>> res = !LipidScan.LipidScan(m)
"res" is a DataSet, (matrix-like) object that contains 100 lp solutions, for the model, subject to a varying demand for TAG and satisfyng demand for biomass precursors. We are only interested in the reactions that change:
>>> chs = LipidScan.Changers(res)
Commonly, we start by examining the transport processes, which can be conveniently plotted:
>>> res.!SetPlotX("TAG_Exp_tx") >>> for ch in chs:
- if "_tx" in ch:
res.AddToPlot(ch)
- if "_tx" in ch:
This more than is immediately convenient, so we can remove the plasted transporters, to leave only the cytosolic transporters:
>>> res.RemoveMatchesFromPlot("_Plas")
At which point an interpretable pattern starts to emerge.
Over to you!