Metadata Overview
NMRData objects contain comprehensive metadata on processing and acquisition parameters that are populated automatically upon loading a spectrum. This metadata system provides access to all the information needed to understand, process, and analyze NMR data.
Types of metadata
Metadata is organized into two categories:
- Spectrum metadata: Information about the experiment as a whole (number of scans, receiver gain, pulse program, temperature, etc.)
- Axis metadata: Information specific to each dimension (carrier frequency, spectral width, window functions, etc.)
Quick start
Accessing spectrum metadata
using NMRTools
# Load example spectrum
spec = exampledata("2D_HN")
# Access using the metadata function
metadata(spec, :ns)2# Or use dictionary-style lookup
spec[:pulseprogram]"sfhmqcf3gpph.cw"Accessing axis metadata
# By dimension type
spec[F2Dim, :label]"15N"# Or by dimension number
spec[2, :swhz]1337.97163500134Accessing acquisition parameters
# Get acquisition parameter
acqus(spec, :te)276.9988# Access arrayed parameters
acqus(spec, :p, 1) # First pulse length9.199999999999998e-6Special metadata types
NMRTools provides specialized types for handling complex metadata:
Window functions
Window functions (apodization) applied during processing are stored as structured objects that preserve all parameters:
# Get window function for a dimension
win = spec[F2Dim, :window]CosWindow(0.04783359999999993)See the Window functions page for detailed documentation.
Power levels
Power levels are represented as Power objects that handle conversion between Watts and dB:
# Power levels from acqus file
p = acqus(spec, :pl, 1)
db(p) # Get as dB
watts(p) # Get as WattsSee the Power levels page for detailed documentation.
Frequency lists
Frequency lists (from fq1list, etc.) are stored as FQList objects that preserve unit and reference information:
# Get frequency list
fqlist = acqus(spec, :fq1list)
# Extract as ppm or Hz
ppm(fqlist, dims(spec, F2Dim))
hz(fqlist, dims(spec, F2Dim))See the Frequency lists page for detailed documentation.
Sample metadata
Sample metadata describing the physical sample, buffer composition, and experimental details can be automatically loaded when present:
# Check if sample metadata is available
hassample(spec)
# Access sample metadata
sample(spec)
# Navigate nested metadata
sample(spec, :sample, :label)See the Sample metadata page for detailed documentation.
Standard metadata keys
Spectrum metadata symbols
| Symbol | Description |
|---|---|
:filename | Original filename or template |
:format | :NMRPipe or :bruker |
:title | Contents of pdata/1/title |
:label | First line of title, used for captions |
:date | Experiment timestamp (completion time) |
:pulseprogram | Pulse program (PULPROG) from acqus file |
:ndim | Number of dimensions |
:acqusfilename | Path to associated acqus file |
:acqus | Dictionary of acqus data |
:ns | Number of scans |
:rg | Receiver gain |
:noise | RMS noise level |
:solvent | Solvent string, e.g. "H2O+D2O" |
:temperature | Temperature in K |
:nuclei | Set of Nucleus values |
Axis metadata symbols
| Symbol | Description |
|---|---|
:pseudodim | Flag indicating non-frequency domain data |
:npoints | Final number of (real) data points in dimension (after extraction) |
:td | Number of complex points acquired |
:tdzf | Number of complex points when FT executed, including LP and ZF |
:bf | Base frequency, in Hz |
:sf | Carrier frequency, in Hz |
:offsethz | Carrier offset from bf, in Hz |
:offsetppm | Carrier offset from bf, in ppm |
:swhz | Spectrum width, in Hz |
:swppm | Spectrum width, in ppm |
:region | Extracted region, expressed as a range in points, otherwise missing |
:window | WindowFunction object indicating applied apodization |
:nucleus | Nucleus enum value for this dimension |
Auxiliary files
Files such as vclist, vdlist, and frequency lists are automatically imported when present:
# Access variable delay list
relaxation_spec = exampledata("pseudo3D_HN_R2")
acqus(relaxation_spec, :vclist)11-element Vector{Int64}:
0
1
2
3
4
6
8
10
12
14
16NMRTools performs automatic unit conversion:
:vclist: Variable loop counter (dimensionless):vdlist: Variable delays, in seconds:valist: Variable amplitude, in dB (converted from Watts if necessary):vplist: Variable pulse lengths, in seconds:fq1listthrough:fq8list: Frequency lists (see Frequency lists)
Next steps
- Times and frequencies: Learn about units used for pulse lengths, delays and frequencies
- Power levels: Representation of powers and RF field strength calculations
- Frequency lists: Understand frequency list handling and conversions
- Window functions: Explore apodization functions and lineshape effects
- Sample metadata: Working with sample metadata and the nmr-sample-schema
- Tutorial: Metadata: Step-by-step introduction to working with metadata (see Tutorials section)
- Reference: Metadata: Complete API reference for metadata functions (see Reference guide section)