0001 function modelNew = addRatioReaction(model, listOfRxns, ratioCoeff)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 modelNew = model;
0021
0022 [rows, cols] = size(model.S);
0023
0024 [A, Loc] = ismember(listOfRxns,model.rxns);
0025
0026 modelNew.S(rows+1,:) = 0;
0027 modelNew.S(rows+1,Loc) = [-ratioCoeff(1) ratioCoeff(2)];
0028 modelNew.b(rows+1) = 0;
0029 modelNew.mets{rows+1} = strcat('Ratio_',listOfRxns{1},'_',listOfRxns{2});
0030 modelNew.metName{rows+1} = strcat('Ratio_',listOfRxns{1},'_',listOfRxns{2});
0031 if isfield(modelNew,'note')
0032 modelNew.note = strcat(modelNew.note,listOfRxns{1},' and ',listOfRxns{2}, 'are set to have a ratio of',ratioCoeff(1),' to ' ,ratioCoeff(2),'.');
0033 else
0034 modelNew.note = strcat(listOfRxns{1},' and ',listOfRxns{2}, 'are set to have a ratio of ',num2str(ratioCoeff(1)),':' ,num2str(ratioCoeff(2)),'.');
0035 end
0036
0037