diff --git a/src/depiction/spectrum/peak_picking/findmf_peak_picker.py b/src/depiction/spectrum/peak_picking/findmf_peak_picker.py new file mode 100644 index 0000000..9cbaea5 --- /dev/null +++ b/src/depiction/spectrum/peak_picking/findmf_peak_picker.py @@ -0,0 +1,33 @@ +# TODO extremely experimental, not part of pyproject.toml dependencies etc, +# usage not yet recommended! +from __future__ import annotations + +from dataclasses import dataclass + +import numpy as np +from findmfpy.api import pick_peaks as _pick_peaks +from numpy.typing import NDArray + + +@dataclass +class FindMFPeakpicker: + resolution: float = 10000.0 + width: float = 2.0 + int_width: float = 2.0 + int_threshold: float = 10.0 + area: bool = True + max_peaks: int = 0 + + def pick_peaks( + self, mz_arr: NDArray[np.float64], int_arr: NDArray[np.float64] + ) -> tuple[NDArray[np.float64], NDArray[np.float64]]: + return _pick_peaks( + mz_arr, + int_arr, + resolution=self.resolution, + width=self.width, + int_width=self.int_width, + int_threshold=self.int_threshold, + area=self.area, + max_peaks=self.max_peaks, + )