msPeak {msProcess} | R Documentation |
This function detects peaks in a set of mass spectra.
msPeak(x, FUN="simple", use.mean=FALSE, event="Peak Detection", ...)
x |
An object of class msSet . |
... |
Additional arguments for the FUN specified. See the specific routine for details. |
FUN |
A character string specifying the method for peak detection.
Possible choices are "simple" , "search" , "cwt" and "mrd" . In the
MRD case, the input msSet object is expected to contain
an attached mrd object containing meta information regarding
the wavelet-based multiresolution decomposition as output by
msDenoise(x, FUN="mrd", ...) as an example. See the
msPeakMRD function for more details.
Default: "simple" . |
event |
A character string denoting the name of the
event to register with the (embedded) event history object of the input
after processing the input data. Default: "Peak Detection" . |
use.mean |
A logical value specifying if to detect peaks in the mean spectum.
Default: FALSE . |
An object of class msSet
with elements depending on the value of use.mean:
|
the mean spectrum is attached as element
"intensity.mean"
(along with "noise.mean" and "noise.local.mean" )
the peak info is attached as element "peak.class" ,
and the argument "use.mean" is attached as element "use.mean" .
The element "peak.class" is
a matrix with peak classes as rows and some summary statistics as columns.
These statistics include the location, left bound, right bound, and
span of each peak class in both clock tick
("tick.loc" , "tick.left" ,
"tick.right" , "tick.span" ) and mass measure
("mass.loc" , "mass.left" ,
"mass.right" , "mass.span" ). |
|
the peak info is attached as element
"peak.list" . The element "peak.list" is a list
with one element for each spectrum. Each element is a data.frame
with 10 columns: the location, left bound, right bound, and
span of each peak in both clock tick
("tick.loc" , "tick.left" ,
"tick.right" , "tick.span" ) and mass measure
("mass.loc" , "mass.left" ,
"mass.right" , "mass.span" ),
and also peak signal-to-noise ratio and intensity
("snr" , "intensity" ). |
msPeakSimple
, msPeakSearch
, msPeakMRD
, msNormalize
.
if (!exists("qcset")) data("qcset", package="msProcess") ## extract several spectra from the build-in ## dataset z <- qcset[, 1:8] ## denoising z <- msDenoise(z, FUN="wavelet", n.level=10, thresh.scale=2) ## local noise estimation z <- msNoise(z, FUN="mean") ## baseline subtraction z <- msDetrend(z, FUN="monotone", attach=TRUE) ## intensity normalization based on total ion ## current z <- msNormalize(z, FUN="tic") ## peak detection z <- msPeak(z, FUN="simple", use.mean=FALSE, snr=2) ## visualize the detected peaks plot(z, process="msPeak", subset=1:8, offset=100, xlim=c(13000, 17000)) ## perform a similar analysis using a ## multiresolution decomposition approach z <- qcset[, 1:8] z <- msDenoise(z, FUN="mrd", levels=6, keep.smooth=FALSE) z <- msPeak(z, FUN="mrd") plot(z, process="msPeak", subset=1:8, offset=100, xlim=c(13000, 17000)) ## perform a similar analysis using a CWT approach # z <- qcset[, 1:8] # z <- msPeak(z, FUN="cwt", scale.min=8) # plot(z, process="msPeak", subset=1:8, offset=100, # xlim=c(13000, 17000))