Back to Multiple platform build/check report for BioC 3.11
ABCDEFGH[I]JKLMNOPQRSTUVWXYZ

CHECK report for IPPD on tokay2

This page was generated on 2020-10-17 11:56:54 -0400 (Sat, 17 Oct 2020).

TO THE DEVELOPERS/MAINTAINERS OF THE IPPD PACKAGE: Please make sure to use the following settings in order to reproduce any error or warning you see on this page.
Package 893/1905HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
IPPD 1.36.0
Martin Slawski
Snapshot Date: 2020-10-16 14:40:19 -0400 (Fri, 16 Oct 2020)
URL: https://git.bioconductor.org/packages/IPPD
Branch: RELEASE_3_11
Last Commit: 0a5e1c5
Last Changed Date: 2020-04-27 14:23:44 -0400 (Mon, 27 Apr 2020)
malbec2 Linux (Ubuntu 18.04.4 LTS) / x86_64  OK  OK  ERROR 
tokay2 Windows Server 2012 R2 Standard / x64  OK  OK [ ERROR ] OK 
machv2 macOS 10.14.6 Mojave / x86_64  OK  OK  ERROR  OK 

Summary

Package: IPPD
Version: 1.36.0
Command: C:\Users\biocbuild\bbs-3.11-bioc\R\bin\R.exe CMD check --force-multiarch --install=check:IPPD.install-out.txt --library=C:\Users\biocbuild\bbs-3.11-bioc\R\library --no-vignettes --timings IPPD_1.36.0.tar.gz
StartedAt: 2020-10-17 05:17:34 -0400 (Sat, 17 Oct 2020)
EndedAt: 2020-10-17 05:19:52 -0400 (Sat, 17 Oct 2020)
EllapsedTime: 138.4 seconds
RetCode: 1
Status:  ERROR  
CheckDir: IPPD.Rcheck
Warnings: NA

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   C:\Users\biocbuild\bbs-3.11-bioc\R\bin\R.exe CMD check --force-multiarch --install=check:IPPD.install-out.txt --library=C:\Users\biocbuild\bbs-3.11-bioc\R\library --no-vignettes --timings IPPD_1.36.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory 'C:/Users/biocbuild/bbs-3.11-bioc/meat/IPPD.Rcheck'
* using R version 4.0.3 (2020-10-10)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* 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 whether package 'IPPD' can be installed ... WARNING
Found the following significant warnings:
  Warning: Package 'IPPD' is deprecated and will be removed from Bioconductor
See 'C:/Users/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
* loading checks for arch 'i386'
** 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
* loading checks for arch 'x64'
** 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 for i386 is not available
Note: information on .o files for x64 is not available
File 'C:/Users/biocbuild/bbs-3.11-bioc/R/library/IPPD/libs/i386/IPPD.dll':
  Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)
File 'C:/Users/biocbuild/bbs-3.11-bioc/R/library/IPPD/libs/x64/IPPD.dll':
  Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran)

Compiled code should not call entry points which might terminate R nor
write to stdout/stderr instead of to the console, nor use Fortran I/O
nor system RNGs. The detected symbols are linked into the code but
might come from libraries and not actually be called.

See 'Writing portable packages' in the 'Writing R Extensions' manual.
* checking files in 'vignettes' ... OK
* checking examples ...
** running examples for arch 'i386' ... 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: 0x06a8f300>
<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

** running examples for arch 'x64' ... 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: 0x000000000c4211d8>
<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: 2 ERRORs, 1 WARNING, 5 NOTEs
See
  'C:/Users/biocbuild/bbs-3.11-bioc/meat/IPPD.Rcheck/00check.log'
for details.


Installation output

