outputHypergraph

PURPOSE ^

outputHypergraph Outputs a metabolic reaction network hypergraph with

SYNOPSIS ^

function outputHypergraph(model,weights,fileName)

DESCRIPTION ^

outputHypergraph Outputs a metabolic reaction network hypergraph with
weights in reactions

 outputHypergraph(model,weights,fileName)

INPUTS
 model         Standard model structure
 weights       Weights for each reaction
 fileName      Output filename

OUTPUT
 Output format: Rxn metabolite_1 metabolite_2 ... metabolite_n rxnWeight

 Markus Herrgard

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function outputHypergraph(model,weights,fileName)
0002 %outputHypergraph Outputs a metabolic reaction network hypergraph with
0003 %weights in reactions
0004 %
0005 % outputHypergraph(model,weights,fileName)
0006 %
0007 %INPUTS
0008 % model         Standard model structure
0009 % weights       Weights for each reaction
0010 % fileName      Output filename
0011 %
0012 %OUTPUT
0013 % Output format: Rxn metabolite_1 metabolite_2 ... metabolite_n rxnWeight
0014 %
0015 % Markus Herrgard
0016 
0017 fid = fopen(fileName,'w');
0018 
0019 for i = 1:length(model.rxns)
0020     metInd = find(model.S(:,i)~= 0);
0021     fprintf(fid,'%d ',i);
0022     for j = 1:length(metInd)
0023         fprintf(fid,'%d ',metInd(j));
0024     end
0025     fprintf(fid,'%6.4f ',weights(i));
0026     fprintf(fid,'\n');
0027 end
0028 
0029 fclose(fid);

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