importSpectraBruker: Import preprocessed metabolomic spectra from Bruker files

Description Usage Arguments Value See Also Examples

View source: R/load_data.R

Description

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

Usage

1
2
3
4
5
6
7
8
importSpectraBruker(
  name.dir,
  which.spectra = "first",
  ppm.grid = NULL,
  sample.names = NULL,
  ncores = 1,
  verbose = TRUE
)

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 no folder with experiment number (all_spectra/<spectrum_name>/pdata/...) set which.spectra to NULL. Else if there is more than one spectrum by sample (all_spectra/<spectrum_name>/<experiment_number>/pdata/...), 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 "first".

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.

verbose

A boolean value to allow print out process information.

Value

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

See Also

normaliseSpectra alignSpectra

Examples

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

GaelleLefort/ASICS documentation built on July 19, 2020, 2:08 p.m.