Learn R Programming

MALDIquantForeign (version 0.4)

exportMzMl,MassSpectrum-method: Export to mzML files

Description

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

Usage

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

## S3 method for class 'list': exportMzMl(x, path, force=FALSE, \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.
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/, HUPO Proteomics Standards Inititative mzML 1.1.0 Specification: http://www.psidev.info/mzml_1_0_0

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

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

## export a list of spectra with corresponding peaks
exportMzMl(s, path="spectra.mzMl")

Run the code above in your browser using DataLab