0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 prepData2 = load('model/PrepData2.mat').prepData;
0024
0025 upperLimit = 100;
0026 lowerLimit = 0.1;
0027
0028 model = prepData2.minModel;
0029 model = prepData.minModel;
0030
0031
0032
0033
0034 model.lb(model.lb==-inf)=-upperLimit;
0035 model.ub(model.ub==inf)=upperLimit;
0036 model.lb(model.lb==-1000)=-upperLimit;
0037 model.ub(model.ub==1000)=upperLimit;
0038
0039
0040 unique(model.lb)
0041 unique(model.ub)
0042
0043
0044 onFwd = false(numel(model.rxns,1));
0045 onRev = false(numel(model.rxns,1));
0046
0047 iter = 1;
0048 while true
0049 disp([num2str(iter) ': ' num2str(sum(onFwd))])
0050 model.c=ones(numel(model.c),1);
0051 model.c(onFwd) = 0;
0052
0053 sol=solveLP(model);
0054 if isempty(sol.x)
0055 disp('Failed');
0056 break;
0057 end
0058
0059 currRes = sol.x > lowerLimit;
0060 if sum(currRes & ~onFwd) == 0
0061 break;
0062 end
0063
0064 onFwd = onFwd | currRes;
0065 iter = iter + 1;
0066 end
0067
0068 sum(~onFwd)
0069
0070
0071 onRev = false(numel(model.rxns,1));
0072
0073 iter = 1;
0074 while true
0075 disp([num2str(iter) ': ' num2str(sum(onRev))])
0076 model.c=-ones(numel(model.c),1);
0077 model.c(~model.rev) = 0;
0078 model.c(onRev) = 0;
0079
0080 sol=solveLP(model);
0081 if isempty(sol.x)
0082 disp('Failed');
0083 break;
0084 end
0085
0086 currRes = sol.x < -lowerLimit;
0087 if sum(currRes & ~onRev) == 0
0088 break;
0089 end
0090
0091 onRev = onRev | currRes;
0092 iter = iter + 1;
0093 end
0094
0095 sum(~onRev(model.rev == 1))
0096
0097 onRev = false(numel(model.rxns,1));
0098
0099 indLeft = find(model.rev == 1 & ~onRev);
0100
0101 constructEquations(model, model.rxns(indLeft))
0102
0103
0104 for i = 1:numel(indLeft)
0105 model.c=zeros(numel(model.c),1);
0106 model.c(indLeft(i)) = -1;
0107
0108 sol=solveLP(model);
0109 if isempty(sol.x)
0110 disp('Failed');
0111 break;
0112 end
0113
0114 currRes = sol.x(indLeft(i)) < -lowerLimit;
0115 disp([num2str(indLeft(i)) ': ' num2str(currRes)])
0116 onRev(indLeft(i)) = currRes;
0117 onRev = onRev | currRes;
0118 iter = iter + 1;
0119 end
0120
0121 sum(~onRev(model.rev == 1))
0122
0123