Skip to content

Commit 7f24765

Browse files
Merge pull request #398 from huerqiang/errormessage
update error message
2 parents d166b87 + 609e578 commit 7f24765

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: clusterProfiler
22
Type: Package
33
Title: A universal enrichment tool for interpreting omics data
4-
Version: 4.3.0.991
4+
Version: 4.3.0.992
55
Authors@R: c(
66
person(given = "Guangchuang", family = "Yu", email = "[email protected]", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0002-6485-8781")),
77
person(given = "Li-Gen", family = "Wang", email = "[email protected]", role = "ctb"),

NEWS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# clusterProfiler 4.3.0.991
1+
# clusterProfiler 4.3.0.992
22

3+
+ update error message of `download.KEGG.Path` and `download.KEGG.Module`(2021-11-21, Sun)
34
+ update `simplify` function to support `ont = ALL` (2021-10-27, Wed)
45

56
# clusterProfiler 4.2.0

R/enrichKEGG.R

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,14 @@ prepare_KEGG <- function(species, KEGG_Type="KEGG", keyType="kegg") {
157157

158158
download.KEGG.Path <- function(species) {
159159
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+
162168
keggpathid2extid.df[,1] %<>% gsub("[^:]+:", "", .)
163169
keggpathid2extid.df[,2] %<>% gsub("[^:]+:", "", .)
164170

@@ -179,7 +185,11 @@ download.KEGG.Path <- function(species) {
179185
download.KEGG.Module <- function(species) {
180186
keggmodule2extid.df <- kegg_link(species, "module")
181187
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)
183193
}
184194

185195
keggmodule2extid.df[,1] %<>% gsub("[^:]+:", "", .) %>% gsub(species, "", .) %>% gsub("^_", "", .)

0 commit comments

Comments
 (0)