msPeak: Mother Function for Peak Detection

Description Usage Arguments Value See Also Examples

Description

This function detects peaks in a set of mass spectra.

Usage

1
2
msPeak(x, FUN="simple",
    use.mean=FALSE, event="Peak Detection", ...)

Arguments

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.

Value

An object of class msSet with elements depending on the value of use.mean:

use.mean==TRUE

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").

use.mean==FALSE

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").

See Also

msPeakSimple, msPeakSearch, msPeakMRD, msNormalize.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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))

zeehio/msProcess documentation built on May 4, 2019, 10:15 p.m.