Skip to content

Results#

The types returned by the spectrum analysis methods.

PeakInfo #

index class-attribute instance-attribute #

index: int = betterproto2.field(1, betterproto2.TYPE_INT32)

Index in data array

frequency_hz class-attribute instance-attribute #

frequency_hz: float = betterproto2.field(
    2, betterproto2.TYPE_DOUBLE
)

Frequency in Hz

frequency_ppm class-attribute instance-attribute #

frequency_ppm: float | None = betterproto2.field(
    3, betterproto2.TYPE_DOUBLE, optional=True
)

Frequency in PPM (if reference available)

height class-attribute instance-attribute #

height: float = betterproto2.field(
    4, betterproto2.TYPE_DOUBLE
)

Peak height

prominence class-attribute instance-attribute #

prominence: float = betterproto2.field(
    5, betterproto2.TYPE_DOUBLE
)

Peak prominence

area class-attribute instance-attribute #

area: float = betterproto2.field(
    6, betterproto2.TYPE_DOUBLE
)

Integrated area

normalized_area class-attribute instance-attribute #

normalized_area: float = betterproto2.field(
    7, betterproto2.TYPE_DOUBLE
)

Normalized area (relative to reference peak)

integration_start_hz class-attribute instance-attribute #

integration_start_hz: float = betterproto2.field(
    8, betterproto2.TYPE_DOUBLE
)

Integration bounds (start_hz, end_hz)

integration_end_hz class-attribute instance-attribute #

integration_end_hz: float = betterproto2.field(
    9, betterproto2.TYPE_DOUBLE
)

multiplet_pattern class-attribute instance-attribute #

multiplet_pattern: str = betterproto2.field(
    10, betterproto2.TYPE_STRING
)

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

j_couplings class-attribute instance-attribute #

j_couplings: list[float] = betterproto2.field(
    11, betterproto2.TYPE_DOUBLE, repeated=True
)

J-coupling constants in Hz

multiplet_confidence class-attribute instance-attribute #

multiplet_confidence: float = betterproto2.field(
    12, betterproto2.TYPE_DOUBLE
)

Confidence of multiplet assignment (0.0-1.0)

group_id class-attribute instance-attribute #

group_id: int | None = betterproto2.field(
    13, betterproto2.TYPE_INT32, optional=True
)

Group ID for multiplet grouping (peaks in same group share this ID)

linewidth_hz class-attribute instance-attribute #

linewidth_hz: float = betterproto2.field(
    14, betterproto2.TYPE_FLOAT
)

Linewidth (FWHM) in Hz

linewidth_ppm class-attribute instance-attribute #

linewidth_ppm: float = betterproto2.field(
    15, betterproto2.TYPE_FLOAT
)

Linewidth (FWHM) in PPM

origin class-attribute instance-attribute #

origin: PeakOrigin = betterproto2.field(
    16,
    betterproto2.TYPE_ENUM,
    default_factory=lambda: PeakOrigin(0),
)

Origin: auto-detected or inferred.

peak_id class-attribute instance-attribute #

peak_id: str = betterproto2.field(
    17, betterproto2.TYPE_STRING
)

Stable identity for this line, so an edit can name it without relying on an array index that renumbers on every analysis. Peaks a user placed carry "edit:"; detected peaks are issued one per analysis.

edit_ids class-attribute instance-attribute #

edit_ids: list[str] = betterproto2.field(
    18, betterproto2.TYPE_STRING, repeated=True
)

Every peak edit that contributed to the values above, in application order. Consumers use it to explain any field a user overrode.

role class-attribute instance-attribute #

role: PeakRole = betterproto2.field(
    19,
    betterproto2.TYPE_ENUM,
    default_factory=lambda: PeakRole(0),
)

A satellite carries no multiplet_pattern or j_couplings of its own.

satellite_coupling_hz class-attribute instance-attribute #

satellite_coupling_hz: float | None = betterproto2.field(
    20, betterproto2.TYPE_DOUBLE, optional=True
)

Satellites only: 1J(C,H), Hz, the spacing to the partner across the parent shift.

snr class-attribute instance-attribute #

snr: float | None = betterproto2.field(
    21, betterproto2.TYPE_DOUBLE, optional=True
)

Signal-to-noise of this line under the convention in force; absent when the trace has no measurable noise or the line is inferred.

