$ $ R --vanilla CMD check --as-cran CopywriteR_2.24.0.tar.gz
* using log directory ‘/tmp/bioc/CopywriteR.Rcheck’
* using R version 4.1.0 (2021-05-18)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* using option ‘--as-cran’
* checking for file ‘CopywriteR/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘CopywriteR’ version ‘2.24.0’
* checking CRAN incoming feasibility ... NOTE
Maintainer: ‘Oscar Krijgsman <o.krijgsman@nki.nl>’
Package duplicated from https://bioconductor.org/packages/3.13/bioc
Unknown, possibly mis-spelled, fields in DESCRIPTION:
‘git_url’ ‘git_branch’ ‘git_last_commit’ ‘git_last_commit_date’
Uses the superseded package: ‘snow’
No package encoding and non-ASCII characters in the following R files:
R/CopywriteR.R
614: ## <e2><80><98>Map<e2><80><99> applies a function to the corresponding elements of given vectors.
The Title field should be in title case. Current version is:
‘Copy number information from targeted sequencing using off-target reads’
In title case that is:
‘Copy Number Information from Targeted Sequencing using Off-Target Reads’
The Description field should not start with the package name,
'This package' or similar.
The Date field is over a month old.
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking serialization versions ... OK
* checking whether package ‘CopywriteR’ can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking for future file timestamps ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking use of S3 registration ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
CopywriteR: no visible global function definition for ‘packageVersion’
CopywriteR: no visible global function definition for ‘getClass’
CopywriteR : DetectPeaks: no visible global function definition for
‘as’
CopywriteR : DetectPeaks: no visible global function definition for
‘write.table’
CopywriteR : CalculateDepthOfCoverage: no visible global function
definition for ‘read.table’
CopywriteR : CalculateDepthOfCoverage: no visible global function
definition for ‘as’
CopywriteR: no visible global function definition for ‘write.table’
CopywriteR: no visible global function definition for ‘pdf’
CopywriteR: no visible global function definition for ‘ecdf’
CopywriteR: no visible global function definition for ‘dev.off’
CopywriteR: no visible global function definition for ‘read.table’
plotCNA: no visible global function definition for ‘read.table’
plotCNA : <anonymous> : <anonymous>: no visible global function
definition for ‘pdf’
plotCNA : <anonymous> : <anonymous>: no visible global function
definition for ‘points’
plotCNA : <anonymous> : <anonymous> : <anonymous>: no visible global
function definition for ‘segments’
plotCNA : <anonymous> : <anonymous>: no visible global function
definition for ‘par’
plotCNA : <anonymous> : <anonymous>: no visible global function
definition for ‘text’
plotCNA : <anonymous> : <anonymous>: no visible global function
definition for ‘axis’
plotCNA : <anonymous> : <anonymous>: no visible global function
definition for ‘abline’
plotCNA : <anonymous> : <anonymous>: no visible global function
definition for ‘dev.off’
preCopywriteR: no visible global function definition for ‘as’
Undefined global functions or variables:
abline as axis dev.off dpois ecdf getClass lines loess packageVersion
par pdf png points ppois predict read.table rgb segments text
write.table
Consider adding
importFrom("grDevices", "dev.off", "pdf", "png", "rgb")
importFrom("graphics", "abline", "axis", "lines", "par", "points",
"segments", "text")
importFrom("methods", "as", "getClass")
importFrom("stats", "dpois", "ecdf", "loess", "ppois", "predict")
importFrom("utils", "packageVersion", "read.table", "write.table")
to your NAMESPACE file (and ensure that your DESCRIPTION Imports field
contains 'methods').
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... OK
* checking re-building of vignette outputs ...
WARNING
Error(s) in re-building vignettes:
--- re-building ‘CopywriteR.Rnw’ using Sweave
Loading required package: BiocParallel
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric, :
pseudoinverse used at 0.979
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric, :
neighborhood radius 0.001
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric, :
reciprocal condition number 0
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric, :
There are other near singularities as well. 1e-06
----------- FAILURE REPORT --------------
--- failure: length > 1 in coercion to logical ---
--- srcref ---
:
--- package (from environment) ---
CopywriteR
--- call from context ---
.tng(data.frame(count = data$cov[, i], gc = data$anno$gc, mappa = data$anno$mappa),
use = usepoints & data$cov[, i] != 0, correctmappa = TRUE,
plot = file.path(destination.folder, "qc", paste0(colnames(data$cov)[i],
".png")))
--- call from argument ---
!is.na(df$mappa) && !is.na(normv)
--- R stacktrace ---
where 1: .tng(data.frame(count = data$cov[, i], gc = data$anno$gc, mappa = data$anno$mappa),
use = usepoints & data$cov[, i] != 0, correctmappa = TRUE,
plot = file.path(destination.folder, "qc", paste0(colnames(data$cov)[i],
".png")))
where 2: FUN(...)
where 3: doTryCatch(return(expr), name, parentenv, handler)
where 4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 5: tryCatchList(expr, classes, parentenv, handlers)
where 6: tryCatch({
FUN(...)
}, error = handle_error)
where 7: withCallingHandlers({
tryCatch({
FUN(...)
}, error = handle_error)
}, warning = handle_warning)
where 8: FUN(...)
where 9: FUN(X[[i]], ...)
where 10: lapply(X, FUN_, ...)
where 11: bplapply(X, FUN, ..., BPREDO = BPREDO, BPPARAM = param)
where 12: bplapply(X, FUN, ..., BPREDO = BPREDO, BPPARAM = param)
where 13: bplapply(i, NormalizeDOC, data, .tng, usepoints, destination.folder,
BPPARAM = bp.param)
where 14: bplapply(i, NormalizeDOC, data, .tng, usepoints, destination.folder,
BPPARAM = bp.param)
where 15: doTryCatch(return(expr), name, parentenv, handler)
where 16: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 17: tryCatchList(expr, classes, parentenv, handlers)
where 18: tryCatch({
i <- c(seq_len(ncol(data$cov)))
NormalizeDOC <- function(i, data, .tng, usepoints, destination.folder) {
.tng(data.frame(count = data$cov[, i], gc = data$anno$gc,
mappa = data$anno$mappa), use = usepoints & data$cov[,
i] != 0, correctmappa = TRUE, plot = file.path(destination.folder,
"qc", paste0(colnames(data$cov)[i], ".png")))
}
ratios <- bplapply(i, NormalizeDOC, data, .tng, usepoints,
destination.folder, BPPARAM = bp.param)
log2.read.counts <- matrix(unlist(ratios), ncol = length(sample.indices))
}, error = function(e) {
stop(.wrap("The GC-content and mappability normalization did not work",
"due to a failure to calculate loesses. This can generally",
"be solved by using larger bin sizes. Stopping execution of",
"the remaining part of the script..."))
})
where 19: CopywriteR(sample.control = sample.control, destination.folder = file.path(data.folder),
reference.folder = file.path(data.folder, "mm10_4_20kb"),
bp.param = bp.param)
where 20: eval(expr, .GlobalEnv)
where 21: eval(expr, .GlobalEnv)
where 22: withVisible(eval(expr, .GlobalEnv))
where 23: doTryCatch(return(expr), name, parentenv, handler)
where 24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 25: tryCatchList(expr, classes, parentenv, handlers)
where 26: tryCatch(expr, error = function(e) {
call <- conditionCall(e)
if (!is.null(call)) {
if (identical(call[[1L]], quote(doTryCatch)))
call <- sys.call(-4L)
dcall <- deparse(call)[1L]
prefix <- paste("Error in", dcall, ": ")
LONG <- 75L
sm <- strsplit(conditionMessage(e), "\n")[[1L]]
w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
if (is.na(w))
w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
type = "b")
if (w > LONG)
prefix <- paste0(prefix, "\n ")
}
else prefix <- "Error : "
msg <- paste0(prefix, conditionMessage(e), "\n")
.Internal(seterrmessage(msg[1L]))
if (!silent && isTRUE(getOption("show.error.messages"))) {
cat(msg, file = outFile)
.Internal(printDeferredWarnings())
}
invisible(structure(msg, class = "try-error", condition = e))
})
where 27: try(withVisible(eval(expr, .GlobalEnv)), silent = TRUE)
where 28: evalFunc(ce, options)
where 29: tryCatchList(expr, classes, parentenv, handlers)
where 30: tryCatch(evalFunc(ce, options), finally = {
cat("\n")
sink()
})
where 31: driver$runcode(drobj, chunk, chunkopts)
where 32: utils::Sweave(...)
where 33: engine$weave(file, quiet = quiet, encoding = enc)
where 34: doTryCatch(return(expr), name, parentenv, handler)
where 35: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 36: tryCatchList(expr, classes, parentenv, handlers)
where 37: tryCatch({
engine$weave(file, quiet = quiet, encoding = enc)
setwd(startdir)
output <- find_vignette_product(name, by = "weave", engine = engine)
if (!have.makefile && vignette_is_tex(output)) {
texi2pdf(file = output, clean = FALSE, quiet = quiet)
output <- find_vignette_product(name, by = "texi2pdf",
engine = engine)
}
outputs <- c(outputs, output)
}, error = function(e) {
thisOK <<- FALSE
fails <<- c(fails, file)
message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",
file, conditionMessage(e)))
})
where 38: tools:::buildVignettes(dir = "/tmp/bioc/CopywriteR.Rcheck/vign_test/CopywriteR",
ser_elibs = "/scratch/henrik/RtmpHwwNKw/file312312259755.rds")
--- value of length: 7825 type: logical ---
[1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
[15] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
...
[7813] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
--- function from context ---
function (df, use, correctmappa = TRUE, plot = NULL, verbose = TRUE)
{
if (!is.logical(use) && length(use) == nrow(df))
stop("use should be logicval vector with same size as df")
if (!is.null(plot)) {
if (!is.logical(plot)) {
if (verbose)
cat("Plotting to file", plot, "\n")
png(plot, width = 700, height = 1400)
par(mfrow = c(2, 1))
on.exit(dev.off())
plot <- TRUE
}
else if (plot) {
par(mfrow = c(2, 1))
}
}
gcuse <- (use & !is.na(df$mappa) & df$mappa > 0.8 & !is.na(df$gc) &
df$gc > 0)
rough <- loess(count ~ gc, data = df, subset = gcuse, span = 0.03)
i <- seq(0, 1, by = 0.001)
final <- loess(predict(rough, i) ~ i, span = 0.3)
normv <- predict(final, df$gc)
df$countgcloess <- df$count/(normv/median(normv, na.rm = TRUE))
if (plot) {
plot(count ~ gc, data = df, subset = gcuse, ylim = quantile(df$count[gcuse],
c(1e-04, 0.999)), xlim = c(0, 1), pch = ".")
points(count ~ gc, data = df, subset = !gcuse, col = rgb(1,
0, 0, 0.3), pch = ".")
lines(i, predict(rough, i), col = "green")
points(df$gc, normv, col = "red", pch = ".")
}
if (correctmappa) {
mappause <- (use & !is.na(df$mappa))
rough <- loess(countgcloess ~ mappa, data = df, subset = mappause,
span = 0.03)
i <- seq(0, 1, by = 0.001)
final <- loess(predict(rough, i) ~ i, span = 0.3)
normv <- predict(final, df$mappa)
df$countgcmappaloess <- df$countgcloess/(normv/median(normv,
na.rm = TRUE))
if (plot) {
plot(countgcloess ~ mappa, data = df, subset = mappause,
ylim = quantile(df$countgcloess[mappause], c(1e-04,
0.999), na.rm = TRUE), xlim = c(0, 1), pch = ".")
points(countgcloess ~ mappa, data = df, subset = !mappause,
col = rgb(1, 0, 0, 0.3), pch = ".")
lines(i, predict(rough, i), col = "green")
subset.points <- !is.na(df$mappa) && !is.na(normv)
points(df$mappa[subset.points], normv[subset.points],
col = "red", pch = ".")
}
return(log2(df$countgcmappaloess/median(df$countgcmappaloess[use],
na.rm = TRUE)))
}
else {
log2(df$countgcloess/median(df$countgcloess[use], na.rm = TRUE))
}
}
<bytecode: 0x46f060f0>
<environment: namespace:CopywriteR>
--- function search by body ---
Function .tng in namespace CopywriteR has this body.
----------- END OF FAILURE REPORT --------------
Error: processing vignette 'CopywriteR.Rnw' failed with diagnostics:
chunk 10 (label = CopywriteR)
Error in value[[3L]](cond) :
The GC-content and mappability normalization did not work due to a
failure to calculate loesses. This can generally be solved by using
larger bin sizes. Stopping execution of the remaining part of the
script...
--- failed re-building ‘CopywriteR.Rnw’
SUMMARY: processing the following file failed:
‘CopywriteR.Rnw’
Error: Vignette re-building failed.
Execution halted
* checking PDF version of manual ... OK
* checking for non-standard things in the check directory ... OK
* checking for detritus in the temp directory ... OK
* DONE
Status: 1 WARNING, 2 NOTEs
See
‘/tmp/bioc/CopywriteR.Rcheck/00check.log’
for details.
which I assume you don't want.
Hi, there's a "length > 1 in coercion to logical" in the
.tng()function that is triggered when you plot, e.g. when running the vignette. To see it, you need to enable the extra checks for this, e.g. by setting_R_CHECK_LENGTH_1_LOGIC2_=trueor using--as-cran:Solution
The problem is in:
CopywriteR/R/private.R
Lines 120 to 122 in f64df3f
which shouldn't use
&&but&, i.e. it should use:When you use
&&without the extra checks, you're effectively using:which I assume you don't want.