Home > . > enz_cent_dir_single_node.m

enz_cent_dir_single_node

PURPOSE ^

Builds Directed Enzyme-Enzyme Networks considering Currency Metabolites and single nodes (without any edges)

SYNOPSIS ^

function [Output] = enz_cent_dir_single_node(fileName)

DESCRIPTION ^

 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 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_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 12/07/2012             http://lbb.ut.ac.ir
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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0048 num=zeros(size(model.rxns));
0049 for j=1:m
0050     indices=find(model.S(j,:));
0051     [a,b]=size(indices);
0052     r=0;
0053     if b~=0
0054         r=1;
0055     end 
0056     while r<b
0057         i=1;
0058         while i<(b-r+1)
0059             if 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)},'reaction-product',model.rxns{indices(1,r+i)});
0061                 num(1,indices(1,r))=1;
0062                 num(1,indices(1,r+i))=1;
0063             elseif model.S(j,indices(1,r))>0 && model.S(j,indices(1,r+i))<0
0064                 fprintf(fout,'%s\t%s\t%s\n',model.rxns{indices(1,r+i)},'reaction-product',model.rxns{indices(1,r)});
0065                 num(1,indices(1,r))=1;
0066                 num(1,indices(1,r+i))=1;
0067             end
0068             i=i+1;
0069         end
0070         r=r+1;
0071     end
0072 end
0073 
0074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0075 % considering nodes which do not contain any edges
0076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0077 for k=1:n
0078     if num(1,k)==0
0079         fprintf(fout,'%s\n',model.rxns{k});
0080     end
0081 end
0082 fclose(fout);
0083 
0084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0085 % End of time evaluation of program
0086 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0087 toc;

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