This page was generated on 2020-10-17 11:54:59 -0400 (Sat, 17 Oct 2020).
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.11-bioc/R/bin/R CMD check --install=check:IPPD.install-out.txt --library=/home/biocbuild/bbs-3.11-bioc/R/library --no-vignettes --timings IPPD_1.36.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.11-bioc/meat/IPPD.Rcheck’
* using R version 4.0.3 (2020-10-10)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘IPPD/DESCRIPTION’ ... OK
* this is package ‘IPPD’ version ‘1.36.0’
* 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 hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘IPPD’ can be installed ... WARNING
Found the following significant warnings:
Warning: Package 'IPPD' is deprecated and will be removed from Bioconductor
See ‘/home/biocbuild/bbs-3.11-bioc/meat/IPPD.Rcheck/00install.out’ for details.
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... NOTE
Non-standard license specification:
GPL (version 2 or later)
Standardizable: TRUE
Standardized license specification:
GPL (>= 2)
* 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 dependencies in R code ... NOTE
'library' or 'require' calls to packages already attached by Depends:
‘MASS’ ‘Matrix’ ‘bitops’
Please remove these calls from your code.
Package in Depends field not imported from: ‘bitops’
These packages need to be imported from (in the NAMESPACE file)
for when this namespace is loaded but not attached.
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... NOTE
analyzeLCMS: no visible global function definition for ‘read.table’
base64decode: no visible global function definition for ‘bitOr’
base64decode: no visible global function definition for ‘bitShiftL’
base64decode: no visible global function definition for ‘bitShiftR’
base64decode: no visible global function definition for ‘bitAnd’
getPeaklist,numeric-numeric: no visible global function definition for
‘data’
getPeaklist,numeric-numeric: no visible binding for global variable
‘tableaveragine’
threshold,peaklist: no visible binding for global variable ‘peaklist’
visualize,modelfit-missing-missing: no visible global function
definition for ‘lines’
visualize,modelfit-missing-missing: no visible global function
definition for ‘par’
visualize,peaklist-numeric-numeric: no visible global function
definition for ‘layout’
visualize,peaklist-numeric-numeric: no visible global function
definition for ‘lines’
visualize,peaklist-numeric-numeric: no visible global function
definition for ‘matlines’
Undefined global functions or variables:
bitAnd bitOr bitShiftL bitShiftR data layout lines matlines par
peaklist read.table tableaveragine
Consider adding
importFrom("graphics", "layout", "lines", "matlines", "par")
importFrom("utils", "data", "read.table")
to your NAMESPACE file.
* checking Rd files ... NOTE
prepare_Rd: analyzeLCMS.Rd:50: Dropping empty section \examples
prepare_Rd: read.mzXML.Rd:21: Dropping empty section \examples
prepare_Rd: sweepline.Rd:40: Dropping empty section \examples
* checking Rd metadata ... 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 contents of ‘data’ directory ... OK
* checking data for non-ASCII characters ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking files in ‘vignettes’ ... OK
* checking examples ... ERROR
Running examples in ‘IPPD-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: fitModelParameters
> ### Title: Peak parameter estimation
> ### Aliases: fitModelParameters,numeric,numeric-method fitModelParameters
> ### fitModelParameters-methods
> ### Keywords: models
>
> ### ** Examples
>
> ### load data
> data(toyspectrum)
> ### estimate parameter sigma of a Gaussian model,
> ### assumed to be independent of m/z
>
> simplegauss <- fitModelParameters(toyspectrum[,1],
+ toyspectrum[,2],
+ model = "Gaussian",
+ fitting = c("model"),
+ formula.sigma = formula(~1),
+ control = list(window = 6, threshold = 1))
>
> show(simplegauss)
Peak model 'Gaussian' fitted as fuction of m/z
number of peaks used: 13
> visualize(simplegauss, type = "peak", xlab = "m/z", ylab = "intensity",
+ main = "Gaussian fit")
>
> ### fit the model sigma(m/z) = beta_0 + beta_1 m/z + beta_2 m/z^2
>
> gaussquadratic <- fitModelParameters(toyspectrum[,1],
+ toyspectrum[,2],
+ model = "Gaussian",
+ fitting = "model",
+ formula.sigma = formula(~mz + I(mz^2) ),
+ control = list(window = 6, threshold = 1))
Warning in rlm.default(x, y, weights, method = method, wt.method = wt.method, :
'rlm' failed to converge in 20 steps
>
> show(gaussquadratic)
Peak model 'Gaussian' fitted as fuction of m/z
number of peaks used: 13
> visualize(gaussquadratic, type = "model", modelfit = TRUE)
>
> ### estimate parameters for EMG-shaped peaks
>
> EMGlinear <- fitModelParameters(toyspectrum[,1],
+ toyspectrum[,2],
+ model = "EMG",
+ fitting = "model",
+ formula.alpha = formula(~mz),
+ formula.sigma = formula(~mz),
+ formula.mu = formula(~1),
+ control = list(window = 6, threshold = 1))
----------- FAILURE REPORT --------------
--- failure: length > 1 in coercion to logical ---
--- srcref ---
:
--- package (from environment) ---
IPPD
--- call from context ---
fitModelParameters(toyspectrum[, 1], toyspectrum[, 2], model = "EMG",
fitting = "model", formula.alpha = formula(~mz), formula.sigma = formula(~mz),
formula.mu = formula(~1), control = list(window = 6, threshold = 1))
--- call from argument ---
length(unique(varnames)) > 0 && varnames != "mz"
--- R stacktrace ---
where 1: fitModelParameters(toyspectrum[, 1], toyspectrum[, 2], model = "EMG",
fitting = "model", formula.alpha = formula(~mz), formula.sigma = formula(~mz),
formula.mu = formula(~1), control = list(window = 6, threshold = 1))
where 2: fitModelParameters(toyspectrum[, 1], toyspectrum[, 2], model = "EMG",
fitting = "model", formula.alpha = formula(~mz), formula.sigma = formula(~mz),
formula.mu = formula(~1), control = list(window = 6, threshold = 1))
--- value of length: 2 type: logical ---
[1] FALSE FALSE
--- function from context ---
Method Definition:
function (mz, intensities, model = c("Gaussian", "EMG"), fitting = c("most_intense",
"model"), formula.alpha = formula(~1), formula.sigma = formula(~1),
formula.mu = formula(~1), control = list(window = 6, threshold = NULL,
rlm.maxit = 20))
{
x <- mz
if (any(is.na(x)))
stop("'mz' contains missing values \n")
y <- intensities
if (any(is.na(y)))
stop("'intensities' contains missing values \n")
n <- length(x)
if (length(y) != n)
stop("Length of 'mz' and length of 'intensities differ \n")
if (any(y < 0))
stop("'y' must be nonnegative \n")
model <- match.arg(model)
if (!is.element(model, c("Gaussian", "EMG")))
stop("'model' must be one of 'Gaussian' or 'EMG' \n")
window <- control$window
if (is.null(window)) {
window <- 6
}
if (window <= 0 | !(as.integer(window) == window))
stop("Control parameter 'window' has to be positive \n")
threshold <- control$threshold
if (is.null(threshold)) {
warning("'control$threshold' not specifed; set to 'max(intensities) - 1e-05' \n")
threshold <- max(y) - 1e-05
}
if (threshold < 0)
stop("Control parameter 'threshold' has to be nonnegative \n")
rlm.maxit <- control$rlm.maxit
if (is.null(rlm.maxit))
rlm.maxit <- 20
if (rlm.maxit <= 0 | !(as.integer(rlm.maxit) == rlm.maxit))
stop("Control parameter 'rlm.maxit' has to be positive \n")
fitting <- match.arg(fitting)
if (!is.element(fitting, c("most_intense", "model")))
stop("'fitting' must be one of 'most_intense' or 'model' \n")
if (fitting == "most_intense") {
if (any(formula.alpha != formula(~1), formula.sigma !=
formula(~1), formula.mu != formula(~1))) {
warning("'fitting = 'most intense'', but non-default values for one of the formulae used. In the case a model should be fitted, set 'fitting = 'model'' \n")
}
detection <- simplepeakdetect(cbind(x, y), window = window,
threshold = threshold)
if (nrow(detection) < 2 * window) {
stop("No peak of the chosen width ('window') found. Try to reduce 'window' \n")
}
else {
if (model == "Gaussian") {
fitt <- try(fit.gauss(detection[, 1], detection[,
2]), silent = TRUE)
if (inherits(fitt, "try-error")) {
stop("Fitting failed. \n")
}
sigma <- fitt$sigma
sigmafunction <- function(mz) {
}
body(sigmafunction) <- eval(substitute(expression(rep(sigmavar,
length(mz))), list(sigmavar = sigma)))
bestpeak <- list(mz = detection[, 1], intensities = detection[,
2], sigma = fitt$sigma, mu = fitt$mu)
peakfitresults <- matrix(nrow = 1, ncol = 4,
data = c(nrow(detection), fitt$rss, fitt$sigma,
fitt$mu), byrow = TRUE)
colnames(peakfitresults) <- c("datapoints", "rss",
"sigma", "mz")
}
if (model == "EMG") {
fitt <- try(fit.EMG(detection[, 1], detection[,
2], gridsearch = TRUE), silent = TRUE)
if (inherits(fitt, "try-error")) {
stop("Fitting failed. \n")
}
alpha <- fitt$alpha
sigma <- fitt$sigma
mu <- fitt$mu
alphafunction <- function(mz) {
}
sigmafunction <- function(mz) {
}
mufunction <- function(mz) {
}
body(alphafunction) <- eval(substitute(expression(rep(alphavar,
length(mz))), list(alphavar = alpha)))
body(sigmafunction) <- eval(substitute(expression(rep(sigmavar,
length(mz))), list(sigmavar = sigma)))
body(mufunction) <- eval(substitute(expression(rep(muvar,
length(mz))), list(muvar = mu)))
bestpeak <- list(mz = detection[, 1], intensities = detection[,
2], alpha = fitt$alpha, sigma = fitt$sigma,
mu = fitt$mu)
peakfitresults <- matrix(nrow = 1, ncol = 6,
data = c(nrow(detection), fitt$rss, fitt$alpha,
fitt$sigma, fitt$mu, mean(detection[, 1])),
byrow = TRUE)
colnames(peakfitresults) <- c("datapoints", "rss",
"alpha", "sigma", "mu", "mz")
}
}
}
if (fitting == "model") {
require(MASS)
detection <- peakdetect(cbind(x, y), window = window,
threshold = threshold)
detection <- detection
if (model == "Gaussian") {
varnames.sigma <- all.vars(formula.sigma)
if (length(unique(varnames.sigma)) > 1) {
stop("'formula.sigma' is invalid: only one variable is allowed \n'")
}
if (length(unique(varnames.sigma)) > 0 && varnames.sigma !=
"mz") {
stop("'formula.sigma' is invalid: one or several variables not equal to 'mz' are present \n")
}
charsigma <- strsplit(as.character(formula.sigma),
split = "")
if (any(is.element(c(".", ":", "*"), charsigma))) {
stop("Invalid characters in one of the formulae: interaction terms/multiplications are not allowed \n")
}
intercept.sigma <- attr(terms(formula.sigma), "intercept")
peakfitresults <- matrix(nrow = 0, ncol = 4)
colnames(peakfitresults) <- c("datapoints", "rss",
"sigma", "mz")
for (i in seq(along = detection)) {
x.i <- detection[[i]][, 1]
if (length(x.i) < 2 * window)
next
y.i <- detection[[i]][, 2]
fitt <- try(fit.gauss(x.i, y.i), silent = TRUE)
if (inherits(fitt, "try-error")) {
warning("Fitting failed. \n")
next
}
newcol <- c(length(x.i), fitt$rss, fitt$sigma,
fitt$mu)
peakfitresults <- rbind(peakfitresults, newcol)
}
if (nrow(peakfitresults) == 0) {
stop("No peak of the chosen width ('window') found. Try to reduce 'window' \n")
}
mz <- peakfitresults[, "mz"]
sigmavec <- peakfitresults[, "sigma"]
formula.sigmanew <- as.formula(paste("sigmavec",
as.character(formula.sigma[2]), sep = "~"))
l1fitsigma <- try(rlm(formula.sigmanew, k = 1e-06,
maxit = rlm.maxit), silent = TRUE)
if (inherits(l1fitsigma, "try-error")) {
stop("Error in linear model estimation for parameter 'sigma' \n")
}
coefsigma <- coef(l1fitsigma)
sigmafunction <- formulacoef2function(formula.sigma,
coef = coefsigma, intercept = intercept.sigma)
MSE <- peakfitresults[, "rss"]/peakfitresults[, "datapoints"]
bestpeakind <- which.min(MSE)
bestpeak <- list(mz = detection[[bestpeakind]][,
1], intensities = detection[[bestpeakind]][,
2], sigma = peakfitresults[bestpeakind, "sigma"],
mu = peakfitresults[bestpeakind, "mz"])
}
if (model == "EMG") {
varnames.alpha <- all.vars(formula.alpha)
varnames.sigma <- all.vars(formula.sigma)
varnames.mu <- all.vars(formula.mu)
varnames <- c(varnames.alpha, varnames.sigma, varnames.mu)
if (length(unique(varnames)) > 1) {
stop("One or several of the formulae are invalid: only one variable is allowed \n")
}
if (length(unique(varnames)) > 0 && varnames != "mz") {
stop("One or several of the formulae are invalid: one or several variables not equal to 'mz' are present \n")
}
charalpha <- strsplit(as.character(formula.alpha),
split = "")
charsigma <- strsplit(as.character(formula.sigma),
split = "")
charmu <- strsplit(as.character(formula.mu), split = "")
if (any(is.element(c(".", ":", "*"), c(charalpha,
charsigma, charmu)))) {
stop("Invalid characters in one of the formulae: interaction terms/multiplications are not allowed \n")
}
intercept.alpha <- attr(terms(formula.alpha), "intercept")
intercept.sigma <- attr(terms(formula.sigma), "intercept")
intercept.mu <- attr(terms(formula.mu), "intercept")
peakfitresults <- matrix(nrow = 0, ncol = 6)
colnames(peakfitresults) <- c("datapoints", "rss",
"alpha", "sigma", "mu", "mz")
grid.alpha.basis <- grid.alpha <- 10^((seq(from = -5,
to = 5, length = 100)))
grid.sigma.basis <- grid.sigma <- 10^((seq(from = -5,
to = 5, length = 100)))
grid.mu <- seq(from = -1, to = 1, length = 100)
for (i in seq(along = detection)) {
x.i <- detection[[i]][, 1]
if (length(x.i) < 2 * window)
next
y.i <- detection[[i]][, 2]
fitt <- try(fit.EMG(x.i, y.i, gridsearch = TRUE,
grid.alpha = grid.alpha, grid.sigma = grid.sigma,
grid.mu = grid.mu), silent = TRUE)
if (inherits(fitt, "try-error")) {
warning("Fitting failed. \n")
next
}
newcol <- c(length(x.i), fitt$rss, fitt$alpha,
fitt$sigma, fitt$mu, mean(x.i))
peakfitresults <- rbind(peakfitresults, newcol)
dist.alpha <- abs(fitt$alpha - grid.alpha.basis)
dist.sigma <- abs(fitt$sigma - grid.sigma.basis)
o.alpha <- order(dist.alpha)[1:20]
o.sigma <- order(dist.sigma)[1:20]
grid.alpha <- sort(grid.alpha.basis[o.alpha])
grid.sigma <- sort(grid.sigma.basis[o.sigma])
}
if (nrow(peakfitresults) == 0) {
stop("No peak of the chosen width ('window') found. Try to reduce 'window' \n")
}
mz <- peakfitresults[, "mz"]
alphavec <- peakfitresults[, "alpha"]
formula.alphanew <- as.formula(paste("alphavec",
as.character(formula.alpha[2]), sep = "~"))
l1fitalpha <- try(rlm(formula.alphanew, k = 1e-06,
maxit = rlm.maxit), silent = TRUE)
if (inherits(l1fitalpha, "try-error")) {
stop("Error in linear model estimation for parameter 'alpha' \n")
}
coefalpha <- coef(l1fitalpha)
alphafunction <- formulacoef2function(formula.alpha,
coef = coefalpha, intercept = intercept.alpha)
sigmavec <- peakfitresults[, "sigma"]
formula.sigmanew <- as.formula(paste("sigmavec",
as.character(formula.sigma[2]), sep = "~"))
l1fitsigma <- try(rlm(formula.sigmanew, k = 1e-06,
maxit = rlm.maxit), silent = TRUE)
if (inherits(l1fitsigma, "try-error")) {
stop("Error in linear model estimation for parameter 'sigma' \n")
}
coefsigma <- coef(l1fitsigma)
sigmafunction <- formulacoef2function(formula.sigma,
coef = coefsigma, intercept = intercept.sigma)
muvec <- peakfitresults[, "mu"]
formula.munew <- as.formula(paste("muvec", as.character(formula.mu[2]),
sep = "~"))
l1fitmu <- try(rlm(formula.munew, k = 1e-06, maxit = rlm.maxit),
silent = TRUE)
if (inherits(l1fitmu, "try-error")) {
stop("Error in linear model estimation for parameter 'mu' \n")
}
coefmu <- coef(l1fitmu)
mufunction <- formulacoef2function(formula.mu, coef = coefmu,
intercept = intercept.mu)
MSE <- peakfitresults[, "rss"]/peakfitresults[, "datapoints"]
bestpeakind <- which.min(MSE)
bestpeak <- list(mz = detection[[bestpeakind]][,
1], intensities = detection[[bestpeakind]][,
2], alpha = peakfitresults[bestpeakind, "alpha"],
sigma = peakfitresults[bestpeakind, "sigma"],
mu = peakfitresults[bestpeakind, "mu"])
}
}
if (model == "Gaussian") {
alphafunction <- mufunction <- function(mz) {
}
}
new("modelfit", model = model, fitting = fitting, alphafunction = alphafunction,
sigmafunction = sigmafunction, mufunction = mufunction,
peakfitresults = peakfitresults, bestpeak = bestpeak)
}
<bytecode: 0x56451333bdf8>
<environment: namespace:IPPD>
Signatures:
mz intensities
target "numeric" "numeric"
defined "numeric" "numeric"
--- function search by body ---
S4 Method fitModelParameters:IPPD defined in namespace IPPD with signature numeric#numeric has this body.
----------- END OF FAILURE REPORT --------------
Fatal error: length > 1 in coercion to logical
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 1 ERROR, 1 WARNING, 5 NOTEs
See
‘/home/biocbuild/bbs-3.11-bioc/meat/IPPD.Rcheck/00check.log’
for details.