if (FALSE) {
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