-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add highly experimental wrapper for findmfpy
- Loading branch information
1 parent
0cd1101
commit 59aface
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
) |