Skip to content

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.

name class-attribute instance-attribute #

name: str

Human-readable label (e.g., "CH₂ methyl")

start_ppm class-attribute instance-attribute #

start_ppm: float

Region start in ppm (F2 for 2D)

end_ppm class-attribute instance-attribute #

end_ppm: float

Region end in ppm (F2 for 2D)

color class-attribute instance-attribute #

color: str

CSS color string (e.g., "#2196f3"). Empty = auto-assigned.

start_ppm_f1 class-attribute instance-attribute #

start_ppm_f1: float | None

F1 start in ppm (2D only, absent for 1D)

end_ppm_f1 class-attribute instance-attribute #

end_ppm_f1: float | None

F1 end in ppm (2D only, absent for 1D)

source class-attribute instance-attribute #

source: str

"" 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 #

slope: float | None

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

bias class-attribute instance-attribute #

bias: float | None

PeakDetectionSettings #

============================================================================= Peak Detection Settings (stored in project) =============================================================================

min_height_ratio class-attribute instance-attribute #

min_height_ratio: float

Minimum peak height as ratio of max height (0.0-1.0)

min_distance_hz class-attribute instance-attribute #

min_distance_hz: float

Minimum distance between peaks in Hz

prominence class-attribute instance-attribute #

prominence: float

Minimum prominence (0 = disabled)

integration_width_hz class-attribute instance-attribute #

integration_width_hz: float

Integration width on each side of peak (Hz). 0 = auto-calculate

normalize_to_peak class-attribute instance-attribute #

normalize_to_peak: int

Index of peak to normalize integrals to (1.00). -1 = no normalization

multiplet_search_width_hz class-attribute instance-attribute #

multiplet_search_width_hz: float

Search width for multiplet analysis (Hz)

skip_multiplet_analysis class-attribute instance-attribute #

skip_multiplet_analysis: bool

Skip multiplet pattern recognition (faster, returns "m" for all peaks)

adaptive class-attribute instance-attribute #

adaptive: bool

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 #

learned_threshold: float | None

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 #

infer_missing_lines: bool

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 #

conservative_multiplets: bool | None

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 #

index_f1 class-attribute instance-attribute #

index_f1: int

Index in F1 dimension

index_f2 class-attribute instance-attribute #

index_f2: int

Index in F2 dimension

frequency_f1_hz class-attribute instance-attribute #

frequency_f1_hz: float

Frequency in F1 (Hz)

frequency_f2_hz class-attribute instance-attribute #

frequency_f2_hz: float

Frequency in F2 (Hz)

frequency_f1_ppm class-attribute instance-attribute #

frequency_f1_ppm: float | None

Frequency in F1 (PPM, if reference available)

frequency_f2_ppm class-attribute instance-attribute #

frequency_f2_ppm: float | None

Frequency in F2 (PPM, if reference available)

height class-attribute instance-attribute #

height: float

Peak height

volume class-attribute instance-attribute #

volume: float | None

Peak volume (if calculated)

group_id class-attribute instance-attribute #

group_id: int | None

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 #

linewidth_f1_hz: float | None

FWHM per axis, for the peak's elliptical footprint.

linewidth_f2_hz class-attribute instance-attribute #

linewidth_f2_hz: float | None

linewidth_f1_ppm class-attribute instance-attribute #

linewidth_f1_ppm: float | None

linewidth_f2_ppm class-attribute instance-attribute #

linewidth_f2_ppm: float | None

peak_id class-attribute instance-attribute #

peak_id: str

Stable identity — see PeakInfo.peak_id.

edit_ids class-attribute instance-attribute #

edit_ids: list[str]

Peak edits that contributed to this crosspeak.

ridge_id class-attribute instance-attribute #

ridge_id: str | None

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 #

diagonal: bool

The peak lies on the diagonal, as the source tool states it.

MultipletAlternative #

One alternative reading of a multiplet's lines.

pattern class-attribute instance-attribute #

pattern: str

Pattern label, as MultipletGroup.pattern.

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 #

probability: float

Posterior probability of this reading.

spin_system class-attribute instance-attribute #

spin_system: str

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: int

Group ID (matches group_id on PeakInfo messages)

start_freq_hz class-attribute instance-attribute #

start_freq_hz: float

Frequency bounds (Hz)

end_freq_hz class-attribute instance-attribute #

end_freq_hz: float

center_freq_hz class-attribute instance-attribute #

center_freq_hz: float

Center frequency

center_freq_ppm class-attribute instance-attribute #

center_freq_ppm: float | None

pattern class-attribute instance-attribute #

pattern: str

Multiplet pattern ("s", "d", "t", "q", "dd", "dt", "m", etc.)

j_couplings class-attribute instance-attribute #

j_couplings: list[float]

J-coupling constants (Hz)

confidence class-attribute instance-attribute #

confidence: float

Pattern confidence (0.0-1.0)

integration class-attribute instance-attribute #

integration: float

Integration

normalized_integration class-attribute instance-attribute #

normalized_integration: float

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.

peak_heights class-attribute instance-attribute #

peak_heights: list[float]

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.

fitted_heights class-attribute instance-attribute #

fitted_heights: list[float]

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 #

second_order: bool

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 #

spin_system: str

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.

spin_system_shifts_hz class-attribute instance-attribute #

spin_system_shifts_hz: list[float]

spin_system_couplings class-attribute instance-attribute #

spin_system_couplings: list[str]

satellite_peak_indices class-attribute instance-attribute #

satellite_peak_indices: list[int]

13C satellites: members by group_id, yet outside peak_indices, the pattern, bounds and integration.

satellite_coupling_hz class-attribute instance-attribute #

satellite_coupling_hz: float | None

MultipletGroup2D #