spin_system class-attribute instance-attribute #

spin_system: str = betterproto2.field(
    22, betterproto2.TYPE_STRING
)

The strongly coupled spin system a person applied to this line's multiplet (SET_FIELD spin_system); empty when none.

spin_system_shifts_hz class-attribute instance-attribute #

spin_system_shifts_hz: list[float] = betterproto2.field(
    23, betterproto2.TYPE_DOUBLE, repeated=True
)

Shifts of that system's spins, in Hz in the acquisition frame.

spin_system_couplings class-attribute instance-attribute #

spin_system_couplings: list[str] = betterproto2.field(
    24, betterproto2.TYPE_STRING, repeated=True
)

Names of that system's couplings, as MultipletGroup.spin_system_couplings.

line_class_reason class-attribute instance-attribute #

line_class_reason: str = betterproto2.field(
    26, betterproto2.TYPE_STRING
)

Why the line was classed, in a few words ("matches CDCl3 residual 7.26", "water in DMSO-d6", "set by user"); empty for a compound line.

line_artifact_kind class-attribute instance-attribute #

line_artifact_kind: ArtifactKind = betterproto2.field(
    27,
    betterproto2.TYPE_ENUM,
    default_factory=lambda: ArtifactKind(0),
)

What the line is, in the terms curation uses for a signal: SOLVENT (residual or companion), WATER, SATELLITE or IMPURITY; UNSPECIFIED for a compound line. Nothing is removed for it; views and downstream steps filter on it.

line_class_source class-attribute instance-attribute #

line_class_source: str = betterproto2.field(
    28, betterproto2.TYPE_STRING
)

"auto" when the classifier decided, "user" when a person did; empty when the line was not classed.

line_class_name class-attribute instance-attribute #

line_class_name: str = betterproto2.field(
    29, betterproto2.TYPE_STRING
)

Name of the table entry the classifier matched, in plain ASCII formula or word form ("CDCl3", "DMSO-d5", "H2O", "TMS", "silicone grease"); empty for a compound line, a person-set class and a satellite.

MultipletAnalysis dataclass #

MultipletAnalysis(
    pattern: str,
    coupling_constants: list[float],
    peak_positions: list[float],
    peak_heights: list[float],
    confidence: float,
    center_frequency: float,
    integration_bounds: tuple[float, float],
    coupling_uncertainties: list[float] | None = None,
    position_uncertainties: list[float] | None = None,
    peak_widths: list[float] | None = None,
    bic: float | None = None,
    snr: float | None = None,
    r_squared: float | None = None,
    alternative_patterns: list[tuple[str, float]]
    | None = None,
    roofing_asymmetry: float = 0.0,
    strong_coupling: bool = False,
)

Result of multiplet pattern analysis.

pattern instance-attribute #

pattern: str

coupling_constants instance-attribute #

coupling_constants: list[float]

peak_positions instance-attribute #

peak_positions: list[float]

peak_heights instance-attribute #

peak_heights: list[float]

confidence instance-attribute #

confidence: float

center_frequency instance-attribute #

center_frequency: float

integration_bounds instance-attribute #

integration_bounds: tuple[float, float]

coupling_uncertainties class-attribute instance-attribute #

coupling_uncertainties: list[float] | None = None

position_uncertainties class-attribute instance-attribute #

position_uncertainties: list[float] | None = None

peak_widths class-attribute instance-attribute #

peak_widths: list[float] | None = None

bic class-attribute instance-attribute #

bic: float | None = None

snr class-attribute instance-attribute #

snr: float | None = None

r_squared class-attribute instance-attribute #

r_squared: float | None = None

alternative_patterns class-attribute instance-attribute #

alternative_patterns: list[tuple[str, float]] | None = None

roofing_asymmetry class-attribute instance-attribute #

roofing_asymmetry: float = 0.0

strong_coupling class-attribute instance-attribute #

strong_coupling: bool = False

IntegrationResult dataclass #

IntegrationResult(
    peak: PeakInfo,
    area: float,
    normalized_area: float,
    bounds: tuple[float, float],
)

Result of peak integration.

peak instance-attribute #

peak: PeakInfo

area instance-attribute #

area: float

normalized_area instance-attribute #

normalized_area: float

bounds instance-attribute #

bounds: tuple[float, float]