trimMz-methods: Trims 'MSnExp' or 'Spectrum' instances

Description Methods Author(s) See Also Examples

Description

This method selects a range of MZ values in a single spectrum (Spectrum instances) or all the spectra of an experiment (MSnExp instances). The regions to trim are defined by the range of mz argument, such that MZ values <= min(mz) and MZ values >= max(mz) are trimmed away.

Methods

signature(object = "MSnExp", mz = "numeric", msLevel. = "numeric")

Trims all spectra in MSnExp object according to mz. If msLevel. is defined, then only spectra of that level are trimmer.

signature(object = "Spectrum", mz = "numeric", msLevel. = "numeric")

Trims the Spectrum object and retruns a new trimmed object. msLevel. defines the level of the spectrum, and if msLevel(object) != msLevel., cleaning is ignored. Only relevant when called from OnDiskMSnExp and is only relevant for developers.

Author(s)

Laurent Gatto <lg390@cam.ac.uk>

See Also

removePeaks and clean for other spectra processing methods.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
mz <- 1:100
sp1 <- new("Spectrum2",
           mz = mz,
           intensity = abs(rnorm(length(mz))))

sp2 <- trimMz(sp1, c(25, 75))
range(mz(sp1))
range(mz(sp2))

data(itraqdata)
itraqdata2 <- filterMz(itraqdata, c(113, 117))
range(mz(itraqdata))
range(mz(itraqdata2))
processingData(itraqdata2)

MSnbase documentation built on Jan. 23, 2021, 2 a.m.