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