1 # 2 ## 3 ### Identifying how much ATP A. woodii can produce from different combinations of carbon sources 4 ## 5 # 6 7 8 m = ScrumPy.Model('Awoodii.spy') 9 10 # TASK 1 ----------------------------------- minimise importers of substrate and set ATPase 11 # load lp object 12 lp = m.GetLP() 13 14 # set some constraints 15 16 #1) block all transporters 17 # identify all transporters 18 for reaction in m.sm.cnames: 19 if "_tx" in reaction: 20 print reaction 21 22 # now block them by setting a fixed flux 23 for reaction in m.sm.cnames: 24 if "_tx" in reaction: 25 lp.SetFixedFlux({reaction:0}) 26 27 28 # unblock substrates to be investigated 29 lp.ClearFluxConstraints(['CO_s_tx','BUTANEDIOL_s_tx']) 30 31 # make a dictionary of all fermentation products 32 f_product_constraints = {} 33 for reaction in m.sm.cnames: 34 if "f_tx" in reaction: # fermentation products have the suffix "f_tx" 35 f_product_constraints[reaction] = (None,0) # None, 0 indicates only negative flux (export) is allowed 36 37 # now set the bounds on lp using the dictionary just made 38 lp.SetFluxBounds(c_constraints) 39 40 41 lp.SetFixedFlux({'ADENOSINETRIPHOSPHATASE-RXN':1}) # set a fixed flux of 1 (arbitrary number) on the ATPase reaction 42 43 # set the objective of minimising these two substrate transporters (minimising is default objective) 44 lp.SetObjective(['CO_s_tx','BUTANEDIOL_s_tx']) 45 46 lp.Solve() # solve 47 sol_1 = lp.GetPrimSol() # get solution and save to variable 48 49 # now explore what the solution is 50 51 52 for reaction in sol_1: # for each reaction in solution 53 if "tx" in reaction: # if the reaction is a transporter 54 print reaction, sol_1[reaction] # print the name and flux carried by transporter (can also use round() function here to format value) 55 56 #double check that the ATPase has a flux unit 1 57 print sol_1['ADENOSINETRIPHOSPHATASE-RXN'] 58 59 # calculate the ATP yield per carbon mole 60 # ATPase_flux / carbon_flux 61 1 / (0.41*4+1.22) 62 63 # also check that carbon is balanced 64 # flux x carbon_atoms = carbon_flux 65 0.41*4+1.22 66 1.43 * 2