Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

readMzXmlDir

Reads recursively mass spectrometry data in mzXML format.


Description

Reads recursively all mass spectrometry data in mzXML format in a specified directory.

Usage

readMzXmlDir(mzXmlDir, removeCalibrationScans = TRUE,
  removeMetaData = FALSE, rewriteNames = TRUE, fileExtension = "mzXML",
  verbose = FALSE)

Arguments

mzXmlDir

character, path to directory which should be read recursively.

removeCalibrationScans

logical, if TRUE all scans in directories called “[Cc]alibration” will be ignored.

removeMetaData

logical, to save memory metadata could be deleted.

rewriteNames

logical, if TRUE all list elements get an unique name from metadata otherwise file path is used.

fileExtension

character, file extension of mzXML formatted files. The directory is only searched for fileExtension files. In most cases it would be “"mzXML"” but sometimes you have to use “xml”.

verbose

logical, verbose output?

Details

Value

A list of spectra.

  • [[1]]spectrum$mass: A vector of calculated mass.

  • [[1]]spectrum$intensity: A vector of intensity values.

  • [[1]]metaData: A list of metaData depending on read spectrum.

Author(s)

Sebastian Gibb mail@sebastiangibb.de

See Also

Examples

## load library
library("readMzXmlData")

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

## read example spectra
spec <- readMzXmlDir(exampleDirectory)

## plot spectra
plot(spec[[1]]$spectrum$mass, spec[[1]]$spectrum$intensity, type="n")

l <- length(spec)
legendStr <- character(l)
for (i in seq(along=spec)) {
  lines(spec[[i]]$spectrum$mass, spec[[i]]$spectrum$intensity, type="l",
        col=rainbow(l)[i])
  legendStr[i] <- basename(spec[[i]]$metaData$file)
}

## draw legend
legend(x="topright", legend=legendStr, col=rainbow(l), lwd=1)

readMzXmlData

Reads Mass Spectrometry Data in mzXML Format

v2.8.1
GPL (>= 3)
Authors
Sebastian Gibb [aut, cre]
Initial release
2015-09-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.