Learn R Programming

MALDIquant (version 1.17)

alignSpectra: 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", …)

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; see determineWarpingFunctions.

warpingMethod

used basic warping function; see determineWarpingFunctions.

arguments to be passed to detectPeaks,MassSpectrum-method.

Value

Returns a list of aligned '>MassSpectrum objects.

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

See Also

detectPeaks, determineWarpingFunctions, referencePeaks, warpMassSpectra, '>MassSpectrum

demo("warping")

Website: http://strimmerlab.org/software/maldiquant/

Examples

Run this code
# NOT RUN {
## 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)
# }

Run the code above in your browser using DataLab