readMzXmlDir: Reads recursively mass spectrometry data in mzXML format.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/readMzXmlDir-functions.R

Description

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

Usage

1
2
3
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

See readMzXmlFile.

Value

A list of spectra.

Author(s)

Sebastian Gibb [email protected]

See Also

readMzXmlFile, importMzXml

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## 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)

sgibb/readMzXmlData documentation built on May 29, 2019, 8:04 p.m.