MSnbase (version 1.20.7)

clean-methods: Cleans 'MSnExp' or 'Spectrum' instances

Description

This method cleans out individual spectra (Spectrum instances) or whole experiments (MSnExp instances) of 0-intensity peaks. Unless all is set to FALSE, origninal 0-intensity values are retained only around peaks. If more than two 0's were separating two peaks, only the first and last ones, those directly adjacent to the peak ranges are kept. If two peaks are separated by only one 0-intensity value, it is retained. An illustrative example is shown below.

Arguments

Methods

signature(object = "MSnExp", all = "logical" verbose = "logical")
Cleans all spectra in MSnExp object. Displays a control bar if verbose set to TRUE (default). Returns a cleaned MSnExp instance.
signature(object = "Spectrum", all = "logical")
Cleans the Spectrum object. Returns a cleaned Spectrum instance.

See Also

removePeaks and trimMz for other spectra processing methods.

Examples

Run this code
int <- c(1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0)
sp1 <- new("Spectrum2",
           intensity=int,
           mz=1:length(int))
sp2 <- clean(sp1) ## default is all=FALSE
intensity(sp1)
intensity(sp2)
intensity(clean(sp1, all = TRUE))

mz(sp1)
mz(sp2)
mz(clean(sp1, all = TRUE))

data(itraqdata)
itraqdata2 <- clean(itraqdata)
sum(peaksCount(itraqdata))
sum(peaksCount(itraqdata2))
processingData(itraqdata2)

Run the code above in your browser using DataCamp Workspace