Learn R Programming

MALDIquantForeign (version 0.5.1)

exportMsd,MassSpectrum-method: Export to MSD files

Description

This function exports AbstractMassObject-class objects (e.g. MassSpectrum-class, MassPeaks-class) into mMass MSD files.

Usage

## S3 method for class 'MassSpectrum':
exportMsd(x, file, force=FALSE,
    peaks, \ldots)

## S3 method for class 'list': exportMsd(x, path, force=FALSE, peaks, \ldots)

Arguments

x
a MassSpectrum-class object or a list of MassSpectrum-class objects.
file
character, file name.
path
character, path to directory in which the list of AbstractMassObject-class would be exported.
peaks
a MassPeaks-class object or a list of MassPeaks-class objects.
force
logical, If TRUE the file would be overwritten or path would be created.
...
arguments to be passed to write.table.

References

http://strimmerlab.org/software/maldiquant/, mMass homepage: http://mmass.org/

See Also

MassPeaks-class, MassSpectrum-class

Examples

Run this code
library("MALDIquant")
library("MALDIquantForeign")

s <- list(createMassSpectrum(mass=1:5, intensity=1:5),
          createMassSpectrum(mass=1:5, intensity=1:5))
p <- list(createMassPeaks(mass=4:5, intensity=4:5, snr=1:2),
          createMassPeaks(mass=4:5, intensity=4:5, snr=1:2))

## export a single spectrum
exportMsd(s[[1]], file="spectrum.msd")

## export a single spectrum with corresponding peaks
exportMsd(s[[1]], file="spectrum.msd", peaks=p[[1]])

## export a list of spectra with corresponding peaks
exportMsd(s, path="spectra", peaks=p, force=TRUE)

Run the code above in your browser using DataLab