simSpectra: Simulate a mass spectrum

Description Usage Arguments Value

View source: R/simSpectra.R

Description

Simulate a mass spectrum including peaks, noise, a baseline, noise, mass drift, mass resolution, etc.

Usage

1
2
3
4
5
6
simSpectra(n = 1L, peaks = 50L, mz = rlnorm(peaks, 7, 0.3),
  intensity = rlnorm(peaks, 1, 0.9), from = 0.9 * min(mz), to = 1.1 *
  max(mz), by = 100, sdpeaks = sdpeakmult * log1p(intensity),
  sdpeakmult = 0.2, sdnoise = 0.1, sdmz = 10, resolution = 1000,
  fmax = 0.5, baseline = 0, decay = 10, units = c("ppm", "mz"),
  representation = c("profile", "centroid"))

Arguments

n

The number of spectra to simulate

peaks

The number of peaks to simulate

mz

The m/z of the peaks

intensity

The intensity of the peaks

from

Lower end of mass range

to

Upper end of mass range

by

Size of m/z bins

sdpeaks

Log-standard deviation of peak intensities

sdpeakmult

Multiplier for peak variance

sdnoise

Standard deviation of noise

sdmz

Mass error

resolution

Mass resolution as defined by 'm / dm' where 'm' is the observed mass and 'dm' is the width of the peak at a proportion of its maximum height defined by fmax (defaults to FWHM)

fmax

The proportion of the maximum peak height used by resolution

baseline

Maximum intensity of hte baseline

decay

Rate of decay of the baseline

units

Units for the width of the m/z bins

representation

Return a profile or centroided spectrum?

Value

A MassSpectrum or MassSpectraList


kuwisdelu/MSExample documentation built on May 13, 2020, 10:25 p.m.