diff --git a/.github/workflows/bioc_branch.yml b/.github/workflows/bioc_branch.yml new file mode 100644 index 0000000..7febaef --- /dev/null +++ b/.github/workflows/bioc_branch.yml @@ -0,0 +1,4 @@ +name: Update Bioconductor package files + +on: + workflow_dispatch: \ No newline at end of file diff --git a/NAMESPACE b/NAMESPACE index 8014fa4..fc6b1a5 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -3,7 +3,6 @@ export(TF_syntax_to_R) export(add_rl_column) export(build_domino) -export(cache) export(circos_ligand_receptor) export(cor_heatmap) export(cor_scatter) diff --git a/R/utils.R b/R/utils.R index 7b9e3c4..762fa62 100644 --- a/R/utils.R +++ b/R/utils.R @@ -248,17 +248,6 @@ dom_network_items <- function(dom, clusters = NULL, return = NULL) { } } -#' Specify the cache -#' -#' @param path Path to tstore cache on -#' @return BiocFileCache -#' @export -cache <- function(path = tools::R_user_dir(package = "domino2")) { - bfc <- BiocFileCache::BiocFileCache(path, ask = FALSE) - - bfc -} - #' Convert python True/False syntax to TRUE/FALSE #' #' @param x character vector. If it consists of only "True" and "False" strings, the vector is converted to an R logical vector diff --git a/man/cache.Rd b/man/cache.Rd deleted file mode 100644 index 3318ad3..0000000 --- a/man/cache.Rd +++ /dev/null @@ -1,17 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils.R -\name{cache} -\alias{cache} -\title{Specify the cache} -\usage{ -cache(path = tools::R_user_dir(package = "domino2")) -} -\arguments{ -\item{path}{Path to tstore cache on} -} -\value{ -BiocFileCache -} -\description{ -Specify the cache -} diff --git a/tests/testthat/test-cache.r b/tests/testthat/test-cache.r index cde628c..3d37139 100644 --- a/tests/testthat/test-cache.r +++ b/tests/testthat/test-cache.r @@ -1,8 +1,14 @@ test_that("can add to a new cache", { - tf <- tempfile(tmpdir = tempdir(check = TRUE)) - file.create(tf) - bfc <- cache(path = tempdir()) + bfc <- BiocFileCache::BiocFileCache(tempdir(), ask = FALSE) expect_equal(length(bfc), 0) - BiocFileCache::cleanbfc(bfc, ask = FALSE) + + #from Bioc example + savepath <- BiocFileCache::bfcnew(bfc, "NewResource", ext = ".RData") + df <- data.frame(list("a"=c(1, 2), "b"=c(3, 4))) + save(df, file = savepath) + + expect_equal(length(bfc), 1) + + #cleanup BiocFileCache::removebfc(bfc, ask = FALSE) }) diff --git a/vignettes/domino2.Rmd b/vignettes/domino2.Rmd index 78b111d..2895573 100644 --- a/vignettes/domino2.Rmd +++ b/vignettes/domino2.Rmd @@ -32,7 +32,7 @@ set.seed(123) ``` ``` {r files, include=FALSE} -bfc <- cache() +bfc <- BiocFileCache::BiocFileCache(ask = FALSE) data_url <- "https://zenodo.org/records/10222767/files" diff --git a/vignettes/domino_object_vignette.Rmd b/vignettes/domino_object_vignette.Rmd index 251af9a..59f1c48 100644 --- a/vignettes/domino_object_vignette.Rmd +++ b/vignettes/domino_object_vignette.Rmd @@ -25,7 +25,7 @@ library(domino2) ``` ```{r setup, include = FALSE} -bfc <- cache() +bfc <- BiocFileCache::BiocFileCache(ask = FALSE) data_url <- "https://zenodo.org/records/10222767/files/pbmc_domino_built.rds" tmp_path <- BiocFileCache::bfcrpath(bfc, data_url) dom <- readRDS(tmp_path) diff --git a/vignettes/plotting_vignette.Rmd b/vignettes/plotting_vignette.Rmd index 6abd264..5785642 100644 --- a/vignettes/plotting_vignette.Rmd +++ b/vignettes/plotting_vignette.Rmd @@ -29,7 +29,7 @@ library(patchwork) In addition to the numerous plotting options available in the original [Domino](https://github.com/Elisseeff-Lab/domino), domino2 has added more functionality and new methods to improve visualization and interpretation of analysis results. Here, we will go over the different plotting functions available, as well as different options that can be utilized, and options for customization. We will be using the domino object (loaded as `dom`) from our example analysis in [Getting Started](vignette("domino2")). ```{r load data, include = FALSE} -bfc <- cache() +bfc <- BiocFileCache::BiocFileCache(ask = FALSE) data_url <- "https://zenodo.org/records/10222767/files/pbmc_domino_built.rds" tmp_path <- BiocFileCache::bfcrpath(bfc, data_url) dom <- readRDS(tmp_path)