generatePseudoGaussianSpectrum: Generate the pseudo Gaussian distribution of peaks

Description Usage Arguments Details Value Author(s) Examples

Description

Given x-coordinates of mass or m/z, and the y of peak intensities, it generates the points of Gaussian distributsions around the peaks for ploting the spectrum.

Usage

1

Arguments

x

numeric(n): the x-coordinates of mass or m/z.

y

numeric(n): the y values of peak intensities.

sd

numeric(1): the desired standard deviation of the Gaussian distribution.

xlim

numeric(2): the range for generating points. By default, it's the range of x

step

numeric(1): the step size of generating points. Smaller step size gives smoother lines.

Details

For each pair of x and y, we generate the Gaussian distribution with x as mean, y as the height, sd as the standard deviation.

Value

A data.frame of x values and y values for plotting the spectrum.

Author(s)

Yang Yang

Examples

1
2
3
4
  x <- c(100, 500, 800)
  y <- c(50, 100, 20)
  ans <- generatePseudoGaussianSpectrum(x, y, sd=5L, xlim=c(1, 1000), step = 1L)
  plot(ans[["x"]], ans[["y"]], type="l", xlab="m/z", ylab="Intensity")

Yang0014/MassSpectrometry documentation built on May 10, 2019, 12:05 a.m.