diff --git a/R/readCool.R b/R/readCool.R index 52560bb4..b5ed590f 100755 --- a/R/readCool.R +++ b/R/readCool.R @@ -498,7 +498,7 @@ readCoolChroms <- function(file, resolution = NULL){ #' ## .cool file #' coolFile <- file.path(tempdir(), "Rao2014-IMR90-MboI-allreps-filtered.1000kb.cool") #' download.file(url = "https://usgs2.osn.mghpcc.org/cooler01/examples/hg19/Rao2014-IMR90-MboI-allreps-filtered.1000kb.cool", -#' destfile = coolFile) +#' destfile = coolFile, mode = "wb") #' #' ## Read in region `chr2:10000000-22000000` at 1000Kb cool file resolution #' coolData <- readCool(file = coolFile, chrom = "chr2", chromstart = 10000000, @@ -508,7 +508,7 @@ readCoolChroms <- function(file, resolution = NULL){ #' ## .mcool file #' mcoolFile <- file.path(tempdir(), "LEUK_HEK_PJA27_inter_30.mcool") #' download.file(url = "https://zenodo.org/records/10906240/files/LEUK_HEK_PJA27_inter_30.mcool?download=1", -#' destfile = mcoolFile) +#' destfile = mcoolFile, mode = "wb") #' #' ## Read in region `chr2:1000000-5000000` at 100Kb resolution #' mcoolData_100Kb <- readCool(file = mcoolFile, chrom = "2", diff --git a/man/readCool.Rd b/man/readCool.Rd index 7e0a29df..e962a685 100644 --- a/man/readCool.Rd +++ b/man/readCool.Rd @@ -72,7 +72,7 @@ Read a .(m)cool file and return Hi-C data as a dataframe ## .cool file coolFile <- file.path(tempdir(), "Rao2014-IMR90-MboI-allreps-filtered.1000kb.cool") download.file(url = "https://usgs2.osn.mghpcc.org/cooler01/examples/hg19/Rao2014-IMR90-MboI-allreps-filtered.1000kb.cool", - destfile = coolFile) + destfile = coolFile, mode = "wb") ## Read in region `chr2:10000000-22000000` at 1000Kb cool file resolution coolData <- readCool(file = coolFile, chrom = "chr2", chromstart = 10000000, @@ -82,7 +82,7 @@ coolData <- readCool(file = coolFile, chrom = "chr2", chromstart = 10000000, ## .mcool file mcoolFile <- file.path(tempdir(), "LEUK_HEK_PJA27_inter_30.mcool") download.file(url = "https://zenodo.org/records/10906240/files/LEUK_HEK_PJA27_inter_30.mcool?download=1", - destfile = mcoolFile) + destfile = mcoolFile, mode = "wb") ## Read in region `chr2:1000000-5000000` at 100Kb resolution mcoolData_100Kb <- readCool(file = mcoolFile, chrom = "2", diff --git a/tests/testthat/test-readingFunctions.R b/tests/testthat/test-readingFunctions.R index 61890ee3..3e9dc013 100644 --- a/tests/testthat/test-readingFunctions.R +++ b/tests/testthat/test-readingFunctions.R @@ -85,7 +85,7 @@ test_that("readCool", { ## .cool file coolFile <- file.path(tempdir(), "Rao2014-IMR90-MboI-allreps-filtered.1000kb.cool") download.file(url = "https://usgs2.osn.mghpcc.org/cooler01/examples/hg19/Rao2014-IMR90-MboI-allreps-filtered.1000kb.cool", - destfile = coolFile) + destfile = coolFile, mode = "wb") on.exit(unlink(coolFile)) # File type @@ -113,7 +113,7 @@ test_that("readCool", { ## .mcool file mcoolFile <- file.path(tempdir(), "LEUK_HEK_PJA27_inter_30.mcool") download.file(url = "https://zenodo.org/records/10906240/files/LEUK_HEK_PJA27_inter_30.mcool?download=1", - destfile = mcoolFile) + destfile = mcoolFile, mode = "wb") on.exit(unlink(mcoolFile)) # File type