convRevSamples Convert signs for reactions that are only running in reverse direction [model,samples] = convRevSamples(model,samples) INPUT model Constraint-based model OPTIONAL INPUT samples Sample set OUTPUTS model COBRA model structure with negative-direction fluxes reversed samples Sample set with negative-direction fluxes reversed Markus Herrgard 8/22/06
0001 function [model,samples] = convRevSamples(model,samples) 0002 % convRevSamples Convert signs for reactions that are only running in 0003 % reverse direction 0004 % 0005 % [model,samples] = convRevSamples(model,samples) 0006 % 0007 %INPUT 0008 % model Constraint-based model 0009 % 0010 %OPTIONAL INPUT 0011 % samples Sample set 0012 % 0013 %OUTPUTS 0014 % model COBRA model structure with negative-direction fluxes reversed 0015 % samples Sample set with negative-direction fluxes reversed 0016 % 0017 % 0018 % Markus Herrgard 8/22/06 0019 0020 for i = 1:length(model.rxns) 0021 rxnName = model.rxns{i}; 0022 lastInd = regexp(rxnName,'_r$'); 0023 if (~isempty(lastInd)) 0024 model.rxns{i} = rxnName(1:(lastInd-1)); 0025 model.lb(i) = -model.ub(i); 0026 model.ub(i) = -model.lb(i); 0027 model.S(:,i) = -model.S(:,i); 0028 if nargin > 1 0029 samples(i,:) = -samples(i,:); 0030 end 0031 end 0032 end 0033 0034 if nargin < 2 0035 samples = []; 0036 end 0037