2D Multiplet Group (e.g. HSQC cross-peak splitting pattern)

group_id class-attribute instance-attribute #

group_id: int

Group ID (matches group_id on PeakInfo2D messages)

center_f1_hz class-attribute instance-attribute #

center_f1_hz: float

Center frequency on F1 (indirect, e.g. 13C) in Hz

center_f2_hz class-attribute instance-attribute #

center_f2_hz: float

Center frequency on F2 (direct, e.g. 1H) in Hz

center_f1_ppm class-attribute instance-attribute #

center_f1_ppm: float | None

Center in PPM (if reference available)

center_f2_ppm class-attribute instance-attribute #

center_f2_ppm: float | None

n_lines class-attribute instance-attribute #

n_lines: int

Number of multiplet lines

pattern class-attribute instance-attribute #

pattern: str

Multiplet pattern ("s", "d", "t", "q", etc.)

coupling_hz class-attribute instance-attribute #

coupling_hz: float | None

Estimated J-coupling in Hz (from line spacing)

score class-attribute instance-attribute #

score: float

Pattern quality score (0.0-1.0)

peak_indices class-attribute instance-attribute #

peak_indices: list[int]

Indices into the parent peaks array

start_f1_hz class-attribute instance-attribute #

start_f1_hz: float | None

Group extent: the union of member peaks' elliptical footprints.

end_f1_hz class-attribute instance-attribute #

end_f1_hz: float | None

start_f2_hz class-attribute instance-attribute #

start_f2_hz: float | None

end_f2_hz class-attribute instance-attribute #

end_f2_hz: float | None

start_f1_ppm class-attribute instance-attribute #

start_f1_ppm: float | None

end_f1_ppm class-attribute instance-attribute #

end_f1_ppm: float | None

start_f2_ppm class-attribute instance-attribute #

start_f2_ppm: float | None

end_f2_ppm class-attribute instance-attribute #

end_f2_ppm: float | None

ridge_id class-attribute instance-attribute #

ridge_id: str | None

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.

UNSPECIFIED class-attribute instance-attribute #

UNSPECIFIED = 0

ARTIFACT class-attribute instance-attribute #

ARTIFACT = 1

IMPURITY class-attribute instance-attribute #

IMPURITY = 2

COMPOUND class-attribute instance-attribute #

COMPOUND = 3

CS_REFERENCE class-attribute instance-attribute #

CS_REFERENCE = 4

QUANTITATIVE_REFERENCE class-attribute instance-attribute #

QUANTITATIVE_REFERENCE = 5

betterproto_value_to_renamed_proto_names classmethod #

betterproto_value_to_renamed_proto_names() -> dict[
    int, str
]

betterproto_renamed_proto_names_to_value classmethod #

betterproto_renamed_proto_names_to_value() -> dict[
    str, int
]

PeakOrigin #

AUTO class-attribute instance-attribute #

AUTO = 0

MANUAL class-attribute instance-attribute #

MANUAL = 1

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 #

INFERRED = 2

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_value_to_renamed_proto_names() -> dict[
    int, str
]

betterproto_renamed_proto_names_to_value classmethod #

betterproto_renamed_proto_names_to_value() -> dict[
    str, int
]

PeakPickingMethod #

Which detector runs in auto mode.

LEARNED class-attribute instance-attribute #

LEARNED = 0

The learned detector. Finds shoulders and merged components a threshold pass cannot, and is invariant to line broadening.

CLASSICAL class-attribute instance-attribute #

CLASSICAL = 1

Threshold pass plus deconvolution against the measured lineshape.

betterproto_value_to_renamed_proto_names classmethod #

betterproto_value_to_renamed_proto_names() -> dict[
    int, str
]

betterproto_renamed_proto_names_to_value classmethod #

betterproto_renamed_proto_names_to_value() -> dict[
    str, int
]

PeakRole #

What a line is to its group. A satellite belongs to its parent's group but not to its multiplet.

LINE class-attribute instance-attribute #

LINE = 0

SATELLITE class-attribute instance-attribute #

SATELLITE = 1

betterproto_value_to_renamed_proto_names classmethod #

betterproto_value_to_renamed_proto_names() -> dict[
    int, str
]

betterproto_renamed_proto_names_to_value classmethod #

betterproto_renamed_proto_names_to_value() -> dict[
    str, int
]

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.

UNSPECIFIED class-attribute instance-attribute #

UNSPECIFIED = 0

REPORTED class-attribute instance-attribute #

REPORTED = 1

Belongs in the reported shift list.

MINOR class-attribute instance-attribute #

MINOR = 2

Real and kept, but below what a chemist would write down.

ARTIFACT class-attribute instance-attribute #

ARTIFACT = 3

Explained by something other than the analyte.

EXCLUDED class-attribute instance-attribute #

EXCLUDED = 4

Held out of every downstream consumer, by user action.

betterproto_value_to_renamed_proto_names classmethod #

betterproto_value_to_renamed_proto_names() -> dict[
    int, str
]

betterproto_renamed_proto_names_to_value classmethod #

betterproto_renamed_proto_names_to_value() -> dict[
    str, int
]

SnrConvention #

How a line's height is set against the noise.

SINO class-attribute instance-attribute #

SINO = 0

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 #

HEIGHT_OVER_RMS = 1

Line height over the noise standard deviation.

PEAK_TO_PEAK class-attribute instance-attribute #

PEAK_TO_PEAK = 2

Pharmacopoeial 2H / h: twice the line height over the peak-to-peak noise.

betterproto_value_to_renamed_proto_names classmethod #

betterproto_value_to_renamed_proto_names() -> dict[
    int, str
]

betterproto_renamed_proto_names_to_value classmethod #

betterproto_renamed_proto_names_to_value() -> dict[
    str, int
]