Builds Directed Enzyme-Enzyme Networks considering Currency Metabolites and single nodes (without any edges) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% The function reads a Metabolic Network SBML file, and builds Directed Enzyme-Enzyme Networks. This file 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_dir_single_node(fileName) INPUTS fileName The metabolic Network in the SBML format OUTPUTS *_Enzyme_Cent_Dir_Single_Node_Cyt.sif Directed-Enzyme-Enzyme Network - Cytoscape Compatible (.sif file) Yazdan Asgari 07/16/2016 http://yazdan59.ir/scan %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function [Output] = enz_cent_dir_single_node(fileName) 0002 % Builds Directed Enzyme-Enzyme Networks considering Currency Metabolites and single nodes (without any edges) 0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0004 % The function reads a Metabolic Network SBML file, 0005 % and builds Directed Enzyme-Enzyme Networks. 0006 % This file 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_dir_single_node(fileName) 0011 % 0012 %INPUTS 0013 % fileName The metabolic Network in the SBML format 0014 % 0015 %OUTPUTS 0016 % *_Enzyme_Cent_Dir_Single_Node_Cyt.sif Directed-Enzyme-Enzyme Network - Cytoscape Compatible (.sif file) 0017 % 0018 % Yazdan Asgari 07/16/2016 http://yazdan59.ir/scan 0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0020 0021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0022 % check validity of input file format 0023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0024 check=regexp(fileName,'.xml'); 0025 assert(~isempty(check),'The SBML fileName must contain .xml at its end') 0026 0027 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0028 % start time evaluation of program 0029 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0030 tic; 0031 0032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0033 % reading the SBML file using COBRA Toolbox Command 0034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0035 model=readCbModel(fileName); 0036 [m,n]=size(model.S); 0037 0038 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0039 % building the output file name 0040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0041 outname=strrep(fileName,'.xml','_Enzyme_Cent_Dir_Single_Node_Cyt.sif') 0042 fout = fopen(outname, 'w+'); 0043 0044 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0045 % finds non-zero elements of the S-matrix (in order to make the algorithm faster), 0046 % parses through each row, and considers an edge for every unlike-signs. 0047 % It also consider Reversibility for Enzyme-Enzyme network. 0048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0049 num=zeros(size(model.rxns)); 0050 for j=1:m 0051 indices=find(model.S(j,:)); 0052 [a,b]=size(indices); 0053 r=0; 0054 if b~=0 0055 r=1; 0056 end 0057 while r<b 0058 i=1; 0059 while i<(b-r+1) 0060 if model.S(j,indices(1,r))>0 && model.S(j,indices(1,r+i))<0 0061 if model.rev(indices(r+i))==1 && model.rev(indices(r))==1 0062 fprintf(fout,'%s\t%s\t%s\n',model.rxns{indices(1,r)},'reaction-product',model.rxns{indices(1,r+i)}); 0063 fprintf(fout,'%s\t%s\t%s\n',model.rxns{indices(1,r+i)},'reaction-product',model.rxns{indices(1,r)}); 0064 num(1,indices(1,r))=1; 0065 num(1,indices(1,r+i))=1; 0066 else 0067 fprintf(fout,'%s\t%s\t%s\n',model.rxns{indices(1,r)},'reaction-product',model.rxns{indices(1,r+i)}); 0068 num(1,indices(1,r))=1; 0069 num(1,indices(1,r+i))=1; 0070 end 0071 elseif model.S(j,indices(1,r))<0 && model.S(j,indices(1,r+i))>0 0072 if model.rev(indices(r+i))==1 && model.rev(indices(r))==1 0073 fprintf(fout,'%s\t%s\t%s\n',model.rxns{indices(1,r+i)},'reaction-product',model.rxns{indices(1,r)}); 0074 fprintf(fout,'%s\t%s\t%s\n',model.rxns{indices(1,r)},'reaction-product',model.rxns{indices(1,r+i)}); 0075 num(1,indices(1,r))=1; 0076 num(1,indices(1,r+i))=1; 0077 else 0078 fprintf(fout,'%s\t%s\t%s\n',model.rxns{indices(1,r+i)},'reaction-product',model.rxns{indices(1,r)}); 0079 num(1,indices(1,r))=1; 0080 num(1,indices(1,r+i))=1; 0081 end 0082 end 0083 i=i+1; 0084 end 0085 r=r+1; 0086 end 0087 end 0088 0089 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0090 % considering nodes which do not contain any edges 0091 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0092 for k=1:n 0093 if num(1,k)==0 0094 fprintf(fout,'%s\n',model.rxns{k}); 0095 end 0096 end 0097 fclose(fout); 0098 0099 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0100 % End of time evaluation of program 0101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0102 toc;