0001 function varargout = UpdateDBase(varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010 gui_Singleton = 1;
0011 gui_State = struct('gui_Name', mfilename, ...
0012 'gui_Singleton', gui_Singleton, ...
0013 'gui_OpeningFcn', @UpdateDBase_OpeningFcn, ...
0014 'gui_OutputFcn', @UpdateDBase_OutputFcn, ...
0015 'gui_LayoutFcn', [] , ...
0016 'gui_Callback', []);
0017 if nargin && ischar(varargin{1})
0018 gui_State.gui_Callback = str2func(varargin{1});
0019 end
0020
0021 if nargout
0022 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
0023 else
0024 gui_mainfcn(gui_State, varargin{:});
0025 end
0026
0027
0028
0029
0030 function UpdateDBase_OpeningFcn(hObject, eventdata, handles, varargin)
0031
0032
0033
0034
0035
0036
0037
0038 handles.output = hObject;
0039
0040
0041 guidata(hObject, handles);
0042
0043
0044
0045
0046
0047
0048 function varargout = UpdateDBase_OutputFcn(hObject, eventdata, handles)
0049
0050
0051
0052
0053
0054
0055 varargout{1} = handles.output;
0056
0057
0058
0059 function rxn2mappushbutton1_Callback(hObject, eventdata, handles)
0060
0061
0062
0063 TestLink='http://rest.kegg.jp';
0064 [~,Stat1]=urlread(TestLink);
0065 if ~Stat1
0066 msgbox({'This step requires a stable internet connection';...
0067 'Seemingly you are offline!'});
0068 return
0069 end
0070
0071 Text1 = 'Updating rxn2map.txt...';
0072 fprintf(Text1)
0073 Data=urlread('http://rest.kegg.jp/link/path/rn');
0074 Pth1 = which ('Bigg2Kegg.m');
0075 tind = find(Pth1=='\',1,'last');
0076 Pth = Pth1(1:tind-1);
0077 Pth1 = [Pth,'\','rxn2map.txt'];
0078 Idf = fopen(Pth1,'w');
0079 fprintf(Idf,Data);
0080 fclose(Idf);
0081 waitfor(msgbox('rxn2map.txt was successfully updated!','Update'))
0082 for i =1:numel(Text1)
0083 fprintf('\b')
0084 end
0085
0086 function map2cpdpushbutton_Callback(hObject, eventdata, handles)
0087
0088
0089
0090 TestLink='http://rest.kegg.jp';
0091 [~,Stat1]=urlread(TestLink);
0092 if ~Stat1
0093 msgbox({'This step requires a stable internet connection';...
0094 'Seemingly you are offline!'});
0095 return
0096 end
0097 Text1 = 'Updating map2cpd.txt...';
0098 fprintf(Text1)
0099 Data=urlread('http://rest.kegg.jp/link/cpd/path');
0100 Pth1 = which ('Bigg2Kegg.m');
0101 tind = find(Pth1=='\',1,'last');
0102 Pth = Pth1(1:tind-1);
0103 Pth1 = [Pth,'\','map2cpd.txt'];
0104 Idf = fopen(Pth1,'w');
0105 fprintf(Idf,Data);
0106 fclose(Idf);
0107 waitfor(msgbox('map2cpd.txt was successfully updated!','Update'))
0108 for i =1:numel(Text1)
0109 fprintf('\b')
0110 end
0111
0112
0113 function KEGGmapspushbutton_Callback(hObject, eventdata, handles)
0114
0115
0116
0117 TestLink='http://rest.kegg.jp';
0118 [~,Stat1]=urlread(TestLink);
0119 if ~Stat1
0120 msgbox({'This step requires a stable internet connection';...
0121 'Seemingly you are offline!'});
0122 return
0123 end
0124 Text1 = 'Updating KEGGmaps.txt...';
0125 fprintf(Text1)
0126 Data=urlread('http://rest.kegg.jp/list/pathway');
0127 Pth1 = which ('Bigg2Kegg.m');
0128 tind = find(Pth1=='\',1,'last');
0129 Pth = Pth1(1:tind-1);
0130 Pth1 = [Pth,'\','KEGGmaps.txt'];
0131 Idf = fopen(Pth1,'w');
0132 fprintf(Idf,Data);
0133 fclose(Idf);
0134 waitfor(msgbox('KEGGmaps.txt was successfully updated!','Update'))
0135 for i =1:numel(Text1)
0136 fprintf('\b')
0137 end
0138
0139
0140 function KEGGcpdpushbutton_Callback(hObject, eventdata, handles)
0141
0142
0143
0144 TestLink='http://rest.kegg.jp';
0145 [~,Stat1]=urlread(TestLink);
0146 if ~Stat1
0147 msgbox({'This step requires a stable internet connection';...
0148 'Seemingly you are offline!'});
0149 return
0150 end
0151 Text1 = 'Updating KEGGcpd.txt...';
0152 fprintf(Text1)
0153 Data=urlread('http://rest.kegg.jp/list/cpd');
0154 Pth1 = which ('Bigg2Kegg.m');
0155 tind = find(Pth1=='\',1,'last');
0156 Pth = Pth1(1:tind-1);
0157 Pth1 = [Pth,'\','KEGGcpd.txt'];
0158 Idf = fopen(Pth1,'w');
0159 fprintf(Idf,Data);
0160 fclose(Idf);
0161 waitfor(msgbox('KEGGcpd.txt was successfully updated!','Update'))
0162 for i =1:numel(Text1)
0163 fprintf('\b')
0164 end
0165
0166
0167 function ec2rxnpushbutton_Callback(hObject, eventdata, handles)
0168
0169
0170
0171 TestLink='http://rest.kegg.jp';
0172 [~,Stat1]=urlread(TestLink);
0173 if ~Stat1
0174 msgbox({'This step requires a stable internet connection';...
0175 'Seemingly you are offline!'});
0176 return
0177 end
0178 Text1 = 'Updating ec2rxn.txt...';
0179 fprintf(Text1)
0180 Data=urlread('http://rest.kegg.jp/link/rn/ec');
0181 Pth1 = which ('Bigg2Kegg.m');
0182 tind = find(Pth1=='\',1,'last');
0183 Pth = Pth1(1:tind-1);
0184 Pth1 = [Pth,'\','ec2rxn.txt'];
0185 Idf = fopen(Pth1,'w');
0186 fprintf(Idf,Data);
0187 fclose(Idf);
0188 waitfor(msgbox('ec2rxn.txt was successfully updated!','Update'))
0189 for i =1:numel(Text1)
0190 fprintf('\b')
0191 end
0192
0193
0194 function cpd2weightpushbutton_Callback(hObject, eventdata, handles)
0195
0196
0197
0198 TestLink='http://rest.kegg.jp';
0199 [~,Stat1]=urlread(TestLink);
0200 if ~Stat1
0201 msgbox({'This step requires a stable internet connection';...
0202 'Seemingly you are offline!'});
0203 return
0204 end
0205 Text1 = 'Updating cpd2weight.txt...';
0206 fprintf(Text1)
0207 Data=urlread('http://rest.kegg.jp/find/compound/1-9000/mol_weight');
0208 Pth1 = which ('Bigg2Kegg.m');
0209 tind = find(Pth1=='\',1,'last');
0210 Pth = Pth1(1:tind-1);
0211 Pth1 = [Pth,'\','cpd2weight.txt'];
0212 Idf = fopen(Pth1,'w');
0213 fprintf(Idf,Data);
0214 fclose(Idf);
0215 waitfor(msgbox('cpd2weight.txt was successfully updated!','Update'))
0216 for i =1:numel(Text1)
0217 fprintf('\b')
0218 end
0219
0220
0221 function cpd2rxnpushbutton_Callback(hObject, eventdata, handles)
0222
0223
0224
0225 TestLink='http://rest.kegg.jp';
0226 [~,Stat1]=urlread(TestLink);
0227 if ~Stat1
0228 msgbox({'This step requires a stable internet connection';...
0229 'Seemingly you are offline!'});
0230 return
0231 end
0232 Text1 = 'Updating cpd2rxn.txt...';
0233 fprintf(Text1)
0234 Data=urlread('http://rest.kegg.jp/link/rn/cpd');
0235 Pth1 = which ('Bigg2Kegg.m');
0236 tind = find(Pth1=='\',1,'last');
0237 Pth = Pth1(1:tind-1);
0238 Pth1 = [Pth,'\','cpd2rxn.txt'];
0239 Idf = fopen(Pth1,'w');
0240 fprintf(Idf,Data);
0241 fclose(Idf);
0242 waitfor(msgbox('cpd2rxn.txt was successfully updated!','Update'))
0243 for i =1:numel(Text1)
0244 fprintf('\b')
0245 end
0246
0247
0248
0249 function Donepushbutton8_Callback(hObject, eventdata, handles)
0250
0251
0252
0253 close(gcf)
0254
0255
0256
0257 function Weight4TransRxnspushbutton_Callback(hObject, eventdata, handles)
0258
0259
0260
0261 TestLink='http://rest.kegg.jp';
0262 [~,Stat1]=urlread(TestLink);
0263 if ~Stat1
0264 msgbox({'This step requires a stable internet connection';...
0265 'Seemingly you are offline!'});
0266 return
0267 end
0268 Text1 = 'Updating W4TranRxns2.txt and W4TranRxns4.txt...';
0269 fprintf(Text1)
0270 fprintf('\n')
0271 Weight4TransRxns(2)
0272 fprintf('\n')
0273 Weight4TransRxns(4)
0274 fprintf('\n')
0275 waitfor(msgbox('W4TranRxns2.txt and W4TranRxns4.txt was successfully updated!','Update'))
0276 for i =1:numel(Text1)
0277 fprintf('\b')
0278 end
0279 clc
0280
0281
0282 function getKGMLpushbutton_Callback(hObject, eventdata, handles)
0283
0284
0285
0286 TestLink='http://rest.kegg.jp';
0287 [~,Stat1]=urlread(TestLink);
0288 if ~Stat1
0289 msgbox({'This step requires a stable internet connection';...
0290 'Seemingly you are offline!'});
0291 return
0292 end
0293 Text1 = 'Updating KEGGmaps folder...';
0294 fprintf([Text1,'\n'])
0295 getKGML
0296 waitfor(msgbox('KEGGmaps folder was successfully updated!','Update'))
0297 for i =1:numel(Text1)
0298 fprintf('\b')
0299 end
0300
0301
0302 function MultiRxnpushbutton_Callback(hObject, eventdata, handles)
0303
0304
0305
0306 TestLink='http://rest.kegg.jp';
0307 [~,Stat1]=urlread(TestLink);
0308 if ~Stat1
0309 msgbox({'This step requires a stable internet connection';...
0310 'Seemingly you are offline!'});
0311 return
0312 end
0313 Text1 = 'Updating OfflineRxnData folder...';
0314 fprintf(Text1)
0315 GetData4MultiRxns
0316 waitfor(msgbox('OfflineRxnData folder was successfully updated!','Update'))
0317 for i =1:numel(Text1)
0318 fprintf('\b')
0319 end
0320 clc
0321
0322
0323 function Orgspushbutton_Callback(hObject, eventdata, handles)
0324
0325
0326
0327 TestLink='http://rest.kegg.jp';
0328 [~,Stat1]=urlread(TestLink);
0329 if ~Stat1
0330 msgbox({'This step requires a stable internet connection';...
0331 'Seemingly you are offline!'});
0332 return
0333 end
0334 Text1 = 'Updating orgs.txt...';
0335 fprintf(Text1)
0336 Data=urlread('http://rest.kegg.jp/list/organism');
0337 Pth1 = which ('Precons.m');
0338 tind = find(Pth1=='\',1,'last');
0339 Pth = Pth1(1:tind-1);
0340 Pth1 = [Pth,'\','orgs.txt'];
0341 Idf = fopen(Pth1,'w');
0342 fprintf(Idf,Data);
0343 fclose(Idf);
0344 waitfor(msgbox('orgs.txt was successfully updated!','Update'))
0345 for i =1:numel(Text1)
0346 fprintf('\b')
0347 end