importSpectraBruker {ASICS} | R Documentation

## Import metabolomic spectra from Bruker files

### Description

Import spectra from Bruker files contained in a single folder. This folder contains one subfolder for each sample. Spectra are baseline corrected (optional) and normalised by the area under the curve during the importation.

### Usage

    importSpectraBruker(name.dir, which.spectra = "last",
      baseline.correction = TRUE, alignment = FALSE, ppm.grid = NULL,
      sample.names = NULL, ncores = 1, ...)

### Arguments

`name.dir` | Path of the folder containing one subfolder by sample. Each subfolder contains the Bruker files of this sample.
`which.spectra` | If there is more than one spectrum by sample, which is the spectrum to import (either always the first one with `which.spectra = "first"`, always the last one with `which.spectra = "last"` or a vector of length the number of spectra that specifies the number of each spectrum to import). Default to `"last"`.
`baseline.correction` | Logical. If `TRUE` a baseline correction is applied for each spectrum (Wang et al (2013)). Default to `TRUE`.
`alignment` | Logical. If `TRUE` a peak alignment is applied between all spectra (Vu et al (2011)). Default to `FALSE`.
`ppm.grid` | Numeric vector of a unique grid (definition domain) for all spectra (in ppm). Default to `NULL` (in which case, the default grid of the pure library is used).
`sample.names` | Character vector of sample names. Default to `NULL` (in which case, folder names are used).
`ncores` | Number of cores used in parallel evaluation. Default to `1`.
`...` | Further arguments to be passed to the function `alignment` for specifying the parameters of the algorithm, if necessary.

### Details

Some preprocessing steps are included during the importation. First, spectra are baseline corrected if `baseline.correction = TRUE`. Then, all spectrum definition domains are aligned to a unique one (either the one specified in `ppm.grid` or the grid of the default library). Finally, all spectra are normalised by the area under the curve.

### Value

A data frame with spectra in columns and chemical shifts (in ppm) in rows.

### References

Wang, K.C., Wang, S.Y., Kuo, C.H., Tseng Y.J. (2013). Distribution-based classification method for baseline correction of metabolomic 1D proton nuclear magnetic resonance spectra. Analytical Chemistry, 85(2), 1231-1239.

Vu, T. N., Valkenborg, D., Smets, K., Verwaest, K. A., Dommisse, R., Lemiere, F., ... & Laukens, K. (2011). An integrated workflow for robust alignment and simplified quantitative analysis of NMR spectrometry data. BMC Bioinformatics, 12(1), 405.

### See Also

`baselineCorrection` `normalisation` `alignment`

### Examples

    current_path <- system.file("extdata", "example_spectra", package = "ASICS")
    spectra_data <- importSpectraBruker(current_path)

[Package ASICS version 1.0.1 Index]