@@ -157,8 +157,14 @@ prepare_KEGG <- function(species, KEGG_Type="KEGG", keyType="kegg") {
157
157
158
158
download.KEGG.Path <- function (species ) {
159
159
keggpathid2extid.df <- kegg_link(species , " pathway" )
160
- if (is.null(keggpathid2extid.df ))
161
- stop(" 'species' should be one of organisms listed in 'http://www.genome.jp/kegg/catalog/org_list.html'..." )
160
+ if (is.null(keggpathid2extid.df )) {
161
+ message <- paste(" Failed to download KEGG data." ,
162
+ " Wrong 'species' or the network is unreachable." ,
163
+ " The 'species' should be one of organisms listed in" ,
164
+ " 'http://www.genome.jp/kegg/catalog/org_list.html'" )
165
+ stop(message )
166
+ }
167
+
162
168
keggpathid2extid.df [,1 ] %<> % gsub(" [^:]+:" , " " , . )
163
169
keggpathid2extid.df [,2 ] %<> % gsub(" [^:]+:" , " " , . )
164
170
@@ -179,7 +185,11 @@ download.KEGG.Path <- function(species) {
179
185
download.KEGG.Module <- function (species ) {
180
186
keggmodule2extid.df <- kegg_link(species , " module" )
181
187
if (is.null(keggmodule2extid.df )) {
182
- stop(" 'species' should be one of organisms listed in 'http://www.genome.jp/kegg/catalog/org_list.html'..." )
188
+ message <- paste(" Failed to download KEGG data." ,
189
+ " Wrong 'species' or the network is unreachable." ,
190
+ " The 'species' should be one of organisms listed in" ,
191
+ " 'http://www.genome.jp/kegg/catalog/org_list.html'" )
192
+ stop(message )
183
193
}
184
194
185
195
keggmodule2extid.df [,1 ] %<> % gsub(" [^:]+:" , " " , . ) %> % gsub(species , " " , . ) %> % gsub(" ^_" , " " , . )
0 commit comments