Learn R Programming

MALDIquant (version 0.2)

importSingleSpectrum: Imports/Reads a single mass spectrum from file.

Description

This function reads a single mass spectrum from file and creates a SingleSpectrum object. It depends on some other packages:

ll{ file type/extension: needed package: Bruker Daltonics fid file readBrukerFlexData mzXML: *.mzXML, *.xml readMzXmlData }

Usage

importSingleSpectrum(file, verbose = FALSE, ...)

Arguments

file
Path to file which should be read.
verbose
Logical. Print verbose messages?
...
Arguments to be passed to import functions. For details please see readBrukerFlexFile and/or readMzXmlFi

Value

  • Returns a SingleSpectrum object.

References

See website: http://www.sebastiangibb.de/maldiquant

See Also

createSingleSpectrum, plot,SingleSpectrum,missing-method, readBrukerFlexFile, readMzXmlFile.

Examples

Run this code
## load library
library("MALDIquant");

## load readBrukerFlexData library for fid file import 
## (is also done automatically by importSingleSpectrum)
library("readBrukerFlexData");

## get examples directory
exampleDirectory <- system.file("Examples", package="readBrukerFlexData");

## read example spectrum
s <- importSingleSpectrum(file.path(exampleDirectory,
    "2010_05_19_Gibb_C8_A1/0_A1/1/1SLin/fid"));

## show some details
s;

## plot spectrum
plot(s);

Run the code above in your browser using DataLab