doubleRobustnessAnalysis

PURPOSE ^

doubleRobustnessAnalysis Performs robustness analysis for a pair of reactions of

SYNOPSIS ^

function [controlFlux1, controlFlux2, objFlux] = doubleRobustnessAnalysis(model, controlRxn1, controlRxn2, nPoints, plotResFlag, objRxn,objType)

DESCRIPTION ^

doubleRobustnessAnalysis Performs robustness analysis for a pair of reactions of
 interest and an objective of interest

 [controlFlux1, controlFlux2, objFlux] = doubleRobustnessAnalysis(model, controlRxn1, controlRxn2, nPoints, plotResFlag, objRxn, objType)

INPUTS
 model         COBRA model structure
 controlRxn1   Reaction of interest whose value is to be controlled
 controlRxn2   Reaction of interest whose value is to be controlled
 
OPTIONAL INPUTS
 nPoints       Number of flux values per dimension (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/20/07

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [controlFlux1, controlFlux2, objFlux] = doubleRobustnessAnalysis(model, controlRxn1, controlRxn2, nPoints, plotResFlag, objRxn,objType)
0002 %doubleRobustnessAnalysis Performs robustness analysis for a pair of reactions of
0003 % interest and an objective of interest
0004 %
0005 % [controlFlux1, controlFlux2, objFlux] = doubleRobustnessAnalysis(model, controlRxn1, controlRxn2, nPoints, plotResFlag, objRxn, objType)
0006 %
0007 %INPUTS
0008 % model         COBRA model structure
0009 % controlRxn1   Reaction of interest whose value is to be controlled
0010 % controlRxn2   Reaction of interest whose value is to be controlled
0011 %
0012 %OPTIONAL INPUTS
0013 % nPoints       Number of flux values per dimension (Default = 20)
0014 % plotResFlag   Plot results (Default = true)
0015 % objRxn        Objective reaction to be maximized (Default = whatever
0016 %               is defined in model)
0017 % objType       Maximize ('max') or minimize ('min') objective
0018 %               (Default = 'max')
0019 %
0020 %OUTPUTS
0021 % controlFlux   Flux values within the range of the maximum and minimum for
0022 %               reaction of interest
0023 % objFlux       Optimal values of objective reaction at each control
0024 %               reaction flux value
0025 %
0026 % Monica Mo and Markus Herrgard 8/20/07
0027 
0028 if (nargin < 4)
0029     nPoints = 20;
0030 end
0031 if (nargin < 5)
0032     plotResFlag = true;
0033 end
0034 if (nargin > 6)
0035     baseModel = changeObjective(model,objRxn);
0036 else
0037     baseModel = model;
0038 end
0039 if (nargin <7)
0040     objType = 'max';
0041 end
0042 
0043 if (findRxnIDs(model,controlRxn1))
0044     tmpModel = changeObjective(model,controlRxn1);
0045     solMin1 = optimizeCbModel(tmpModel,'min');
0046     solMax1 = optimizeCbModel(tmpModel,'max');
0047 else
0048     error('Control reaction 1 does not exist!');
0049 end
0050 if (findRxnIDs(model,controlRxn2))
0051     tmpModel = changeObjective(model,controlRxn2);
0052     solMin2 = optimizeCbModel(tmpModel,'min');
0053     solMax2 = optimizeCbModel(tmpModel,'max');
0054 else
0055     error('Control reaction 2 does not exist!');
0056 end
0057 
0058 objFlux = [];
0059 controlFlux1 = linspace(solMin1.f,solMax1.f,nPoints)';
0060 controlFlux2 = linspace(solMin2.f,solMax2.f,nPoints)';
0061 
0062 h = waitbar(0,'Double robustness analysis in progress ...');
0063 for i=1:nPoints
0064     for j = 1:nPoints
0065         waitbar(((i-1)*nPoints+j)/nPoints^2,h);
0066         modelControlled = changeRxnBounds(baseModel,controlRxn1,controlFlux1(i),'b');
0067         modelControlled = changeRxnBounds(modelControlled,controlRxn2,controlFlux2(j),'b');
0068         solControlled = optimizeCbModel(modelControlled,objType);
0069         objFlux(i,j) = solControlled.f;
0070     end
0071 end
0072 if ( regexp( version, 'R20') )
0073         close(h);
0074 end
0075 
0076 if (plotResFlag)
0077     clf
0078     surf(controlFlux1,controlFlux2,objFlux);
0079     %shading interp
0080     xlabel(strrep(controlRxn1,'_','-'));
0081     ylabel(strrep(controlRxn2,'_','-'));
0082     axis tight
0083 end
0084 
0085 
0086 
0087 
0088 
0089

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