Home > core > printModel.m

printModel

PURPOSE ^

printModel

SYNOPSIS ^

function printModel(model,rxnList,outputString,outputFile,metaboliteList)

DESCRIPTION ^

 printModel
   Prints reactions to the screen or to a file

   model           a model structure
   rxnList         either a cell array of reaction IDs, a logical vector 
                   with the same number of elements as reactions in the model,
                   or a vector of indexes to remove (optional, default
                   model.rxns)
   outputString    a string that specifies the output of each reaction (optional,
                   default '%rxnID (%rxnName)\n\t%eqn [%lower %upper]\n')
   outputFile      a file to save the print-out to (optional, default is output to
                   the command window)
   metaboliteList  cell array of metabolite names. Only reactions
                   involving any of these metabolites will be 
                   printed (optional)

   The following codes are available for user-defined output strings:

   %rxnID      reaction ID
   %rxnName    reaction name
   %lower      lower bound
   %upper      upper bound
   %obj        objective coefficient
   %eqn        equation
   %element    equation using the metabolite formulas rather than
               metabolite names
   %unbalanced "(*)" if the reaction is unbalanced and "(-)" if it could not
               be parsed
   %lumped     equation where the elemental compositions for the left/right
               hand sides are lumped

   NOTE: This is just a wrapper function around printFluxes. It is
           intended to be used when there is no flux distribution.

 Usage: printModel(model,rxnList,outputString,outputFile,metaboliteList)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function printModel(model,rxnList,outputString,outputFile,metaboliteList)
0002 % printModel
0003 %   Prints reactions to the screen or to a file
0004 %
0005 %   model           a model structure
0006 %   rxnList         either a cell array of reaction IDs, a logical vector
0007 %                   with the same number of elements as reactions in the model,
0008 %                   or a vector of indexes to remove (optional, default
0009 %                   model.rxns)
0010 %   outputString    a string that specifies the output of each reaction (optional,
0011 %                   default '%rxnID (%rxnName)\n\t%eqn [%lower %upper]\n')
0012 %   outputFile      a file to save the print-out to (optional, default is output to
0013 %                   the command window)
0014 %   metaboliteList  cell array of metabolite names. Only reactions
0015 %                   involving any of these metabolites will be
0016 %                   printed (optional)
0017 %
0018 %   The following codes are available for user-defined output strings:
0019 %
0020 %   %rxnID      reaction ID
0021 %   %rxnName    reaction name
0022 %   %lower      lower bound
0023 %   %upper      upper bound
0024 %   %obj        objective coefficient
0025 %   %eqn        equation
0026 %   %element    equation using the metabolite formulas rather than
0027 %               metabolite names
0028 %   %unbalanced "(*)" if the reaction is unbalanced and "(-)" if it could not
0029 %               be parsed
0030 %   %lumped     equation where the elemental compositions for the left/right
0031 %               hand sides are lumped
0032 %
0033 %   NOTE: This is just a wrapper function around printFluxes. It is
0034 %           intended to be used when there is no flux distribution.
0035 %
0036 % Usage: printModel(model,rxnList,outputString,outputFile,metaboliteList)
0037 
0038 if nargin<2 || isempty(rxnList)
0039     rxnList=model.rxns;
0040 elseif ~islogical(rxnList) && ~isnumeric(rxnList)
0041     rxnList=convertCharArray(rxnList);
0042 end
0043 if nargin<3 || isempty(outputString)
0044     outputString='%rxnID (%rxnName)\n\t%eqn [%lower %upper]\n';
0045 else
0046     outputString=char(outputString);
0047 end
0048 if nargin<4
0049     outputFile=[];
0050 else
0051     outputFile=char(outputFile);
0052 end
0053 if nargin<5
0054     metaboliteList=[];
0055 else
0056     metaboliteList=convertCharArray(metaboliteList);
0057 end
0058 
0059 I=getIndexes(model,rxnList,'rxns',true)*1.00; %To convert it to "fluxes"
0060 
0061 if ~isempty(metaboliteList)
0062     printFluxes(model, I, false, 0.1, outputFile,outputString,metaboliteList);
0063 else
0064     printFluxes(model, I, false, 0.1, outputFile,outputString);
0065 end
0066 end

Generated by m2html © 2005