Learn R Programming

MALDIquant (version 1.18)

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",
  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.

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