Home > . > enz_cent.m

enz_cent

PURPOSE ^

Builds Binary Stoichiometric Matrix and Enzyme-Enzyme Networks considering Currency Metabolites

SYNOPSIS ^

function [Output] = enz_cent(fileName)

DESCRIPTION ^

 Builds Binary Stoichiometric Matrix and Enzyme-Enzyme Networks considering Currency Metabolites
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 The function reads a Metabolic Network SBML file and builds Stoichiometric Matrix,
 Binary Stoichiometric Matrix, and 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(fileName)

INPUTS
 fileName                        The metabolic Network in the SBML format
 
OUTPUTS
 *_Stoich_Matrix.dat             Stoichiometric Matrix (comma separated Format)
 *_Binary_Stoich_Matrix.dat      Binary Stoichiometric Matrix (comma separated Format)
 *_Enzyme_Cent.dat               Undirected-Enzyme-Enzyme Network (comma separated Format)
 *_Enzyme_Cent_Cyt.dat           Undirected-Enzyme-Enzyme Network - Cytoscape Compatible
 
 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(fileName)
0002 % Builds Binary Stoichiometric Matrix and Enzyme-Enzyme Networks considering Currency Metabolites
0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0004 % The function reads a Metabolic Network SBML file and builds Stoichiometric Matrix,
0005 % Binary Stoichiometric Matrix, and 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(fileName)
0010 %
0011 %INPUTS
0012 % fileName                        The metabolic Network in the SBML format
0013 %
0014 %OUTPUTS
0015 % *_Stoich_Matrix.dat             Stoichiometric Matrix (comma separated Format)
0016 % *_Binary_Stoich_Matrix.dat      Binary Stoichiometric Matrix (comma separated Format)
0017 % *_Enzyme_Cent.dat               Undirected-Enzyme-Enzyme Network (comma separated Format)
0018 % *_Enzyme_Cent_Cyt.dat           Undirected-Enzyme-Enzyme Network - Cytoscape Compatible
0019 %
0020 % Yazdan Asgari 12/07/2012        http://lbb.ut.ac.ir
0021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0022 
0023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0024 % check validity of input file format
0025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0026 check=regexp(fileName,'.xml');
0027 assert(~isempty(check),'The SBML fileName must contain .xml at its end')
0028 
0029 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0030 % start time evaluation of program
0031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0032 tic;
0033 
0034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0035 % reading the SBML file using COBRA Toolbox Command
0036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0037 model=readCbModel(fileName);
0038 
0039 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0040 % construction of Stoichiometric Matrix (comma separated Format)
0041 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0042 outname1=strrep(fileName,'.xml','_Stoich_Matrix.dat')
0043 dlmwrite(outname1,full(model.S));
0044 
0045 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0046 % construction of Binary Stoichiometric Matrix (comma separated Format)
0047 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0048 S_bin=zeros(size(model.S));
0049 S_bin(find(model.S))=1;
0050 outname2=strrep(fileName,'.xml','_Binary_Stoich_Matrix.dat')
0051 dlmwrite(outname2,full(S_bin));
0052 
0053 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0054 % construction of Undirected-Enzyme-Enzyme Network (comma separated Format)
0055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0056 Aenz=S_bin'*S_bin;
0057 outname3=strrep(fileName,'.xml','_Enzyme_Cent.dat')
0058 dlmwrite(outname3,full(Aenz));
0059 
0060 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0061 % reading a Enzyme-Enzyme comma separated file and re-format it
0062 % to a Cytoscape-compatible file.
0063 % One could import the file using "File/Import/Network from Table(Text/MS Excel)..."
0064 % Select "first column" as "Source Interaction" and "second column" as "Target Interaction"
0065 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0066 ss = csvread(outname3);
0067 [g,h]=size(ss);
0068 outname4=strrep(fileName,'.xml','_Enzyme_Cent_Cyt.dat')
0069 fout = fopen(outname4, 'w+');
0070 for row=1:g
0071     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0072     % because cell(i,j)=cell(j,i) we must delete duplicate entries by putting
0073     % col=row:h in the second if command. since we must ignor diagonal elements,
0074     % the counter will be col=row+1:h
0075     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0076     for col=row+1:h
0077         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0078         % edge are those which includes number not equal to zero
0079         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0080         if ss(row,col)~=0
0081             fprintf(fout,'%s\t%s\t%d\n',model.rxns{row},model.rxns{col},ss(row,col));
0082         end
0083     end
0084 end
0085 fclose(fout);
0086 
0087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0088 % End of time evaluation of program
0089 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0090 toc;

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