robustnessAnalysis Performs robustness analysis for a reaction of interest and an objective of interest [controlFlux, objFlux] = robustnessAnalysis(model, controlRxn, nPoints, plotResFlag, objRxn, objType) INPUTS model COBRA model structure controlRxn Reaction of interest whose value is to be controlled OPTIONAL INPUTS nPoints Number of points to show on plot (Default = 20) plotResFlag Plot results (Default true) objRxn Objective reaction to be maximized (Default = whatever is defined in model) objType Maximize ('max') or minimize ('min') objective (Default = 'max') OUTPUTS controlFlux Flux values within the range of the maximum and minimum for reaction of interest objFlux Optimal values of objective reaction at each control reaction flux value Monica Mo and Markus Herrgard 8/17/06
0001 function [controlFlux, objFlux] = robustnessAnalysis(model, controlRxn, nPoints, plotResFlag, objRxn,objType) 0002 %robustnessAnalysis Performs robustness analysis for a reaction of 0003 % interest and an objective of interest 0004 % 0005 % [controlFlux, objFlux] = robustnessAnalysis(model, controlRxn, nPoints, plotResFlag, objRxn, objType) 0006 % 0007 %INPUTS 0008 % model COBRA model structure 0009 % controlRxn Reaction of interest whose value is to be controlled 0010 % 0011 %OPTIONAL INPUTS 0012 % nPoints Number of points to show on plot (Default = 20) 0013 % plotResFlag Plot results (Default true) 0014 % objRxn Objective reaction to be maximized 0015 % (Default = whatever is defined in model) 0016 % objType Maximize ('max') or minimize ('min') objective 0017 % (Default = 'max') 0018 % 0019 %OUTPUTS 0020 % controlFlux Flux values within the range of the maximum and minimum for 0021 % reaction of interest 0022 % objFlux Optimal values of objective reaction at each control 0023 % reaction flux value 0024 % 0025 % Monica Mo and Markus Herrgard 8/17/06 0026 0027 if (nargin < 3) 0028 nPoints = 20; 0029 end 0030 if (nargin < 4) 0031 plotResFlag = true; 0032 end 0033 if (nargin > 4) 0034 baseModel = changeObjective(model,objRxn); 0035 else 0036 baseModel = model; 0037 end 0038 if (nargin <6) 0039 objType = 'max'; 0040 end 0041 0042 if (findRxnIDs(model,controlRxn)) 0043 tmpModel = changeObjective(model,controlRxn); 0044 solMin = optimizeCbModel(tmpModel,'min'); 0045 solMax = optimizeCbModel(tmpModel,'max'); 0046 else 0047 error('Control reaction does not exist!'); 0048 end 0049 0050 objFlux = []; 0051 controlFlux = linspace(solMin.f,solMax.f,nPoints)'; 0052 0053 h = waitbar(0,'Robustness analysis in progress ...'); 0054 for i=1:length(controlFlux) 0055 waitbar(i/length(controlFlux),h); 0056 modelControlled = changeRxnBounds(baseModel,controlRxn,controlFlux(i),'b'); 0057 solControlled = optimizeCbModel(modelControlled,objType); 0058 objFlux(i) = solControlled.f; 0059 end 0060 if ( regexp( version, 'R20') ) 0061 close(h); 0062 end 0063 0064 objFlux = objFlux'; 0065 0066 if (plotResFlag) 0067 plot(controlFlux,objFlux) 0068 xlabel(strrep(controlRxn,'_','-')); 0069 ylabel('Objective'); 0070 axis tight; 0071 end 0072 0073 0074 0075 0076 0077