IPPD.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   C:\cygwin\bin\curl.exe -O https://malbec2.bioconductor.org/BBS/3.11/bioc/src/contrib/IPPD_1.36.0.tar.gz && rm -rf IPPD.buildbin-libdir && mkdir IPPD.buildbin-libdir && C:\Users\biocbuild\bbs-3.11-bioc\R\bin\R.exe CMD INSTALL --merge-multiarch --build --library=IPPD.buildbin-libdir IPPD_1.36.0.tar.gz && C:\Users\biocbuild\bbs-3.11-bioc\R\bin\R.exe CMD INSTALL IPPD_1.36.0.zip && rm IPPD_1.36.0.tar.gz IPPD_1.36.0.zip
###
##############################################################################
##############################################################################


  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 1049k  100 1049k    0     0  14.0M      0 --:--:-- --:--:-- --:--:-- 15.5M

install for i386

* installing *source* package 'IPPD' ...
** using staged installation
** libs
"C:/rtools40/mingw32/bin/"gcc  -I"C:/Users/BIOCBU~1/BBS-3~1.11-/R/include" -DNDEBUG     -I"C:/extsoft/include"     -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c R_init_IPPD.c -o R_init_IPPD.o
R_init_IPPD.c:17:40: warning: missing braces around initializer [-Wmissing-braces]
 static const R_CMethodDef cmethods[] = {
                                        ^
C:/rtools40/mingw32/bin/gcc -shared -s -static-libgcc -o IPPD.dll tmp.def R_init_IPPD.o -LC:/extsoft/lib/i386 -LC:/extsoft/lib -LC:/Users/BIOCBU~1/BBS-3~1.11-/R/bin/i386 -lR
installing to C:/Users/biocbuild/bbs-3.11-bioc/meat/IPPD.buildbin-libdir/00LOCK-IPPD/00new/IPPD/libs/i386
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'IPPD'
    finding HTML links ... done
    IPPD-package                            html  
    analyzeLCMS                             html  
    fitModelParameters                      html  
    getPeaklist                             html  
    internals                               html  
    modelfit-class                          html  
    myo500                                  html  
    peaklist-class                          html  
    read.mzXML                              html  
    sweepline                               html  
    toyspectrum                             html  
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Warning: Package 'IPPD' is deprecated and will be removed from Bioconductor
  version 3.12
** testing if installed package can be loaded from final location
Warning: Package 'IPPD' is deprecated and will be removed from Bioconductor
  version 3.12
** testing if installed package keeps a record of temporary installation path

install for x64

* installing *source* package 'IPPD' ...
** libs
"C:/rtools40/mingw64/bin/"gcc  -I"C:/Users/BIOCBU~1/BBS-3~1.11-/R/include" -DNDEBUG     -I"C:/extsoft/include"     -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c R_init_IPPD.c -o R_init_IPPD.o
R_init_IPPD.c:17:40: warning: missing braces around initializer [-Wmissing-braces]
 static const R_CMethodDef cmethods[] = {
                                        ^
C:/rtools40/mingw64/bin/gcc -shared -s -static-libgcc -o IPPD.dll tmp.def R_init_IPPD.o -LC:/extsoft/lib/x64 -LC:/extsoft/lib -LC:/Users/BIOCBU~1/BBS-3~1.11-/R/bin/x64 -lR
installing to C:/Users/biocbuild/bbs-3.11-bioc/meat/IPPD.buildbin-libdir/IPPD/libs/x64
** testing if installed package can be loaded
Warning: Package 'IPPD' is deprecated and will be removed from Bioconductor
  version 3.12
* MD5 sums
packaged installation of 'IPPD' as IPPD_1.36.0.zip
* DONE (IPPD)
* installing to library 'C:/Users/biocbuild/bbs-3.11-bioc/R/library'
package 'IPPD' successfully unpacked and MD5 sums checked

Tests output


Example timings

IPPD.Rcheck/examples_i386/IPPD-Ex.timings

nameusersystemelapsed

IPPD.Rcheck/examples_x64/IPPD-Ex.timings

nameusersystemelapsed