Home > . > enz_cent_dir.m

enz_cent_dir

PURPOSE ^

Builds Directed Enzyme-Enzyme Networks considering Currency Metabolites

SYNOPSIS ^

function [Output] = enz_cent_dir(fileName)

DESCRIPTION ^

 Builds Directed Enzyme-Enzyme Networks considering Currency Metabolites
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 The function reads a Metabolic Network SBML file,
 and builds Directed Enzyme-Enzyme Networks.
 Note: COBRA Toolbox must be installed in MATLAB before running this function
 Note: Currency metabolites have been considered for construction of this network. 

 [Output] = enz_cent_dir(fileName)

INPUTS
 fileName                     The metabolic Network in the SBML format
 
OUTPUTS
 *_Enzyme_Cent_Dir_Cyt.sif     Directed-Enzyme-Enzyme Network - Cytoscape Compatible (.sif file)
 
 Yazdan Asgari 12/07/2012   http://lbb.ut.ac.ir
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [Output] = enz_cent_dir(fileName)
0002 % Builds Directed Enzyme-Enzyme Networks considering Currency Metabolites
0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0004 % The function reads a Metabolic Network SBML file,
0005 % and builds Directed Enzyme-Enzyme Networks.
0006 % Note: COBRA Toolbox must be installed in MATLAB before running this function
0007 % Note: Currency metabolites have been considered for construction of this network.
0008 %
0009 % [Output] = enz_cent_dir(fileName)
0010 %
0011 %INPUTS
0012 % fileName                     The metabolic Network in the SBML format
0013 %
0014 %OUTPUTS
0015 % *_Enzyme_Cent_Dir_Cyt.sif     Directed-Enzyme-Enzyme Network - Cytoscape Compatible (.sif file)
0016 %
0017 % Yazdan Asgari 12/07/2012   http://lbb.ut.ac.ir
0018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0019 
0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0021 % check validity of input file format
0022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0023 check=regexp(fileName,'.xml');
0024 assert(~isempty(check),'The SBML fileName must contain .xml at its end')
0025 
0026 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0027 % start time evaluation of program
0028 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0029 tic;
0030 
0031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0032 % reading the SBML file using COBRA Toolbox Command
0033 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0034 model=readCbModel(fileName);
0035 [m,n]=size(model.S);
0036 
0037 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0038 % building the output file name
0039 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0040 outname=strrep(fileName,'.xml','_Enzyme_Cent_Dir_Cyt.sif')
0041 fout = fopen(outname, 'w+');
0042 
0043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0044 % finds non-zero elements of the S-matrix (in order to make the algorithm faster),
0045 % parses through each row, and considers an edge for every unlike-signs,
0046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0047 for j=1:m
0048     indices=find(model.S(j,:));
0049     [a,b]=size(indices);
0050     r=0;
0051     if b~=0
0052         r=1;
0053     end 
0054     while r<b
0055         i=1;
0056         while i<(b-r+1)
0057             if model.S(j,indices(1,r))<0 && model.S(j,indices(1,r+i))>0
0058                 fprintf(fout,'%s\t%s\t%s\n',model.rxns{indices(1,r)},'reaction-product',model.rxns{indices(1,r+i)});
0059             elseif model.S(j,indices(1,r))>0 && model.S(j,indices(1,r+i))<0
0060                 fprintf(fout,'%s\t%s\t%s\n',model.rxns{indices(1,r+i)},'reaction-product',model.rxns{indices(1,r)});
0061             end
0062             i=i+1;
0063         end
0064         r=r+1;
0065     end
0066 end
0067 fclose(fout);
0068 
0069 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0070 % End of time evaluation of program
0071 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0072 toc;

Generated on Thu 13-Dec-2012 14:17:37 by m2html © 2005