Skip to contents

Imports Bruker TopSpin-processed 1D NMR spectra. Spectrometer and processing parameters are extracted from acqus and procs files. Optionally filters experiments using acquisition metadata.

Usage

read1d(
  path,
  exp_type = list(pulprog = "noesygppr1d"),
  n_max = 1000,
  filter = TRUE,
  recursive = TRUE,
  verbose = 1
)

read1d_proc(
  path,
  exp_type = list(pulprog = "noesygppr1d"),
  n_max = 1000,
  filter = TRUE,
  recursive = TRUE,
  verbose = 1
)

Arguments

path

Character. Directory path containing Bruker NMR experiments.

exp_type

Named list. Filter experiments by acquisition parameters (e.g., list(pulprog = 'noesygppr1d')).

n_max

Integer. Maximum number of spectra to import. Default: 1000.

filter

Logical. Filter out experiments with incomplete file systems.

recursive

Logical. Search path recursively. Default: TRUE.

verbose

Logical or numeric. Verbosity level.

Value

The following objects are assigned to the global environment:

  • X: Numeric matrix of spectra (samples x variables)

  • ppm: Numeric vector of chemical shift values

  • meta: Data frame of acquisition/processing metadata

Also returns a (named) list invisibly for testing.

Examples

path <- system.file("extdata", package = "metabom8")
read1d(path, exp_type = list(pulprog = "noesygppr1d"), n_max = 2)
#> Warning: `read1d` will be deprecated; please use `read1d_proc()`.
#> Imported 1 spectra.