importSpectra {ASICS} | R Documentation |
Import spectra from text or CSV, fid or 1r (preprocessed spectrum) files. (optional) Spectra are baseline corrected, aligned and normalised during the importation.
importSpectra(name.dir = NULL, name.file = NULL, type.import, baseline.correction = FALSE, alignment = FALSE, normalisation = TRUE, ncores = 1, verbose = TRUE, ...)
name.dir |
Path of the folder containing the spectra. Each
subfolder contains the fid or the 1r (preprocessed spectrum) files of this
sample if |
name.file |
Name of the txt or csv file containing the spectra in columns (spectrum names in the first line and ppm grid in the first column). |
type.import |
Type of import. Either |
baseline.correction |
Logical. If |
alignment |
Logical. If |
normalisation |
Logical. If |
ncores |
Number of cores used in parallel evaluation. Default to
|
verbose |
A boolean value to allow print out process information. |
... |
Further arguments to be passed to the functions
|
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 if normalisation = TRUE
and aligned if
alignment = TRUE
.
A data frame with spectra in columns and chemical shifts (in ppm) in rows.
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.
importSpectraBruker
normaliseSpectra
alignSpectra
## Import from txt file current_path <- system.file("extdata", package = "ASICS") spectra_data <- importSpectra(name.dir = current_path, name.file = "spectra_example.txt", type.import = "txt") ## Import from fid file current_path <- system.file("extdata", "example_spectra", package = "ASICS") spectra_data <- importSpectra(name.dir = current_path, type.import = "fid", subdirs = TRUE, dirs.names = TRUE) ## Import from txt file current_path <- system.file("extdata", "example_spectra", package = "ASICS") spectra_data <- importSpectra(name.dir = current_path, type.import = "1r")