0001 function testForTypeIIIPathways(model,ListExch,filename)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 warning off all
0015 if nargin < 3
0016 filename = 'ModelTestTypeIII';
0017 end
0018
0019
0020 model.lb(ListExch)=0;
0021 model.ub(ListExch)=0;
0022
0023 tol = 1e-10;
0024
0025
0026 cnt=1;
0027 for i = 1:size(model.lb,1)
0028 model.c(logical(model.c)) = 0;
0029 model.c(i,1) = 1;
0030 solMax=optimizeCbModel(model,'max');
0031 SolMin=optimizeCbModel(model,'min');
0032 MinMax(i,:)=[SolMin.f solMax.f];
0033 if (SolMin.f==solMax.f && abs(SolMin.f) <= tol)
0034 rxnzero(cnt,1)=i;
0035 cnt=cnt+1;
0036 end
0037 if (SolMin.f<0)
0038 model.rev(i)=1;
0039 else
0040 model.rev(i)=0;
0041 end
0042 end
0043
0044
0045 convertModelToEX(model,strcat(filename, '.expa'),ListExch,rxnzero);
0046
0047
0048 [status,result] = dos(['X3 -p ' strcat(filename, '.expa')]);
0049
0050 if strfind(result,'ERROR')>0
0051 fprintf('\n Error with X3.exe:\n');
0052 fprintf('%s\n',result);
0053 else
0054
0055 if result(strfind(result,'There are ') + length('There are ')) > 0
0056 fprintf('Type III pathways were found in model. A table of Type III pathways can be found in ');
0057 fprintf('%s',strcat(filename,'_myT3.txt'));
0058 fprintf(' or as Sparse format in ');
0059 fprintf('%s',strcat(filename,'_myT3_Sprs.txt'));
0060 else
0061 fprintf('No Type III pathways can be found in model.');
0062 dos(['rm ' strcat(filename,'_myT3_Sprs.txt') strcat(filename,'_myT3.txt') strcat(filename,'_myRxnMet.txt')]);
0063 end
0064
0065 dos(['del ' strcat(filename,'_myPaths.txt') ' ' strcat(filename,'_myPaths_sparse.txt')]);
0066 end