Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

trimMz-methods

Trims 'MSnExp' or 'Spectrum' instances


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

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

Base Functions and Classes for Mass Spectrometry and Proteomics

v2.16.1
Artistic-2.0
Authors
Laurent Gatto, Johannes Rainer and Sebastian Gibb with contributions from Guangchuang Yu, Samuel Wieczorek, Vasile-Cosmin Lazar, Vladislav Petyuk, Thomas Naake, Richie Cotton, Arne Smits, Martina Fisher, Ludger Goeminne, Adriaan Sticker and Lieven Clement.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.