addRatioReaction

PURPOSE ^

addRatioReaction adds ratio reaction.

SYNOPSIS ^

function modelNew = addRatioReaction(model, listOfRxns, ratioCoeff)

DESCRIPTION ^

addRatioReaction adds ratio reaction. 

 modelNew = addRatioReaction(model, listOfRxns, ratioCoeff)

INPUTS
 model         COBRA model structure
 listOfRxns    List of 2 Reactions
 ratioCoeff    Array of ratio coefficient between the 2 reactions

OUTPUT
 modelNew      COBRA model structure containing the ratio

 Example:      1 v_EX_ac(e) = 2 v_EX_for(e):
               modelNew = addRatioReaction(model, {'EX_ac(e)' 'EX_for(e)'}, [1 2])


 Ines Thiele 02/09

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function modelNew = addRatioReaction(model, listOfRxns, ratioCoeff)
0002 %addRatioReaction adds ratio reaction.
0003 %
0004 % modelNew = addRatioReaction(model, listOfRxns, ratioCoeff)
0005 %
0006 %INPUTS
0007 % model         COBRA model structure
0008 % listOfRxns    List of 2 Reactions
0009 % ratioCoeff    Array of ratio coefficient between the 2 reactions
0010 %
0011 %OUTPUT
0012 % modelNew      COBRA model structure containing the ratio
0013 %
0014 % Example:      1 v_EX_ac(e) = 2 v_EX_for(e):
0015 %               modelNew = addRatioReaction(model, {'EX_ac(e)' 'EX_for(e)'}, [1 2])
0016 %
0017 %
0018 % Ines Thiele 02/09
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

Generated on Thu 21-Jun-2012 15:39:23 by m2html © 2003