Bin 'MSnExp' or 'Spectrum' instances
bin-methods.Rd
This method aggregates individual spectra (Spectrum
instances)
or whole experiments (MSnExp
instances) into discrete bins. All
intensity values which belong to the same bin are summed together.
Methods
signature(object = "MSnExp", binSize = "numeric", verbose = "logical")
Bins all spectra in an
MSnExp
object. UsebinSize
to control the size of a bin (in Dalton, default is1
). Displays a control bar if verbose set toTRUE
(default). Returns a binnedMSnExp
instance.signature(object = "Spectrum", binSize = "numeric", breaks = "numeric", msLevel. = "numeric")
Bin the
Spectrum
object. UsebinSize
to control the size of a bin (in Dalton, default is1
). Similar tohist
you could usebreaks
to specify the breakpoints between m/z bins.msLevel.
defines the level of the spectrum, and ifmsLevel(object) != msLevel.
, cleaning is ignored. Only relevant when called fromOnDiskMSnExp
and is only relevant for developers.Returns a binned
Spectrum
instance.
See also
clean
, pickPeaks
, smooth
,
removePeaks
and trimMz
for other spectra processing methods.
Examples
s <- new("Spectrum2", mz=1:10, intensity=1:10)
intensity(s)
#> [1] 1 2 3 4 5 6 7 8 9 10
intensity(bin(s, binSize=2))
#> [1] 3 7 11 15 19
data(itraqdata)
sum(peaksCount(itraqdata))
#> [1] 106289
itraqdata2 <- bin(itraqdata, binSize=2)
sum(peaksCount(itraqdata2))
#> [1] 54186
processingData(itraqdata2)
#> - - - Processing information - - -
#> Data loaded: Wed May 11 18:54:39 2011
#> Updated from version 0.3.0 to 0.3.1 [Fri Jul 8 20:23:25 2016]
#> Spectra binned: Tue Oct 15 15:26:14 2024
#> MSnbase version: 1.1.22