Load spectra
loadnmr loads processed spectra and detects the format from the path. loadfid loads raw time-domain data.
using NMRToolsBruker processed data
Pass an experiment folder to load pdata/1, or a pdata folder to load another processed spectrum:
spec = loadnmr("path/to/experiment/1") # pdata/1
spec = loadnmr("path/to/experiment/1/pdata/101") # pdata/101dir = exampledata("2D_HN"; path=true)
spec = loadnmr(dir)
size(spec)(1216, 512)1D, 2D and 3D processed data (1r, 2rr, 3rrr) are read. By default only the real part is loaded; allcomponents=true loads the imaginary parts as well, as multicomplex data:
spec = loadnmr(dir; allcomponents=true)
eltype(spec)Multicomplex{Float64, 2, 4}Raw data
loadfid reads a fid (1D) or ser (nD) file. Pass the experiment folder or the file itself:
fid = loadfid(dir)
size(fid), eltype(fid)((1024, 64), Multicomplex{Float64, 2, 4})On loading, indirect dimensions are recombined from their quadrature scheme, the digital filter's group delay is recorded, the first point is scaled, and the data are scaled to match TopSpin's intensities. See Bruker data and TopSpin conventions for the details, and Process step by step for what to do next.
nmrPipe
Pass the file name of an nmrPipe spectrum. For a 3D stored as a series of planes, give a template with %03d (or similar) in place of the plane number:
pipe = exampledata("3D_HNCA_pipe"; path=true)
basename(pipe)"test%03d.ft3"spec3d = loadnmr(pipe)
size(spec3d)(384, 512, 128)1D, 2D and 3D nmrPipe data are read, including pseudo-3D plane series.
UCSF (Sparky)
ucsf = loadnmr(exampledata("3D_HNCA_ucsf"; path=true))
size(ucsf)(384, 512, 128)Attaching acquisition metadata
loadnmr looks for the Bruker acquisition files (acqus, pulse programme, lists) next to the spectrum, so that acquisition metadata are available for nmrPipe or UCSF data processed in the experiment folder. If the spectrum was saved elsewhere, give the experiment folder with experimentfolder:
spec = loadnmr("processed/hsqc.ft2"; experimentfolder="data/hsqc/1")Series of experiments
Load each experiment with loadnmr and collect them in a vector. Plotting functions accept vectors of spectra:
spectra = [loadnmr("titration/$i") for i in 1:11]scanexperiments lists the experiments in a folder without loading their data; see Find sample information.
Noise level
When a spectrum is loaded its noise level is estimated and stored as :noise. Plots use it to set contour levels, and detectpeaks to set thresholds:
spec[:noise]502.8422981258177estimatenoise re-estimates it, for example after editing the data.