Home > scan_toolbox > 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 07/16/2016   http://yazdan59.ir/scan
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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 07/16/2016   http://yazdan59.ir/scan
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 % It also consider Reversibility for Enzyme-Enzyme network.
0047 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0048 for j=1:m
0049     indices=find(model.S(j,:));
0050     [a,b]=size(indices);
0051     r=0;
0052     if b~=0
0053         r=1;
0054     end
0055     while r<b
0056         i=1;
0057         while i<(b-r+1)
0058             if model.S(j,indices(1,r))>0 && model.S(j,indices(1,r+i))<0
0059                 if model.rev(indices(r+i))==1 && model.rev(indices(r))==1
0060                     fprintf(fout,'%s\t%s\t%s\n',model.rxns{indices(1,r)},'reaction-product',model.rxns{indices(1,r+i)});
0061                     fprintf(fout,'%s\t%s\t%s\n',model.rxns{indices(1,r+i)},'reaction-product',model.rxns{indices(1,r)});
0062                 else
0063                     fprintf(fout,'%s\t%s\t%s\n',model.rxns{indices(1,r)},'reaction-product',model.rxns{indices(1,r+i)});
0064                 end
0065             elseif model.S(j,indices(1,r))<0 && model.S(j,indices(1,r+i))>0
0066                 if model.rev(indices(r+i))==1 && model.rev(indices(r))==1
0067                     fprintf(fout,'%s\t%s\t%s\n',model.rxns{indices(1,r+i)},'reaction-product',model.rxns{indices(1,r)});
0068                     fprintf(fout,'%s\t%s\t%s\n',model.rxns{indices(1,r)},'reaction-product',model.rxns{indices(1,r+i)});
0069                 else
0070                     fprintf(fout,'%s\t%s\t%s\n',model.rxns{indices(1,r+i)},'reaction-product',model.rxns{indices(1,r)});
0071                 end
0072             end
0073             i=i+1;
0074         end
0075         r=r+1;
0076     end
0077 end
0078 fclose(fout);
0079 
0080 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0081 % End of time evaluation of program
0082 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0083 toc;

Generated on Sat 16-Jul-2016 17:47:22 by m2html © 2003