Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

alignSpectra-functions

Align MassSpectrum objects.


Description

This function aligns a list of MassSpectrum objects (spectra alignment is also known as warping/phase correction).

Usage

alignSpectra(spectra, halfWindowSize=20, noiseMethod="MAD", SNR=2,
  reference, tolerance=0.002, warpingMethod="lowess",
  allowNoMatches=FALSE, emptyNoMatches=FALSE, ...)

Arguments

spectra

list, list of MassSpectrum objects.

halfWindowSize

numeric, half window size; see detectPeaks.

noiseMethod

a noise estimation method; see detectPeaks.

SNR

single numeric value. SNR is an abbreviation for signal-to-noise-ratio; see detectPeaks.

reference

MassPeaks, reference object to which the samples (l) should be aligned. If missing referencePeaks is used; see determineWarpingFunctions.

tolerance

double, maximal relative deviation of a peak position (mass) to be considered as identical. Must be multiplied by 10^-6 for ppm, e.g. use tolerance=5e-6 for 5 ppm; see determineWarpingFunctions.

warpingMethod

used basic warping function; see determineWarpingFunctions.

allowNoMatches

logical, don't throw an error if an MassPeaks object could not match to the reference; see determineWarpingFunctions.

emptyNoMatches

logical, if TRUE (default: FALSE) the intensity values of MassSpectrum or MassPeaks objects with missing (NA) warping functions are set to zero; see warpMassSpectra.

...

arguments to be passed to detectPeaks,MassSpectrum-method.

Details

alignSpectra is a wrapper function around detectPeaks, determineWarpingFunctions and warpMassSpectra. Please call these functions manually if you need finer control (e.g. plotting of warping functions).

Value

Returns a list of aligned MassSpectrum objects.

Author(s)

Sebastian Gibb mail@sebastiangibb.de

See Also

demo("warping")

Examples

## load package
library("MALDIquant")

## load example data
data("fiedler2009subset", package="MALDIquant")

## running typical workflow

## transform intensities
spectra <- transformIntensity(fiedler2009subset, method="sqrt")

## smooth spectra
spectra <- smoothIntensity(spectra, method="MovingAverage")

## baseline correction
spectra <- removeBaseline(spectra)

## align spectra
spectra <- alignSpectra(spectra)

MALDIquant

Quantitative Analysis of Mass Spectrometry Data

v1.19.3
GPL (>= 3)
Authors
Sebastian Gibb [aut, cre] (<https://orcid.org/0000-0001-7406-4443>), Korbinian Strimmer [ths] (<https://orcid.org/0000-0001-7917-2056>)
Initial release
2019-05-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.