Reads Bruker 1D NMR FIDs, corrects the digital filter (group delay), applies apodisation (windowing), optional zero-filling, FFT, phasing and ppm calibration.
Returns either absorption-, dispersion-, or magnitude-mode spectra.
If to_global = TRUE, objects are assigned to the global environment.
Arguments
- path
Character. Path to the root directory containing Bruker experiment folders.
- exp_type
Named list. Acquisition-parameter filter to select experiments (e.g.,
list(PULPROG = "noesygppr1d")).- apodisation
Named list. Apodisation function and parameters.
funmust be one of"exponential","cosine","sine","sem".- zerofill
Integer. Zero-filling exponent (
1doubles points,2quadruples, …).- mode
Character. Spectrum type to return:
"absorption","dispersion", or"magnitude".- verbose
Integer. Verbosity level:
0= silent,1= summary (default),2= detailed,3= debug.- recursive
Logical. Recursively search subdirectories for FIDs.
- n_max
Integer. Maximum number of experiments to process.
- filter
Logical. Remove experiments with incomplete file structures.
- to_global
Logical. If TRUE, objects are also assigned to the global environment; otherwise, only an invisible list is returned.
Value
A named list with three elements:
- X
A numeric matrix of spectra (rows = samples, columns = ppm values).
- ppm
A numeric vector of chemical-shift axis (ppm).
- meta
A data frame of acquisition metadata, row-aligned with
X.
If to_global = TRUE, these objects are also assigned to the global environment.
In that case, any existing objects with the same names will be overwritten.
Details
FIDs are read from Bruker acquisition folders and processed by the following pipeline:
Digital-filter (group-delay) correction: the initial n complex points are invalid due to the causal DSP decimation filter and are discarded; n equals
GRPDLYwhen present, or is looked up from Bruker tables indexed byDECIMandDSPFVSon older systems.Apodisation (windowing).
Zero-filling (optional).
FFT to the frequency domain.
Phase correction.
PPM calibration (e.g., to TSP).
A common ppm scale is then interpolated across spectra.
Digital filter note: On newer systems GRPDLY is written in acqus/acqu2s
and should be used directly. For older data sets (GRPDLY < 0 or missing), the group delay
is derived from DECIM and DSPFVS via an internal look-up table.
Apodisation functions:
"uniform""cosine","sine","exponential"(parameter:lb)"sem"(sine * exponential, parameter:lb)"gauss"(parameter:lb,'gb', and'para')"expGaus_resyG"(parameter:lb,'gb', and'aq_t')
See also
read1d_proc for importing TopSpin-processed spectra
Examples
path <- system.file("extdata", package = "metabom8")
read1d_raw(
path,
exp_type = list(PULPROG = "noesygppr1d"),
apodisation = list(fun = "exponential", lb = 0.2),
zerofill = 1,
n_max = 3
)
#> Processing 2 experiments.