R: Reads recursively mass spectrometry data in Bruker Daltonics...

readBrukerFlexDir {readBrukerFlexData} | R Documentation

## Reads recursively mass spectrometry data in Bruker Daltonics XMASS format.

### Description

This function leads recursively all mass spectrometry data in Bruker Daltonics XMASS format in a specified directory.

### Usage

    readBrukerFlexDir(brukerFlexDir, removeCalibrationScans = TRUE,
      removeMetaData = FALSE, useHpc = TRUE, useSpectraNames = TRUE,
      filterZeroIntensities = FALSE, verbose = FALSE)

### Arguments

`brukerFlexDir` | `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 calculate mass data a lot of meta data are needed. To save memory they could be deleted after calculation.
`useHpc` | `logical`, should Bruker Daltonics' High Precision Calibration be used if available? (see also: `.hpc`)
`useSpectraNames` | `logical`, if `TRUE` all list elements get an unique name from metaData otherwise file path is used. (If ‘removeMetaData’ is `TRUE` ‘useSpectraNames’ has no effect.)
`filterZeroIntensities` | `logical`, don't change it. If `TRUE` all intensities equal `0.0` are removed. (see also: `readBrukerFlexFile`)
`verbose` | `logical`, print verbose messages?

### Details

See `readBrukerFlexFile`.

### 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.

### See Also

`importBrukerFlex`, `readBrukerFlexFile`, `.hpc`

### Examples

    ## load library
    library("readBrukerFlexData")

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

    ## read example spectra
    spec <- readBrukerFlexDir(file.path(exampleDirectory,
      "2010_05_19_Gibb_C8_A1"))

    ## 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] <- spec[[i]]$metaData$fullName
    }

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

[Package readBrukerFlexData version 1.8.5 Index]