**THIS CODE WAS WRITTEN FOR THE CONSTRAINT-BASED MODELING WORKSHOP J.REED (2/2008) *Read in the appropriate S matrix $include CoreTextbookModel.gms *Place limits on the exchange fluxes based on the minimal media *for a negative flux through the exchange reactions implies that *the metabolites are being taken up or consumed by the cell. *By default the upperlimits of the exchange fluxes are all set to *the Vmax, indicating that the cell can secrete any of the extracellular *metabolites UpperLimits(j)=Vmax; *CARBON SOURCE: select upper and lower limits for exchange flux LowerLimits('EX_glc_e')=-5; *allow co2,pi,o2,h,h2o to be taken up by the cell LowerLimits('EX_co2_e')=-Vmax; LowerLimits('EX_h2o_e')=-Vmax; LowerLimits('EX_h_e')=-Vmax; LowerLimits('EX_o2_e')=-Vmax; LowerLimits('EX_pi_e')=-Vmax; Parameter c(j) used to define the objective function for FBA rFBA_fluxes(j) used to store regulated FBA solutions FBA_fluxes(j) used to store unregulated FBA solutions; c('Biomass')=1; Variables v(j) flux values through reaction in network Obj this is the value of the objective function for the FBA solutions; Equations massbalance(i) mass balance equations for each metabolite calcobj calculates the dot product of the c vector the flux vector; massbalance(i).. sum( j,S(i,j)*v(j) )=e=0; calcobj.. Obj=e=sum( j,c(j)*v(j) ); Model FBA /massbalance, calcobj/; **************************************************************************** ****************Solve the regular FBA problem First************************* **************************************************************************** v.lo(j)=LowerLimits(j); v.up(j)=UpperLimits(j); solve FBA using lp maximizing Obj; FBA_fluxes(j)=v.l(j); **************************************************************************** *Evaluate TF Activity & Gene Expression States to Constrain Certain Fluxes** *to Equal 0. Use FBA to again to Solve for the Fluxes*********************** **************************************************************************** $include CoreRegulation.gms v.lo(j)=reactionstatus(j)*LowerLimits(j); v.up(j)=reactionstatus(j)*UpperLimits(j); solve FBA using lp maximizing Obj rFBA_fluxes(j)=v.l(j); display TFstatus,genestatus; *This section writes out the results to a txt file file result /rFBA_results.txt/; result.pw=500; result.pc=6; result.ps=130; put result; put 'Model status: '; put FBA.modelstat; put /; put 'Solver status: '; put FBA.solvestat; put /; put 'Rxn Abbr'; put 'FBA Solution'; put 'Reaction Status (0=Off, 1=On)'; put 'rFBA Solution'; put /; loop(j,put j.tl; put FBA_fluxes(j):8:4; put reactionstatus(j):1:0; put rFBA_fluxes(j):8:4; put /); put /; put 'Transcription Factor Status (0=Inctive, 1=Active)'; put /; loop(transcriptionfactors,put transcriptionfactors.tl; put TFstatus(transcriptionfactors):1:0; put /); put /; put 'Gene Expression Status (0=Off, 1=On)'; put /; loop(genes,put genes.tl; put genestatus(genes):1:0; put /); putclose result;