diff --git a/DESCRIPTION b/DESCRIPTION index 76a5df8..fb3d5b1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: QDNAseq -Version: 1.31.0-9000 +Version: 1.31.0-9001 Title: Quantitative DNA Sequencing for Chromosomal Aberrations Depends: R (>= 3.1.0) Imports: @@ -44,3 +44,4 @@ biocViews: CopyNumberVariation, DNASeq, Genetics, GenomeAnnotation, License: GPL URL: https://github.com/ccagc/QDNAseq BugReports: https://github.com/ccagc/QDNAseq/issues +RoxygenNote: 7.1.2 diff --git a/NEWS b/NEWS index 4729ce6..9d30dc0 100644 --- a/NEWS +++ b/NEWS @@ -1,9 +1,12 @@ Package: QDNAseq ---------------- -Version: 1.31.0-9000 [2021-10-27] +Version: 1.31.0-9001 [2021-11-25] - * ... +MISCELLANEOUS: + + * Now the package gives an informative error message when an outdated version + of the 'future' package is used. It requires future (>= 1.22.1). Version: 1.31.0 [2021-10-27] diff --git a/R/binReadCounts.R b/R/binReadCounts.R index 7fe8e5d..5cbc9d5 100644 --- a/R/binReadCounts.R +++ b/R/binReadCounts.R @@ -193,6 +193,8 @@ binReadCounts <- function(bins, bamfiles=NULL, path=NULL, ext='bam', isSecondaryAlignment, isNotPassingQualityControls, isDuplicate, minMapq, verbose=getOption("QDNAseq::verbose", TRUE)) { + assert_future_version() ## Until future.apply (>= 1.9.0) is on CRAN + binSize <- (bins$end[1L]-bins$start[1L]+1)/1000 bamfile <- normalizePath(bamfile) diff --git a/R/createBinAnnotations.R b/R/createBinAnnotations.R index ad97a90..2e37a04 100644 --- a/R/createBinAnnotations.R +++ b/R/createBinAnnotations.R @@ -65,6 +65,8 @@ createBins <- function(bsgenome, binSize, ignoreMitochondria=TRUE, excludeSeqnames=NULL, verbose=getOption("QDNAseq::verbose", TRUE)) { + assert_future_version() ## Until future.apply (>= 1.9.0) is on CRAN + oopts <- options("QDNAseq::verbose"=verbose) on.exit(options(oopts)) diff --git a/R/estimateCorrection.R b/R/estimateCorrection.R index 3cd68bc..76b784f 100644 --- a/R/estimateCorrection.R +++ b/R/estimateCorrection.R @@ -68,6 +68,8 @@ setMethod("estimateCorrection", signature=c(object="QDNAseqReadCounts"), adjustIncompletes=TRUE, maxIter=1, cutoff=4.0, variables=c("gc", "mappability"), ..., verbose=getOption("QDNAseq::verbose", TRUE)) { + + assert_future_version() ## Until future.apply (>= 1.9.0) is on CRAN oopts <- options("QDNAseq::verbose"=verbose) on.exit(options(oopts)) diff --git a/R/segmentBins.R b/R/segmentBins.R index 3e0a6c1..d7ed938 100644 --- a/R/segmentBins.R +++ b/R/segmentBins.R @@ -98,6 +98,8 @@ setMethod("segmentBins", signature=c(object="QDNAseqCopyNumbers"), transformFun="log2", segmentStatistic="seg.mean", storeSegmentObjects=FALSE, ..., verbose=getOption("QDNAseq::verbose", TRUE)) { + + assert_future_version() ## Until future.apply (>= 1.9.0) is on CRAN if ("seeds" %in% names(list(...))) { .Defunct("Argument 'seeds' (integer) is no longer supported and ignored.") diff --git a/R/utils.R b/R/utils.R index f87eb22..704c827 100644 --- a/R/utils.R +++ b/R/utils.R @@ -14,3 +14,19 @@ suppressVerbose <- function(expr, envir = parent.frame(), suppress = TRUE) { res <- eval(expr, envir=envir, enclos=baseenv()) if (res$visible) res$value else invisible(res$value) } + + +#' @importFrom utils packageVersion +future_version <- local({ + ver <- NULL + function() { + if (is.null(ver)) ver <<- packageVersion("future") + ver + } +}) + +assert_future_version <- function() { + if (future_version() >= "1.22.1") return() + stop(sprintf("This function requires future (>= 1.22.1). Please update: %s", + future_version())) +} diff --git a/man/QDNAseq-package.Rd b/man/QDNAseq-package.Rd index 2e56d92..57cab66 100644 --- a/man/QDNAseq-package.Rd +++ b/man/QDNAseq-package.Rd @@ -16,12 +16,12 @@ \description{ Quantitative DNA sequencing for chromosomal aberrations. - The genome is divided into non-overlapping fixed-sized bins, number of - sequence reads in each counted, adjusted with a simultaneous - two-dimensional loess correction for sequence mappability and GC - content, and filtered to remove spurious regions in the genome. - Downstream steps of segmentation and calling are also implemented via - packages DNAcopy and CGHcall, respectively. +The genome is divided into non-overlapping fixed-sized bins, number of +sequence reads in each counted, adjusted with a simultaneous +two-dimensional loess correction for sequence mappability and GC +content, and filtered to remove spurious regions in the genome. +Downstream steps of segmentation and calling are also implemented via +packages DNAcopy and CGHcall, respectively. } \section{Details}{