Skip to content

Commit f7792fa

Browse files
committed
Check suggested packages for function tests
1 parent d040c23 commit f7792fa

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

DESCRIPTION

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Imports: RcppML,
2929
Suggests: knitr,
3030
rmarkdown,
3131
fgsea,
32-
dplyr,
3332
msigdbr
3433
VignetteBuilder: knitr
3534
URL: https://github.com/carmonalab/GeneNMF

R/main.R

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,9 @@ plotMetaPrograms <- function(mp.res,
429429

430430
#' Run Gene set enrichment analysis
431431
#'
432-
#' Utility function to run Gene set enrichment analysis (GSEA) against gene
433-
#' sets from MSigDB.
432+
#' Utility function to run Gene Set Enrichment Analysis (GSEA) against gene
433+
#' sets from MSigDB. Note: this is an optional function, which is conditional
434+
#' to the installation of suggested packages \code{fgsea} and \code{msigdbr}.
434435
#'
435436
#' @param genes A vector of genes
436437
#' @param universe Background universe of gene symbols (passed on to \code{fgsea::fora})
@@ -444,7 +445,13 @@ plotMetaPrograms <- function(mp.res,
444445
#' @examples
445446
#' data(sampleObj)
446447
#' geneset <- c("BANK1","CD22","CD79A","CD19","IGHD","IGHG3","IGHM")
447-
#' gsea_res <- runGSEA(geneset, universe=rownames(sampleObj), category = "C8")
448+
#' #test is conditional on availability of suggested packages
449+
#' if (requireNamespace("fgsea", quietly=TRUE) &
450+
#' requireNamespace("msigdbr", quietly=TRUE)) {
451+
#' gsea_res <- runGSEA(geneset,
452+
#' universe=rownames(sampleObj),
453+
#' category = "C8")
454+
#' }
448455
#'
449456
#' @export
450457
runGSEA <- function(genes, universe=NULL,

man/runGSEA.Rd

Lines changed: 10 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)