productionEnvelope

PURPOSE ^

productionEnvelope Calculates the byproduct secretion envelope

SYNOPSIS ^

function [biomassValues,targetValues,lineHandle] = productionEnvelope(model,deletions,lineColor,targetRxn,biomassRxn,geneDelFlag,nPts)

DESCRIPTION ^

productionEnvelope Calculates the byproduct secretion envelope

 [biomassValues,targetValues] = productionEnvelope(model,deletions,lineColor,targetRxn,biomassRxn,geneDelFlag,nPts)

INPUTS
 model         COBRA model structure

OPTIONAL INPUTS
 deletions     List of reaction or gene deletions (empty if wild type)
 lineColor     Line color for plotting (see help plot for color codes)
 targetRxn     Target metabolite production reaction name
 biomassRxn    Biomass rxn name
 geneDelFlag   Perform gene and not reaction deletions
 nPts          Number of points in the plot

OUTPUTS
 biomassValues Biomass values for plotting
 targetValues  Target upper and lower bounds for plotting
 lineHandle    Handle to lineseries object

 Markus Herrgard 8/28/06

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [biomassValues,targetValues,lineHandle] = productionEnvelope(model,deletions,lineColor,targetRxn,biomassRxn,geneDelFlag,nPts)
0002 %productionEnvelope Calculates the byproduct secretion envelope
0003 %
0004 % [biomassValues,targetValues] = productionEnvelope(model,deletions,lineColor,targetRxn,biomassRxn,geneDelFlag,nPts)
0005 %
0006 %INPUTS
0007 % model         COBRA model structure
0008 %
0009 %OPTIONAL INPUTS
0010 % deletions     List of reaction or gene deletions (empty if wild type)
0011 % lineColor     Line color for plotting (see help plot for color codes)
0012 % targetRxn     Target metabolite production reaction name
0013 % biomassRxn    Biomass rxn name
0014 % geneDelFlag   Perform gene and not reaction deletions
0015 % nPts          Number of points in the plot
0016 %
0017 %OUTPUTS
0018 % biomassValues Biomass values for plotting
0019 % targetValues  Target upper and lower bounds for plotting
0020 % lineHandle    Handle to lineseries object
0021 %
0022 % Markus Herrgard 8/28/06
0023 
0024 if (nargin < 2)
0025     deletions = {};
0026 end
0027 if (nargin < 3)
0028     lineColor = 'k';
0029 end
0030 if (nargin < 4)
0031     % Target flux
0032     targetRxn = 'EX_etoh(e)';
0033 end
0034 if (nargin < 5)
0035     % Biomass flux
0036     biomassRxn = 'biomass_SC4_bal';
0037 end
0038 if (nargin < 6)
0039     % Gene or rxn deletions
0040     geneDelFlag = false;
0041 end
0042 if (nargin < 7)
0043     nPts = 20;
0044 end
0045 
0046 % Create model with deletions
0047 if (length(deletions) > 0)
0048     if (geneDelFlag)
0049         model = deleteModelGenes(model,deletions);
0050     else
0051         model = changeRxnBounds(model,deletions,zeros(size(deletions)),'b');
0052     end
0053 end
0054 
0055 % Run FBA to get upper bound for biomass
0056 model = changeObjective(model,biomassRxn);
0057 solMax = optimizeCbModel(model,'max');
0058 solMin = optimizeCbModel(model,'min');
0059 
0060 % Create biomass range vector
0061 biomassValues = linspace(solMin.f,solMax.f,nPts);
0062 
0063 % Max/min for target production
0064 model = changeObjective(model,targetRxn);
0065 for i = 1:length(biomassValues)
0066     model = changeRxnBounds(model,biomassRxn,biomassValues(i),'b');
0067     sol = optimizeCbModel(model,'max');
0068     if (sol.stat > 0)
0069         targetUpperBound(i) = sol.f;
0070     else
0071         targetUpperBound(i) = NaN;
0072     end
0073     sol = optimizeCbModel(model,'min');    
0074     if (sol.stat > 0)
0075         targetLowerBound(i) = sol.f;
0076     else
0077         targetLowerBound(i) = NaN;
0078     end
0079 end
0080 
0081 % Plot results
0082 lineHandle=plot([biomassValues fliplr(biomassValues)],[targetUpperBound fliplr(targetLowerBound)],lineColor,'LineWidth',2);
0083 axis tight;
0084 %ylabel([strrep(targetRxn,'_','-') ' (mmol/gDW h)']);
0085 %xlabel('Growth rate (1/h)');
0086 
0087 biomassValues = biomassValues';
0088 targetValues = [targetLowerBound' targetUpperBound'];

Generated on Thu 21-Jun-2012 15:39:23 by m2html © 2003