diff --git a/tests/testthat/test_updateSeqlevelsStyle.R b/tests/testthat/test_updateSeqlevelsStyle.R index 1b6a40d..613d18e 100644 --- a/tests/testthat/test_updateSeqlevelsStyle.R +++ b/tests/testthat/test_updateSeqlevelsStyle.R @@ -1,11 +1,13 @@ context("Test updateSeqlevelsStyle function") test_that("hg38, UCSC to NCBI", { - #if (!require("BiocManager", quietly = TRUE)) - # install.packages("BiocManager") - + if (!requireNamespace('BiocManager', quietly = TRUE)) { + install.packages('BiocManager') + BiocManager::install("remotes") + } + + BiocManager::install("BSgenome.Hsapiens.UCSC.hg38", ask=FALSE, update=FALSE) - #BiocManager::install("BSgenome.Hsapiens.UCSC.hg38") genome <- getBSgenome("hg38") bsgenome <- genome @@ -17,7 +19,12 @@ test_that("hg38, UCSC to NCBI", { }) test_that("hg38, NCBI to UCSC", { - #BiocManager::install("BSgenome.Hsapiens.NCBI.GRCh38") + if (!requireNamespace('BiocManager', quietly = TRUE)) { + install.packages('BiocManager') + } + + BiocManager::install("BSgenome.Hsapiens.NCBI.GRCh38", ask=FALSE, update=FALSE) + genome <- getBSgenome("GRCh38") bsgenome <- genome @@ -29,7 +36,11 @@ test_that("hg38, NCBI to UCSC", { }) test_that("hg19, NCBI to UCSC", { - BiocManager::install("BSgenome.Hsapiens.1000genomes.hs37d5") + if (!requireNamespace('BiocManager', quietly = TRUE)) { + install.packages('BiocManager') + } + + BiocManager::install("BSgenome.Hsapiens.1000genomes.hs37d5", ask=FALSE, update=FALSE) genome <- getBSgenome("hs37d5") bsgenome <- genome @@ -41,7 +52,10 @@ test_that("hg19, NCBI to UCSC", { }) test_that("hg19, UCSC to NCBI", { - BiocManager::install("BSgenome.Hsapiens.UCSC.hg19") + if (!requireNamespace('BiocManager', quietly = TRUE)) { + install.packages('BiocManager') + } + BiocManager::install("BSgenome.Hsapiens.UCSC.hg19", ask=FALSE, update=FALSE) genome <- getBSgenome("hg19") bsgenome <- genome