followFluxes Prints fluxes and reactions for each of the reactions that results in fluxes in the specified interval. model a model structure fluxesA flux vector for the test case lowerFlux only reactions with fluxes above this cutoff value are displayed upperFlux only reactions with fluxes below this cutoff value are displayed (opt, default Inf) fluxesB flux vector for the reference case(opt) Usage: [errorFlag]=followFluxes(model, fluxesA, lowerFlux, upperFlux, fluxesB) Rasmus Agren, 2010-12-16
0001 function [errorFlag]=followFluxes(model, fluxesA, lowerFlux, upperFlux, fluxesB) 0002 % followFluxes 0003 % Prints fluxes and reactions for each of the reactions that results in 0004 % fluxes in the specified interval. 0005 % 0006 % model a model structure 0007 % fluxesA flux vector for the test case 0008 % lowerFlux only reactions with fluxes above this cutoff 0009 % value are displayed 0010 % upperFlux only reactions with fluxes below this cutoff 0011 % value are displayed (opt, default Inf) 0012 % fluxesB flux vector for the reference case(opt) 0013 % 0014 % Usage: [errorFlag]=followFluxes(model, fluxesA, lowerFlux, upperFlux, 0015 % fluxesB) 0016 % 0017 % Rasmus Agren, 2010-12-16 0018 % 0019 0020 %Checks that the upper flux is larger than the lower flux 0021 if nargin>3 0022 if upperFlux<=lowerFlux 0023 errorFlag=1; 0024 return; 0025 end 0026 end 0027 0028 %Gets the fluxes for the reactions 0029 if nargin<4 0030 fluxIndexes=find(fluxesA>=lowerFlux); 0031 else 0032 fluxIndexes=find(fluxesA>=lowerFlux & fluxesA<=upperFlux); 0033 end 0034 0035 %Finds the involved reactions 0036 formulas = constructEquations(model,model.rxns(fluxIndexes)); 0037 0038 if nargin>3 0039 fprintf('These reactions have flux values between %s and %s\n\n',num2str(lowerFlux),num2str(upperFlux)); 0040 else 0041 fprintf('These reactions have flux values above %s\n\n',num2str(lowerFlux)); 0042 end 0043 for i=1:length(formulas) 0044 if nargin>4 0045 fluxText=['Flux: ' num2str(fluxesA(fluxIndexes(i))) ' Reference flux: ' num2str(fluxesB(fluxIndexes(i)))]; 0046 else 0047 fluxText=['Flux: ' num2str(fluxesA(fluxIndexes(i)))]; 0048 end 0049 fprintf('%s: %s\n\t%s\n\t%s\n', char(model.rxns(fluxIndexes(i))), char(formulas(i)),... 0050 char(model.rxnNames(fluxIndexes(i))),fluxText); 0051 end