. {{{#!highlight python # ## ### Identifying how much ATP A. woodii can produce from different combinations of carbon sources ## # m = ScrumPy.Model('Awoodii.spy') # TASK 1 ----------------------------------- minimise importers of substrate and set ATPase # load lp object lp = m.GetLP() # set some constraints #1) block all transporters # identify all transporters for reaction in m.sm.cnames: if "_tx" in reaction: print reaction # now block them by setting a fixed flux for reaction in m.sm.cnames: if "_tx" in reaction: lp.SetFixedFlux({reaction:0}) # unblock substrates to be investigated lp.ClearFluxConstraints(['CO_s_tx','BUTANEDIOL_s_tx']) # make a dictionary of all fermentation products f_product_constraints = {} for reaction in m.sm.cnames: if "f_tx" in reaction: # fermentation products have the suffix "f_tx" f_product_constraints[reaction] = (None,0) # None, 0 indicates only negative flux (export) is allowed # now set the bounds on lp using the dictionary just made lp.SetFluxBounds(c_constraints) lp.SetFixedFlux({'ADENOSINETRIPHOSPHATASE-RXN':1}) # set a fixed flux of 1 (arbitrary number) on the ATPase reaction # set the objective of minimising these two substrate transporters (minimising is default objective) lp.SetObjective(['CO_s_tx','BUTANEDIOL_s_tx']) lp.Solve() # solve sol_1 = lp.GetPrimSol() # get solution and save to variable # now explore what the solution is for reaction in sol_1: # for each reaction in solution if "tx" in reaction: # if the reaction is a transporter print reaction, sol_1[reaction] # print the name and flux carried by transporter (can also use round() function here to format value) #double check that the ATPase has a flux unit 1 print sol_1['ADENOSINETRIPHOSPHATASE-RXN'] # calculate the ATP yield per carbon mole # ATPase_flux / carbon_flux 1 / (0.41*4+1.22) # also check that carbon is balanced # flux x carbon_atoms = carbon_flux 0.41*4+1.22 1.43 * 2 }}}