checkObjective

PURPOSE ^

checkObjective print out the Stoichiometric Coefficients for each

SYNOPSIS ^

function objectiveAbbr=checkObjective(model)

DESCRIPTION ^

checkObjective print out the Stoichiometric Coefficients for each 
Metabolite, with the name of the objective

 objectiveAbbr = checkObjective(model)

INPUT
 model             COBRA model structure

OUTPUT
 objectiveAbbr     Objective reaction abbreviation

 Ronan Fleming 22/10/2008

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function objectiveAbbr=checkObjective(model)
0002 %checkObjective print out the Stoichiometric Coefficients for each
0003 %Metabolite, with the name of the objective
0004 %
0005 % objectiveAbbr = checkObjective(model)
0006 %
0007 %INPUT
0008 % model             COBRA model structure
0009 %
0010 %OUTPUT
0011 % objectiveAbbr     Objective reaction abbreviation
0012 %
0013 % Ronan Fleming 22/10/2008
0014 
0015 objRxnInd=find(model.c~=0);
0016 objectiveAbbr=model.rxns{objRxnInd};
0017 if isempty(objRxnInd)
0018     warning('There is no objective!')
0019 else
0020     fprintf('%s\t%s\t%s\t%s\t\t\t%s\n','Coefficient','Metabolite','#','Reaction','#')
0021     for n=1:length(objRxnInd)
0022         objMetInd=find(model.S(:,objRxnInd(n)));
0023         for m=1:length(objMetInd)
0024             Sij=model.S(objMetInd(m),objRxnInd(n));
0025             if length(model.mets{objMetInd(m)})<4
0026                 fprintf('%6.4g\t\t%s\t\t\t%i\t%s\t%i\n',Sij,model.mets{objMetInd(m)},objMetInd(m),model.rxns{objRxnInd(n)},objRxnInd(n))
0027             else
0028                 if length(model.mets{objMetInd(m)})<8
0029                     fprintf('%6.4g\t\t%s\t\t%i\t%s\t%i\n',Sij,model.mets{objMetInd(m)},objMetInd(m),model.rxns{objRxnInd(n)},objRxnInd(n))
0030                 else
0031                     if length(model.mets{objMetInd(m)})<12
0032                         fprintf('%6.4g\t\t%s\t%i\t%s\t%i\n',Sij,model.mets{objMetInd(m)},objMetInd(m),model.rxns{objRxnInd(n)},objRxnInd(n))
0033                     end
0034                 end
0035             end
0036         end
0037     end
0038 end
0039

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