Skip to content

Commit

Permalink
ROBUSTNESS: Assert future (>= 1.22.1) [#101]
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed Nov 25, 2021
1 parent 25903d5 commit dcef4cf
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 9 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
7 changes: 5 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 2 additions & 0 deletions R/binReadCounts.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions R/createBinAnnotations.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
2 changes: 2 additions & 0 deletions R/estimateCorrection.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 2 additions & 0 deletions R/segmentBins.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
16 changes: 16 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
}
12 changes: 6 additions & 6 deletions man/QDNAseq-package.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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}{
Expand Down

0 comments on commit dcef4cf

Please sign in to comment.