Package 'readMzXmlData'

Title: Reads Mass Spectrometry Data in mzXML Format
Description: Functions for reading mass spectrometry data in mzXML format.
Authors: Sebastian Gibb [aut, cre]
Maintainer: Sebastian Gibb <[email protected]>
License: GPL (>= 3)
Version: 2.8.3
Built: 2024-11-11 02:58:01 UTC
Source: https://github.com/sgibb/readmzxmldata

Help Index


The readMzXmlData Package

Description

The package reads mass spectrometry data in mzXML format.

Details

Main functions:

readMzXmlFile: Reads mass spectrometry data in mzXML format.

readMzXmlDir: Reads recursively mass spectrometry data in mzXML format in a specific directory.

mqReadMzXml: Reads mass spectrometry data into MALDIquant.

Author(s)

Sebastian Gibb [email protected]

References

See website: https://strimmerlab.github.io/software/maldiquant/

See Also

readMzXmlDir, readMzXmlFile


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

See readMzXmlFile.

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 [email protected]

See Also

readMzXmlFile, importMzXml

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)

Reads mass spectrometry data in mzXML format.

Description

Reads mass spectrometry data in mzXML format defined in http://tools.proteomecenter.org/wiki/index.php?title=Formats:mzXML

Usage

readMzXmlFile(mzXmlFile, removeMetaData = FALSE, verbose = FALSE)

Arguments

mzXmlFile

character, path to mzXML file which should be read.

removeMetaData

logical, to save memory metadata could be deleted.

verbose

logical, verbose output?

Value

A list of spectra and metadata.

  • spectrum$mass: A vector of calculated mass.

  • spectrum$intensity: A vector of intensity values.

  • metaData: A list of metaData depending on read spectrum.

Author(s)

Sebastian Gibb [email protected]

References

Definition of mzXML format: http://tools.proteomecenter.org/wiki/index.php?title=Formats:mzXML

See Also

readMzXmlDir, importMzXml

Examples

## load library
library("readMzXmlData")

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

## read example spectrum
spec <- readMzXmlFile(file.path(exampleDirectory, "A1-0_A1.mzXML"))

## print metaData
print(spec$metaData)

## plot spectrum
plot(spec$spectrum$mass, spec$spectrum$intensity, type="l")