envelope: Isotope pattern envelope calculation

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/envelope.R

Description

Convolutes an isotope pattern from isopattern with a peak shape function (Gaussian or Cauchy-Lorentz function) to its theoretical envelope (profile), at a given measurement resolution. The envelope is represented by sticks, i.e. measurement abundances at discrete m/z intervals.

Usage

1
2
envelope(pattern, ppm = FALSE, dmz = "get", frac = 1/4, env = "Gaussian", 
resolution = 5e+05, plotit = FALSE, verbose = TRUE)

Arguments

pattern

List of isotope pattern(s) as generated by isopattern.

ppm

Should stick discretization be set in ppm (TRUE) or absolute m/z (FALSE)? Only checked if dmz is not set to "get"; check details section.

dmz

Stick discretization. Set to "get" to derive discretization from argument resolution or set a numerical value in combination with ppm to use as ppm or absolute m/z. Check details section.

frac

Used if dmz is set to "get". Check details section.

env

Peak shape function; either "Gaussian" or "CauchyLorentz".

resolution

Single resolution value or vector of resolutions with length equal to the number of entries in list pattern. Check resolution definition in the details section.

plotit

Should results be plotted, TRUE/FALSE ?

verbose

Verbose, TRUE/FALSE?

Details

The theoretical profiles are represented by sticks, i.e. abundances at discrete m/z intervals. While the profile width is set by argument resolution, the mass discretization between adjacent sticks can be set in two different ways.

On the one hand, discretization can be given as a numerical value, either in ppm or absolute m/z. To do so, set argument dmz to a numerical value and specify with argument ppm if this value is stating the discretization in ppm or as absolute m/z.

On the other hand, discretization can be derived from the measurement resolution (R) set by argument resolution. To do so, set dmz to "get", which leads to argument ppm being ignored. In this case, the stick discretization is retrieved from (dm/z)*frac, with (dm/z) = (m/z)/R = peak width at half maximum.

Value

List with length equal to length of list pattern, with equal names of list entries. Each entry in that list contains the sticks of the envelope in two columns:

m/z

Stick m/z

abundance

Stick abundance

Note

The resolution R is defined as R=(m/z)/(dm/z), with dm/z = peak width at half maximum, cp. resolution_list.

Author(s)

Martin Loos, Christian Gerber

References

Li, L., Kresh, J., Karabacak, N., Cobb, J., Agar, J. and Hong, P. (2008). A Hierarchical Algorithm for Calculating the Isotopic Fine Structures of Molecules. Journal of the American Society for Mass Spectrometry, 19, 1867–1874.

See Also

isopattern getR vdetect

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
############################
# batch of chemforms #######
data(isotopes)
data(chemforms)
chemforms<-chemforms[1:5]

pattern<-isopattern(
  isotopes,
  chemforms,
  threshold=0.1,
  plotit=TRUE,
  charge=FALSE,
  emass=0.00054858,
  algo=2
)

profiles<-envelope(
    pattern,
    ppm=FALSE,
    dmz=0.0001,   
    frac=1/4,
    env="Gaussian",
    resolution=1E6,
    plotit=TRUE
)
############################

enviPat documentation built on May 30, 2017, 12:40 a.m.