sgibb / MALDIquant

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

Spectra with zero intensities aren't empty spectra and become invalid. #15

Closed sgibb closed 11 years ago

sgibb commented 11 years ago

library("MALDIquant")
s <- createMassSpectrum(mass=1:10, intensity=rep(0, 10))
as.matrix(s)
#     mass intensity
# [1,]    1         0
# [2,]    2         0
# [3,]    3         0
# [4,]    4         0
# [5,]    5         0
# [6,]    6         0
# [7,]    7         0
# [8,]    8         0
# [9,]    9         0
#[10,]   10         0
length(s)
# [1] 10
totalIonCurrent(s) <- 1
as.matrix(s)
#     mass intensity
length(s)
# [1] 0