esmraldi.spectrainterpretation

Module for the annotation of a spectrum

Module Contents

Functions

closest_peak(reference_mz, theoretical_spectrum, tolerance)

Closest peak for a given m/z ratio,

annotation(observed, theoretical[, tolerance])

Annotate an observed spectrum by comparison

annotation_ratio(observed, theoretical[, tolerance])

Annotate an observed spectrum by comparison

esmraldi.spectrainterpretation.closest_peak(reference_mz, theoretical_spectrum, tolerance)

Closest peak for a given m/z ratio, from a theoretical spectrum.

Parameters
reference_mz: float

peak m/z

theoretical_spectrum: dict

theoretical spectrum, where keys are m/z ratio and values the names

tolerance: float

acceptable mz delta to consider peaks are equal

Returns
list

peaks in theoretical spectrum closest to reference_mz

esmraldi.spectrainterpretation.annotation(observed, theoretical, tolerance=0.1)

Annotate an observed spectrum by comparison to a theoretical spectrum.

Parameters
observed: list

mass list

theoretical: dict

theoretical spectrum generated from several species rule

tolerance: float

acceptable mz delta to consider peaks are equal

Returns
dict

annotated mass list

esmraldi.spectrainterpretation.annotation_ratio(observed, theoretical, tolerance=0.1)

Annotate an observed spectrum by comparison to a theoretical spectrum. The observed spectrum may contain ratio between two species.

Parameters
observed: list

mass list

theoretical: dict

theoretical spectrum generated from several species rule

tolerance: float

acceptable mz delta to consider peaks are equal

Returns
dict

annotated mass list