diff -Nru r-bioc-biocfilecache-1.10.0+dfsg/debian/changelog r-bioc-biocfilecache-1.10.2+dfsg/debian/changelog --- r-bioc-biocfilecache-1.10.0+dfsg/debian/changelog 2019-11-12 13:07:51.000000000 +0000 +++ r-bioc-biocfilecache-1.10.2+dfsg/debian/changelog 2019-11-13 06:46:15.000000000 +0000 @@ -1,3 +1,10 @@ +r-bioc-biocfilecache (1.10.2+dfsg-1) unstable; urgency=medium + + * Team upload. + * New upstream version + + -- Dylan Aïssi Wed, 13 Nov 2019 07:46:15 +0100 + r-bioc-biocfilecache (1.10.0+dfsg-1) unstable; urgency=medium * Team upload. diff -Nru r-bioc-biocfilecache-1.10.0+dfsg/DESCRIPTION r-bioc-biocfilecache-1.10.2+dfsg/DESCRIPTION --- r-bioc-biocfilecache-1.10.0+dfsg/DESCRIPTION 2019-10-30 02:30:03.000000000 +0000 +++ r-bioc-biocfilecache-1.10.2+dfsg/DESCRIPTION 2019-11-09 03:18:50.000000000 +0000 @@ -1,6 +1,6 @@ Package: BiocFileCache Title: Manage Files Across Sessions -Version: 1.10.0 +Version: 1.10.2 Authors@R: c(person("Lori", "Shepherd", email = "lori.shepherd@roswellpark.org", role = c("aut", "cre")), @@ -20,17 +20,17 @@ License: Artistic-2.0 Encoding: UTF-8 LazyData: true -RoxygenNote: 6.1.0 +RoxygenNote: 6.1.1 biocViews: DataImport VignetteBuilder: knitr Suggests: testthat, knitr, BiocStyle, rmarkdown, rtracklayer git_url: https://git.bioconductor.org/packages/BiocFileCache git_branch: RELEASE_3_10 -git_last_commit: 9d71be9 -git_last_commit_date: 2019-10-29 -Date/Publication: 2019-10-29 +git_last_commit: e6d2a47 +git_last_commit_date: 2019-11-08 +Date/Publication: 2019-11-08 NeedsCompilation: no -Packaged: 2019-10-30 02:30:03 UTC; biocbuild +Packaged: 2019-11-09 03:18:50 UTC; biocbuild Author: Lori Shepherd [aut, cre], Martin Morgan [aut] Maintainer: Lori Shepherd diff -Nru r-bioc-biocfilecache-1.10.0+dfsg/man/BiocFileCache-class.Rd r-bioc-biocfilecache-1.10.2+dfsg/man/BiocFileCache-class.Rd --- r-bioc-biocfilecache-1.10.0+dfsg/man/BiocFileCache-class.Rd 2019-10-29 20:35:38.000000000 +0000 +++ r-bioc-biocfilecache-1.10.2+dfsg/man/BiocFileCache-class.Rd 2019-11-08 21:52:51.000000000 +0000 @@ -39,7 +39,6 @@ \alias{bfcupdate} \alias{bfcmeta<-} \alias{bfcmeta<-,BiocFileCacheBase-method} -\alias{bfcmeta<-} \alias{bfcmetaremove,missing-method} \alias{bfcmetaremove,BiocFileCacheBase-method} \alias{bfcmetaremove} @@ -85,7 +84,8 @@ \alias{show,BiocFileCacheBase-method} \title{BiocFileCache class} \usage{ -BiocFileCache(cache = user_cache_dir(appname = "BiocFileCache"), ask = TRUE) +BiocFileCache(cache = user_cache_dir(appname = "BiocFileCache"), + ask = TRUE) \S4method{bfccache}{BiocFileCacheBase}(x) @@ -108,7 +108,8 @@ \S4method{[}{BiocFileCache,missing,missing}(x, i, j, ..., drop = TRUE) -\S4method{[}{BiocFileCacheReadOnly,missing,missing}(x, i, j, ..., drop = TRUE) +\S4method{[}{BiocFileCacheReadOnly,missing,missing}(x, i, j, ..., + drop = TRUE) \S4method{[[}{BiocFileCacheBase,character,missing}(x, i, j) @@ -118,18 +119,18 @@ \S4method{bfcnew}{missing}(x, rname, rtype = c("relative", "local"), ext = NA_character_) -\S4method{bfcnew}{BiocFileCache}(x, rname, rtype = c("relative", "local"), - ext = NA_character_) +\S4method{bfcnew}{BiocFileCache}(x, rname, rtype = c("relative", + "local"), ext = NA_character_) \S4method{bfcadd}{missing}(x, rname, fpath = rname, rtype = c("auto", "relative", "local", "web"), action = c("copy", "move", "asis"), - proxy = "", download = TRUE, config = list(), ext = NA_character_, - ...) + proxy = "", download = TRUE, config = list(), + ext = NA_character_, ...) -\S4method{bfcadd}{BiocFileCache}(x, rname, fpath = rname, rtype = c("auto", - "relative", "local", "web"), action = c("copy", "move", "asis"), - proxy = "", download = TRUE, config = list(), ext = NA_character_, - ...) +\S4method{bfcadd}{BiocFileCache}(x, rname, fpath = rname, + rtype = c("auto", "relative", "local", "web"), action = c("copy", + "move", "asis"), proxy = "", download = TRUE, config = list(), + ext = NA_character_, ...) \S4method{bfcinfo}{missing}(x, rids) @@ -143,12 +144,14 @@ \S4method{bfcrpath}{missing}(x, rnames, ..., rids, exact = TRUE) -\S4method{bfcrpath}{BiocFileCacheBase}(x, rnames, ..., rids, exact = TRUE) +\S4method{bfcrpath}{BiocFileCacheBase}(x, rnames, ..., rids, + exact = TRUE) \S4method{bfcupdate}{missing}(x, rids, value, ...) -\S4method{bfcupdate}{BiocFileCache}(x, rids, rname = NULL, rpath = NULL, - fpath = NULL, proxy = "", config = list(), ask = TRUE, ...) +\S4method{bfcupdate}{BiocFileCache}(x, rids, rname = NULL, + rpath = NULL, fpath = NULL, proxy = "", config = list(), + ask = TRUE, ...) bfcmeta(x, name, ...) <- value @@ -170,12 +173,12 @@ \S4method{bfcquerycols}{BiocFileCacheBase}(x) -\S4method{bfcquery}{missing}(x, query, field = c("rname", "rpath", "fpath"), - ..., exact = FALSE) - -\S4method{bfcquery}{BiocFileCacheBase}(x, query, field = c("rname", "rpath", +\S4method{bfcquery}{missing}(x, query, field = c("rname", "rpath", "fpath"), ..., exact = FALSE) +\S4method{bfcquery}{BiocFileCacheBase}(x, query, field = c("rname", + "rpath", "fpath"), ..., exact = FALSE) + \S4method{bfccount}{missing}(x) \S4method{bfccount}{BiocFileCacheBase}(x) @@ -189,8 +192,8 @@ \S4method{bfcdownload}{missing}(x, rid, proxy = "", config = list(), ask = TRUE, FUN, ...) -\S4method{bfcdownload}{BiocFileCache}(x, rid, proxy = "", config = list(), - ask = TRUE, FUN, ...) +\S4method{bfcdownload}{BiocFileCache}(x, rid, proxy = "", + config = list(), ask = TRUE, FUN, ...) \S4method{bfcremove}{missing}(x, rids) @@ -200,15 +203,16 @@ \S4method{bfcsync}{BiocFileCache}(x, verbose = TRUE, ask = TRUE) -\S4method{exportbfc}{missing}(x, rids, outputFile = "BiocFileCacheExport.tar", - outputMethod = c("tar", "zip"), verbose = TRUE, ...) +\S4method{exportbfc}{missing}(x, rids, + outputFile = "BiocFileCacheExport.tar", outputMethod = c("tar", + "zip"), verbose = TRUE, ...) \S4method{exportbfc}{BiocFileCacheBase}(x, rids, - outputFile = "BiocFileCacheExport.tar", outputMethod = c("tar", "zip"), - verbose = TRUE, ...) + outputFile = "BiocFileCacheExport.tar", outputMethod = c("tar", + "zip"), verbose = TRUE, ...) -\S4method{importbfc}{character}(filename, archiveMethod = c("untar", "unzip"), - exdir = ".", ...) +\S4method{importbfc}{character}(filename, archiveMethod = c("untar", + "unzip"), exdir = ".", ...) \S4method{cleanbfc}{missing}(x, days = 120, ask = TRUE) @@ -601,6 +605,7 @@ bfcremove(bfc0, rid3) bfcinfo(bfc0) bfcsync(bfc0) + if (!interactive()){ # in interactive mode, in the sync above # this was probably already removed diff -Nru r-bioc-biocfilecache-1.10.0+dfsg/man/makeBiocFileCacheFromDataFrame.Rd r-bioc-biocfilecache-1.10.2+dfsg/man/makeBiocFileCacheFromDataFrame.Rd --- r-bioc-biocfilecache-1.10.0+dfsg/man/makeBiocFileCacheFromDataFrame.Rd 2019-10-29 20:35:38.000000000 +0000 +++ r-bioc-biocfilecache-1.10.2+dfsg/man/makeBiocFileCacheFromDataFrame.Rd 2019-11-08 21:52:51.000000000 +0000 @@ -7,11 +7,12 @@ \title{Make BiocFileCache objects from an existing data.frame} \usage{ makeBiocFileCacheFromDataFrame(df, cache, actionLocal = c("move", "copy", - "asis"), actionWeb = c("move", "copy"), metadataName, ..., ask = TRUE) + "asis"), actionWeb = c("move", "copy"), metadataName, ..., + ask = TRUE) \S4method{makeBiocFileCacheFromDataFrame}{ANY}(df, cache, - actionLocal = c("move", "copy", "asis"), actionWeb = c("move", "copy"), - metadataName, ..., ask = TRUE) + actionLocal = c("move", "copy", "asis"), actionWeb = c("move", + "copy"), metadataName, ..., ask = TRUE) } \arguments{ \item{df}{data.frame or tibble to convert} diff -Nru r-bioc-biocfilecache-1.10.0+dfsg/man/makeCachedActiveBinding.Rd r-bioc-biocfilecache-1.10.2+dfsg/man/makeCachedActiveBinding.Rd --- r-bioc-biocfilecache-1.10.0+dfsg/man/makeCachedActiveBinding.Rd 1970-01-01 00:00:00.000000000 +0000 +++ r-bioc-biocfilecache-1.10.2+dfsg/man/makeCachedActiveBinding.Rd 2019-11-08 21:52:51.000000000 +0000 @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/makeCachedActiveBinding.R +\name{makeCachedActiveBinding} +\alias{makeCachedActiveBinding} +\title{makeCachedActiveBinding} +\usage{ +makeCachedActiveBinding(sym, fun, env = .GlobalEnv, verbose = FALSE) +} +\arguments{ +\item{sym}{See \code{\link[base]{makeActiveBinding}} in +the \pkg{base} package.} + +\item{fun}{See \code{\link[base]{makeActiveBinding}} in +the \pkg{base} package.} + +\item{env}{See \code{\link[base]{makeActiveBinding}} in +the \pkg{base} package.} + +\item{verbose}{Set to TRUE to see caching in action (useful for +troubleshooting).} +} +\description{ +Like \code{\link[base]{makeActiveBinding}} but the value of the active +binding gets only evaluated once and is "remembered". +} +\examples{ +makeCachedActiveBinding("x", function() runif(1), verbose=TRUE) +x +x +} diff -Nru r-bioc-biocfilecache-1.10.0+dfsg/NAMESPACE r-bioc-biocfilecache-1.10.2+dfsg/NAMESPACE --- r-bioc-biocfilecache-1.10.0+dfsg/NAMESPACE 2019-10-29 20:35:38.000000000 +0000 +++ r-bioc-biocfilecache-1.10.2+dfsg/NAMESPACE 2019-11-08 21:52:51.000000000 +0000 @@ -24,6 +24,7 @@ export(exportbfc) export(importbfc) export(makeBiocFileCacheFromDataFrame) +export(makeCachedActiveBinding) export(removebfc) exportMethods("[") exportMethods("[[") diff -Nru r-bioc-biocfilecache-1.10.0+dfsg/NEWS r-bioc-biocfilecache-1.10.2+dfsg/NEWS --- r-bioc-biocfilecache-1.10.0+dfsg/NEWS 2019-10-29 20:35:38.000000000 +0000 +++ r-bioc-biocfilecache-1.10.2+dfsg/NEWS 2019-11-08 21:52:51.000000000 +0000 @@ -1,3 +1,19 @@ +CHANGES IN VERSION 1.11 +---------------------- + +BUG FIX + + o (1.11.2) Fixes run of examples. Different result manual vs interactive so + have conditional that will allow complete example if run by user rather than + run automatically through the checks. + +NEW FEATURES + + o (1.11.1) Add makeCachedActiveBinding(). Allows data to be cached during + ActiveBinding call. Avoids callback function executing data retrieval + everytime. + + CHANGES IN VERSION 1.7 ---------------------- diff -Nru r-bioc-biocfilecache-1.10.0+dfsg/R/BiocFileCache-class.R r-bioc-biocfilecache-1.10.2+dfsg/R/BiocFileCache-class.R --- r-bioc-biocfilecache-1.10.0+dfsg/R/BiocFileCache-class.R 2019-10-29 20:35:38.000000000 +0000 +++ r-bioc-biocfilecache-1.10.2+dfsg/R/BiocFileCache-class.R 2019-11-08 21:52:51.000000000 +0000 @@ -1133,7 +1133,14 @@ #' descriptive messages will also be included. #' @examples #' bfcsync(bfc0) -#' bfcremove(bfc0, "BFC1") +#' +#' if (!interactive()){ +#' # in interactive mode, in the sync above +#' # this was probably already removed +#' # noninteractive mode does not remove resources +#' # so can remove manually here +#' bfcremove(bfc0, "BFC1") +#' } #' bfcsync(bfc0, FALSE) #' @aliases bfcsync #' @importFrom utils capture.output diff -Nru r-bioc-biocfilecache-1.10.0+dfsg/R/makeCachedActiveBinding.R r-bioc-biocfilecache-1.10.2+dfsg/R/makeCachedActiveBinding.R --- r-bioc-biocfilecache-1.10.0+dfsg/R/makeCachedActiveBinding.R 1970-01-01 00:00:00.000000000 +0000 +++ r-bioc-biocfilecache-1.10.2+dfsg/R/makeCachedActiveBinding.R 2019-11-08 21:52:51.000000000 +0000 @@ -0,0 +1,47 @@ +#' makeCachedActiveBinding +#' +#' Like \code{\link[base]{makeActiveBinding}} but the value of the active +#' binding gets only evaluated once and is "remembered". +#' +#' @param sym See \code{\link[base]{makeActiveBinding}} in +#' the \pkg{base} package. +#' @param fun See \code{\link[base]{makeActiveBinding}} in +#' the \pkg{base} package. +#' @param env See \code{\link[base]{makeActiveBinding}} in +#' the \pkg{base} package. +#' @param verbose Set to TRUE to see caching in action (useful for +#' troubleshooting). +#' +#' @name makeCachedActiveBinding +#' @aliases makeCachedActiveBinding +#' @export makeCachedActiveBinding +#' +#' @examples +#' makeCachedActiveBinding("x", function() runif(1), verbose=TRUE) +#' x +#' x +makeCachedActiveBinding <- function(sym, fun, env=.GlobalEnv, verbose=FALSE) +{ + caching_env <- new.env(parent=emptyenv()) + fun2 <- function(value) { + if (!missing(value)) + stop("assignment to active binding '", sym, "' is not allowed") + val <- try(get(sym, envir=caching_env, inherits=FALSE), silent=TRUE) + if (inherits(val, "try-error")) { + if (verbose) + cat("evaluating and caching value ", + "for active binding '", sym, "' ... ", sep="") + val <- fun() + assign(sym, val, envir=caching_env) + if (verbose) + cat("OK\n") + } else { + if (verbose) + cat("using cached value for active binding '", sym, "'\n", + sep="") + } + val + } + makeActiveBinding(sym, fun2, env=env) +} +