Spectrum analysis#
Types from the spectrum_analysis area of the protocol that appear in API signatures and attributes.
IntegrationRegion
#
A named spectral region for quantitative integration. Used in metabolomics workflows to track metabolite concentrations across multiple spectra.
color
class-attribute
instance-attribute
#
CSS color string (e.g., "#2196f3"). Empty = auto-assigned.
start_ppm_f1
class-attribute
instance-attribute
#
F1 start in ppm (2D only, absent for 1D)
end_ppm_f1
class-attribute
instance-attribute
#
F1 end in ppm (2D only, absent for 1D)
source
class-attribute
instance-attribute
#
"" for a region a user defined; "vendor" for one read from the data file at import (Bruker intrng, Nanalysis $INTEGRALS_MANUAL_REGIONS).
slope
class-attribute
instance-attribute
#
Straight baseline taken off the trace before integrating, in trace intensity units: the line is bias + slope * (ppm - midpoint of the region). Absent or 0 leaves the trace as is. 1D only.
per ppm
PeakDetectionSettings
#
============================================================================= Peak Detection Settings (stored in project) =============================================================================
min_height_ratio
class-attribute
instance-attribute
#
Minimum peak height as ratio of max height (0.0-1.0)
min_distance_hz
class-attribute
instance-attribute
#
Minimum distance between peaks in Hz
integration_width_hz
class-attribute
instance-attribute
#
Integration width on each side of peak (Hz). 0 = auto-calculate
normalize_to_peak
class-attribute
instance-attribute
#
Index of peak to normalize integrals to (1.00). -1 = no normalization
multiplet_search_width_hz
class-attribute
instance-attribute
#
Search width for multiplet analysis (Hz)
skip_multiplet_analysis
class-attribute
instance-attribute
#
Skip multiplet pattern recognition (faster, returns "m" for all peaks)
adaptive
class-attribute
instance-attribute
#
Use adaptive noise-based thresholds instead of fixed ratios. When true, min_height_ratio and prominence are ignored; uses SNR-based detection. This auto-detects noise level and finds all peaks significantly above noise.
method
class-attribute
instance-attribute
#
method: PeakPickingMethod | None
Which detector auto mode runs. Only meaningful when adaptive is true;
the manual path always uses the fixed ratios above.
Carries explicit presence: PEAK_PICKING_METHOD_LEARNED shares its number
with the proto3 default, so "the user chose learned" is distinguishable
from "never set" only through the optional marker. Consumers must test
method is None, not the truthiness of the value.
learned_threshold
class-attribute
instance-attribute
#
Operating point of the learned detector, 0-1. Lower favours recall, higher
favours precision. Unset uses the model's own default. Ignored unless
method selects the learned detector.
infer_missing_lines
class-attribute
instance-attribute
#
Let multiplet analysis synthesise a line the detector did not pick, when
the observed intensities are better explained by a pattern with one line
unobserved AND the trace carries the predicted intensity at that
position. Off unless asked for: an inferred line is a conclusion, not a
measurement. Synthesised lines are marked PEAK_ORIGIN_INFERRED and
carry no area, so integrals and peak counts are unaffected either way.
conservative_multiplets
class-attribute
instance-attribute
#
Preserve ambiguous crowded envelopes as generic m groups instead of assigning weak best-fit patterns. Unset defaults to true for older projects. False restores the original segmentation and best-fit classification.
snr_convention
class-attribute
instance-attribute
#
snr_convention: SnrConvention | None
Which signal-to-noise convention PeakInfo.snr reports. Unset reads as SNR_CONVENTION_SINO.
PeakInfo2D
#
frequency_f1_ppm
class-attribute
instance-attribute
#
Frequency in F1 (PPM, if reference available)
frequency_f2_ppm
class-attribute
instance-attribute
#
Frequency in F2 (PPM, if reference available)
group_id
class-attribute
instance-attribute
#
Group ID for peak grouping (peaks in same group share this ID)
origin
class-attribute
instance-attribute
#
origin: PeakOrigin
Origin: auto-detected or manually placed by user
linewidth_f1_hz
class-attribute
instance-attribute
#
FWHM per axis, for the peak's elliptical footprint.
edit_ids
class-attribute
instance-attribute
#
edit_ids: list[str]
Peak edits that contributed to this crosspeak.
ridge_id
class-attribute
instance-attribute
#
Set when this maximum stands on a streak rather than on a resonance: crosspeaks sharing an id sit on one ridge. Same role and same shape as ChemicalShiftGroup.ridge_id — the analysis decides co-linearity and ships the grouping, and consumers must not re-derive it from the coordinates. The crosspeak is LABELLED, never withheld: a streak runs through real correlations, so a user has to be able to see the call and overrule it.
peak_type
class-attribute
instance-attribute
#
peak_type: Peak2DType
Class of the peak as the source tool states it; UNSPECIFIED when it states none.
diagonal
class-attribute
instance-attribute
#
The peak lies on the diagonal, as the source tool states it.
MultipletAlternative
#
One alternative reading of a multiplet's lines.
j_couplings
class-attribute
instance-attribute
#
j_couplings: list[float]
Its couplings (Hz), largest first; empty for "s" and "m".
probability
class-attribute
instance-attribute
#
Posterior probability of this reading.
spin_system
class-attribute
instance-attribute
#
The strongly coupled spin system of this reading, as MultipletGroup.spin_system.
MultipletGroup
#
============================================================================= Multiplet Group (group-level metadata for a cluster of peaks) =============================================================================
group_id
class-attribute
instance-attribute
#
Group ID (matches group_id on PeakInfo messages)
pattern
class-attribute
instance-attribute
#
Multiplet pattern ("s", "d", "t", "q", "dd", "dt", "m", etc.)
peak_indices
class-attribute
instance-attribute
#
peak_indices: list[int]
Indices into the parent peaks array
peak_positions_hz
class-attribute
instance-attribute
#
peak_positions_hz: list[float]
Per-peak positions and heights within this group, AS MEASURED by the detector. These agree with the peak table and are never replaced by a model's values -- the deviation of a real multiplet from the ideal comb (roofing, unequal spacing) is evidence, and overwriting it destroys the only record of it.
fitted_positions_hz
class-attribute
instance-attribute
#
fitted_positions_hz: list[float]
The idealised first-order comb the pattern fit settled on, when one was accepted. Empty when the group was classified from its lines alone. Use these to draw the model; use the measured arrays above to reason about the data.
tier
class-attribute
instance-attribute
#
tier: ShiftTier
Standing of this group as a chemical shift. Mirrors the tier of the ChemicalShiftGroup built from the same lines, so a consumer holding only the multiplet list does not have to join against the shift list to know whether it is looking at the analyte or at residual solvent.
pattern_alternatives
class-attribute
instance-attribute
#
pattern_alternatives: list[MultipletAlternative]
Other readings of the same lines, most probable first. confidence is the
probability of pattern; these share the rest.
second_order
class-attribute
instance-attribute
#
The lines are mirror-symmetric but no first-order pattern explains them: a
strongly coupled (second-order) system, such as AB or AA'BB', whose couplings
cannot be read off the line spacings. pattern is then "m".
spin_system
class-attribute
instance-attribute
#
When the lines read best as a strongly coupled spin system: its name ("AB", "ABX",
"AA'BB'", "AA'XX'"), the shift of each observed site (Hz), and the names of the
couplings in j_couplings ("J_AB", "J_AB'"...). Empty otherwise.
MultipletGroup2D
#
2D Multiplet Group (e.g. HSQC cross-peak splitting pattern)
group_id
class-attribute
instance-attribute
#
Group ID (matches group_id on PeakInfo2D messages)
center_f1_hz
class-attribute
instance-attribute
#
Center frequency on F1 (indirect, e.g. 13C) in Hz
center_f2_hz
class-attribute
instance-attribute
#
Center frequency on F2 (direct, e.g. 1H) in Hz
center_f1_ppm
class-attribute
instance-attribute
#
Center in PPM (if reference available)
pattern
class-attribute
instance-attribute
#
Multiplet pattern ("s", "d", "t", "q", etc.)
coupling_hz
class-attribute
instance-attribute
#
Estimated J-coupling in Hz (from line spacing)
peak_indices
class-attribute
instance-attribute
#
peak_indices: list[int]
Indices into the parent peaks array
start_f1_hz
class-attribute
instance-attribute
#
Group extent: the union of member peaks' elliptical footprints.
ridge_id
class-attribute
instance-attribute
#
Set when every member crosspeak stands on the same streak — see PeakInfo2D.ridge_id. Carried on the group as well as on the peaks so a consumer working in group space (the multiplet table, the group outline) does not have to re-read the member peaks to learn the group is an artifact, and so the two can never disagree about it.
Peak2DType
#
Where a peak came from. Deliberately narrow: AUTO or INFERRED, nothing else. "A human touched this" is answered by the peak edit log (see PeakEdit below) and by PeakInfo.edit_ids, never here — origin, source and "has edits" used to say it three ways, which is three ways to drift. What a picked 2D peak is, as the vendor tool classes it. Only vendor imports set it; peaks the app picks itself stay UNSPECIFIED.
PeakOrigin
#
MANUAL
class-attribute
instance-attribute
#
Deprecated: a hand-placed peak is the projection of an EDIT_KIND_ADD entry in the scan's peak edit log. Kept only so old saved scans parse.
INFERRED
class-attribute
instance-attribute
#
Not measured: a line the multiplet analysis concluded must exist but the
detector did not pick, synthesised only when the trace carries the
intensity the pattern predicts at that position. Its height is the
PREDICTED height and its area is zero, so it never contributes to an
integral or to a reported peak count. Consumers must render it as
distinct from a measured line.
betterproto_value_to_renamed_proto_names
classmethod
#
betterproto_renamed_proto_names_to_value
classmethod
#
PeakPickingMethod
#
Which detector runs in auto mode.
LEARNED
class-attribute
instance-attribute
#
The learned detector. Finds shoulders and merged components a threshold pass cannot, and is invariant to line broadening.
CLASSICAL
class-attribute
instance-attribute
#
Threshold pass plus deconvolution against the measured lineshape.
betterproto_value_to_renamed_proto_names
classmethod
#
betterproto_renamed_proto_names_to_value
classmethod
#
PeakRole
#
ShiftTier
#
============================================================================= Shift curation: how much standing a signal has as a chemical shift =============================================================================
How a signal should be treated as a chemical shift. Nothing is ever removed from the response on account of its tier; the tier is a label that display, matching and export are each free to interpret differently.
MINOR
class-attribute
instance-attribute
#
Real and kept, but below what a chemist would write down.
ARTIFACT
class-attribute
instance-attribute
#
Explained by something other than the analyte.
EXCLUDED
class-attribute
instance-attribute
#
Held out of every downstream consumer, by user action.
betterproto_value_to_renamed_proto_names
classmethod
#
betterproto_renamed_proto_names_to_value
classmethod
#
SnrConvention
#
How a line's height is set against the noise.
SINO
class-attribute
instance-attribute
#
Bruker sino: line height over twice the noise rms, which equals 2.5 times the
height over the peak-to-peak noise for Gaussian noise. The default, and the figure
the qNMR suitability check reads.
HEIGHT_OVER_RMS
class-attribute
instance-attribute
#
Line height over the noise standard deviation.
PEAK_TO_PEAK
class-attribute
instance-attribute
#
Pharmacopoeial 2H / h: twice the line height over the peak-to-peak noise.