Skip to content

Commit e8cf88c

Browse files
authored
move org.Hs.eg.db to Suggests (#236)
1 parent 3ffa27b commit e8cf88c

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: pathfindR
22
Type: Package
33
Title: Enrichment Analysis Utilizing Active Subnetworks
4-
Version: 2.6.0.9000
4+
Version: 2.6.0.9001
55
Authors@R: c(person("Ege", "Ulgen",
66
role = c("cre", "cph"),
77
email = "[email protected]",
@@ -40,7 +40,6 @@ Imports:
4040
doParallel,
4141
foreach,
4242
rmarkdown,
43-
org.Hs.eg.db,
4443
ggplot2,
4544
ggraph,
4645
ggupset,
@@ -55,8 +54,9 @@ Imports:
5554
Depends: R (>= 4.3.0),
5655
pathfindR.data (>= 2.0)
5756
Suggests:
57+
org.Hs.eg.db,
5858
testthat (>= 2.3.2),
5959
covr,
6060
mockery
61-
RoxygenNote: 7.3.2
61+
RoxygenNote: 7.3.3
6262
VignetteBuilder: knitr

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# pathfindR (development version)
2+
## Minor Changes and Bug Fixes
3+
- Moved org.Hs.eg.db from "Imports" to "Suggests" per new CRAN policy. Relevant functions revert to default behaviour if the required package is not installed.
24

35
# pathfindR 2.6.0
46

R/utility.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,18 @@ input_processing <- function(input, p_val_threshold = 0.05, pin_name_path = "Bio
347347
missing_symbols <- input$GENE[!base::toupper(input$GENE) %in% PIN_genes]
348348
non_missing_symbols <- input$GENE[base::toupper(input$GENE) %in% PIN_genes]
349349

350+
351+
if (convert2alias & !requireNamespace("org.Hs.eg.db", quietly = TRUE)) {
352+
message(
353+
"Package 'org.Hs.eg.db' is not installed; returning input genes unchanged.\n",
354+
"Install it with:\n",
355+
" if (!requireNamespace('BiocManager', quietly = TRUE)) install.packages('BiocManager')\n",
356+
" BiocManager::install('TxDb.Hsapiens.UCSC.hg19.knownGene')",
357+
)
358+
convert2alias <- False
359+
}
360+
361+
350362
if (convert2alias & length(missing_symbols) != 0) {
351363
## use SQL to get alias table and gene_info table (contains the
352364
## symbols) first open the database connection

R/visualization.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,17 @@ visualize_KEGG_diagram <- function(
258258
legend.position = "top"
259259
) {
260260
message("This function utilises one functionality of `ggkegg`. For more options, visit https://github.com/noriakis/ggkegg")
261+
262+
if (!requireNamespace("org.Hs.eg.db", quietly = TRUE)) {
263+
message(
264+
"Package 'org.Hs.eg.db' is not installed; returning empty list.\n",
265+
"Install it with:\n",
266+
" if (!requireNamespace('BiocManager', quietly = TRUE)) install.packages('BiocManager')\n",
267+
" BiocManager::install('TxDb.Hsapiens.UCSC.hg19.knownGene')",
268+
)
269+
return(list())
270+
}
271+
261272
############ Arg checks
262273

263274
### kegg_pw_ids

0 commit comments

Comments
 (0)