sgibb / MALDIquant

Quantitative Analysis of Mass Spectrometry Data
https://strimmerlab.github.io/software/maldiquant/
60 stars 25 forks source link

mergeMassSpectra throws an error for empty MassSpectrum objects #20

Closed sgibb closed 11 years ago

sgibb commented 11 years ago
library("MALDIquant")

s <- c(createMassSpectrum(1:5, 1:5),
       createMassSpectrum(double(), double()))
m <- mergeMassSpectra(s)
# Error in approxfun(x = x@mass, y = x@intensity, method = method, yleft = yleft,  : need at least two non-NA values to interpolate
# In addition: Warning message:
# In max(x@intensity) : no non-missing arguments to max; returning -Inf