matchms.filtering.filter_utils.derive_precursor_mz_and_parent_mass module

matchms.filtering.filter_utils.derive_precursor_mz_and_parent_mass.derive_parent_mass_from_precursor_mz(spectrum: Spectrum, estimate_from_adduct: bool) float | None[source]

Use the precursor mz, charge and adduct information to compute the mass of the case compound.

Args:

spectrum (SpectrumType): Spectrum with metadata. estimate_from_adduct (bool): Whether to include adduct parsing or not.

Returns:

float: Parent compound neutral mass.

matchms.filtering.filter_utils.derive_precursor_mz_and_parent_mass.derive_precursor_mz_from_parent_mass(spectrum: Spectrum, estimate_from_adduct: bool = True) float | None[source]

Derives the precursor_mz from the parent mass and adduct or charge