0001 function [biomassValues,targetValues] = multiProductionEnvelopeInorg(model,deletions,biomassRxn,geneDelFlag,nPts,plotAllFlag)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 if (nargin < 2)
0026 deletions = {};
0027 end
0028 if (nargin < 3)
0029
0030 biomassRxn = model.rxns(model.c==1);
0031 end
0032 if (nargin < 4)
0033
0034 geneDelFlag = false;
0035 end
0036 if (nargin < 5)
0037 nPts = 20;
0038 end
0039 if (nargin < 6)
0040 plotAllFlag = false;
0041 end
0042
0043
0044
0045 if (length(deletions) > 0)
0046 if (geneDelFlag)
0047 model = deleteModelGenes(model,deletions);
0048 else
0049 model = changeRxnBounds(model,deletions,zeros(size(deletions)),'b');
0050 end
0051 end
0052
0053
0054 [selExc,selUpt] = findExcRxns(model,false,false);
0055 excRxns = [];
0056 for i = 1:length(model.rxns)
0057 if selExc(i) && ~selUpt(i)
0058 excRxns = [excRxns,model.rxns(i)];
0059 end
0060 end
0061
0062
0063 model = changeObjective(model,biomassRxn,1);
0064 solMax = optimizeCbModel(model,'max');
0065 solMin = optimizeCbModel(model,'min');
0066
0067
0068 biomassValues = linspace(solMin.f,solMax.f,nPts);
0069
0070 plottedRxns = [];
0071 targetUpperBound = [];
0072 targetLowerBound = [];
0073
0074 for i = 1:length(excRxns)
0075 model = changeObjective(model,excRxns(i),1);
0076 model2 = changeRxnBounds(model,biomassRxn,max(biomassValues),'b');
0077 fbasol2 = optimizeCbModel(model2,'max');
0078 maxRate = fbasol2.f;
0079 if (plotAllFlag)||(maxRate > 0.5)
0080 plottedRxns = [plottedRxns,i];
0081 for j = 1:length(biomassValues)
0082 model = changeRxnBounds(model,biomassRxn,biomassValues(j),'b');
0083 sol = optimizeCbModel(model,'max');
0084 if (sol.stat > 0)
0085 targetUpperBound(i,j) = sol.f;
0086 else
0087 targetUpperBound(i,j) = NaN;
0088 end
0089 sol = optimizeCbModel(model,'min');
0090 if (sol.stat > 0)
0091 targetLowerBound(i,j) = sol.f;
0092 else
0093 targetLowerBound(i,j) = NaN;
0094 end
0095 end
0096 end
0097 end
0098
0099
0100 colors = {'b','g','r','c','m','y','k'};
0101 for i = 1:length(plottedRxns)
0102 plot([biomassValues fliplr(biomassValues)],[targetUpperBound(plottedRxns(i),:) fliplr(targetLowerBound(plottedRxns(i),:))],colors{mod(i-1,length(colors))+1},'LineWidth',2)
0103 axis tight;
0104 hold on;
0105 end
0106 hold off;
0107 legend(excRxns(plottedRxns));
0108 legend off;
0109 ylabel('Production Rate (mmol/gDW h)');
0110 xlabel('Growth Rate (1/h)');
0111 plottools, plotbrowser('on'), figurepalette('hide'), propertyeditor('off');
0112
0113 biomassValues = biomassValues';
0114 targetValues = [targetLowerBound' targetUpperBound'];
0115
0116