reverseRxns Reverses reactions model the model to change (input/output) rxns the rxns to reverse
0001 function model=reverseRxns(model, rxns) 0002 % reverseRxns 0003 % Reverses reactions 0004 % model the model to change (input/output) 0005 % rxns the rxns to reverse 0006 0007 rxnInd = find(ismember(model.rxns,rxns)); 0008 0009 %reverse the reactions 0010 model.S(:,rxnInd) = model.S(:,rxnInd)*-1; 0011 %swap the bounds 0012 ub = model.ub(rxnInd); 0013 model.ub(rxnInd) = -model.lb(rxnInd); 0014 model.lb(rxnInd) = -ub; 0015 %flip the objective 0016 model.c(rxnInd) = -model.c(rxnInd); 0017 0018 end