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 (opt, default model.rxns) outputString a string that specifies the output of each reaction (opt, default '%rxnID (%rxnName)\n\t%eqn [%lower %upper]\n') outputFile a file to save the print-out to (opt, default is output to the command window) metaboliteList cell array of metabolite names. Only reactions involving any of these metabolites will be printed (opt) 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) Rasmus Agren, 2013-02-20
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 (opt, default 0009 % model.rxns) 0010 % outputString a string that specifies the output of each reaction (opt, 0011 % default '%rxnID (%rxnName)\n\t%eqn [%lower %upper]\n') 0012 % outputFile a file to save the print-out to (opt, 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 (opt) 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 % Rasmus Agren, 2013-02-20 0039 % 0040 0041 if nargin<2 0042 rxnList=model.rxns; 0043 end 0044 if isempty(rxnList) 0045 rxnList=model.rxns; 0046 end 0047 if nargin<3 0048 outputString='%rxnID (%rxnName)\n\t%eqn [%lower %upper]\n'; 0049 end 0050 if isempty(outputString) 0051 outputString='%rxnID (%rxnName)\n\t%eqn [%lower %upper]\n'; 0052 end 0053 if nargin<4 0054 outputFile=[]; 0055 end 0056 if nargin<5 0057 metaboliteList=[]; 0058 end 0059 0060 I=getIndexes(model,rxnList,'rxns',true)*1.00; %To convert it to "fluxes" 0061 0062 if ~isempty(metaboliteList) 0063 printFluxes(model, I, false, 0.1, outputFile,outputString,metaboliteList); 0064 else 0065 printFluxes(model, I, false, 0.1, outputFile,outputString); 0066 end