Home > BiKEGG > GetData4MultiRxns.m

GetData4MultiRxns

PURPOSE ^

GetData4MultiRxns

SYNOPSIS ^

function GetData4MultiRxns

DESCRIPTION ^

 GetData4MultiRxns
 Gets offline data from KEGG database for each reaction in
 the KEGG for later use in MultiRxn function.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function GetData4MultiRxns
0002 % GetData4MultiRxns
0003 % Gets offline data from KEGG database for each reaction in
0004 % the KEGG for later use in MultiRxn function.
0005 
0006 % O. Jamialahmadi
0007 % TMU, Chem. Eng. Dept., Biotech. Group
0008 % Jan. 2016
0009 
0010 RawRns = urlread('http://rest.kegg.jp/list/rn');
0011 Rns = regexp(RawRns, 'R\d{5}', 'match'); % All KEGG rxns
0012 Pth1 = which ('Bigg2Kegg.m');
0013 tind = find(Pth1=='\',1,'last');
0014 Pth = Pth1(1:tind-1);
0015 Pth = fullfile(Pth,'OfflineRxnData');
0016 fprintf('\nDownloading rxn data (of %d): ',numel(Rns))
0017 for ct = 1:numel(Rns)
0018     if ct>1
0019         for j=0:log10(ct-1)
0020             fprintf('\b'); 
0021         end
0022     end
0023     fprintf('%d', ct);
0024     RnDat = urlread(['http://rest.kegg.jp/get/',Rns{ct}]);
0025     save([Pth,'\',Rns{ct},'.mat'],'RnDat')
0026     % In case of using txt file format
0027 %     Pth1 = [Pth,'\',Rns{ct},'.txt'];
0028 %     Idf = fopen(Pth1,'w');
0029 %     fprintf(Idf,RnDat);
0030 %     fclose(Idf);
0031 end
0032 DateCrt = date;
0033 save([Pth,'\','VersionDate.mat'],'DateCrt')
0034 fprintf('\n')
0035 disp('All reaction data has been downloaded and saved successfully!')

Generated on Sat 16-Jul-2016 20:21:30 by m2html © 2005