hqs_nmr.analysis.similarity

Module for assessing whether two spectra stem from the same molecule.

class hqs_nmr.analysis.similarity.SpectrumComparison(*, original_params: NMRParameters, adjusted_params: NMRParameters, experimental_spectrum: NMRSpectrum1DProtocol, computed_spectrum: NMRSpectrum1DProtocol)

Comparison of two spectra.

This class is used to judge wether two spectra describe the same molecule.

original_params

The original NRM parameters for the computation.

Type:

hqs_nmr_parameters.code.data_classes.NMRParameters

adjusted_params

The parameters that have been adjusted to make the spectra more similar.

Type:

hqs_nmr_parameters.code.data_classes.NMRParameters

experimental_spectrum

The experimental spectrum.

Type:

hqs_nmr.datatypes.NMRSpectrum1DProtocol

computed_spectrum

The spectrum to compare with.

Type:

hqs_nmr.datatypes.NMRSpectrum1DProtocol

correlation

The correlation of the two spectral functions.

hellinger_distance

The Hellinger distance of the two spectral functions.

max_shift_adjustment

The largest shift adjustment that has been made.

Constructor.

__init__(*, original_params: NMRParameters, adjusted_params: NMRParameters, experimental_spectrum: NMRSpectrum1DProtocol, computed_spectrum: NMRSpectrum1DProtocol) None

Constructor.

original_params: NMRParameters
adjusted_params: NMRParameters
experimental_spectrum: NMRSpectrum1DProtocol
computed_spectrum: NMRSpectrum1DProtocol
is_match() bool

Returns whether the two spectra are likely to represent the same molecule.

match_probability() float

Returns the probability for the two spectra being representing the same molecule.

improvement_hints() set[SpectrumMismatchHint]

Returns possible reasons for a mismatch.

class hqs_nmr.analysis.similarity.SpectrumMismatchHint(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Possible reasons for why two spectra do not match.

LOW_CORRELATION = 1
LARGE_SHIFT = 2