Skip to content

Commit 2851472

Browse files
Add iterative peak picking algorithm option
Co-authored-by: timosachsenberg <5803621+timosachsenberg@users.noreply.github.com>
1 parent 132d96d commit 2851472

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

openms_python/py_msexperiment.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
PEAK_PICKER_REGISTRY: Dict[str, Any] = {
1616
"hires": oms.PeakPickerHiRes,
1717
"cwt": getattr(oms, "PeakPickerCWT", oms.PeakPickerHiRes),
18+
"iterative": oms.PeakPickerIterative,
1819
}
1920

2021
_FeatureMapLike = Union[Py_FeatureMap, oms.FeatureMap]

tests/test_py_msexperiment.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,3 +323,15 @@ def pick(self, source, dest):
323323
assert len(processed) == len(exp)
324324
assert all(np.allclose(spec.mz, 42.0) for spec in exp)
325325

326+
327+
def test_peak_picking_iterative_method():
328+
"""Test that iterative peak picking method is available."""
329+
exp = build_experiment()
330+
# Just verify that iterative method can be selected
331+
try:
332+
picked = exp.pick_peaks(method="iterative", ms_levels=1)
333+
assert isinstance(picked, Py_MSExperiment)
334+
except Exception as e:
335+
# It may fail on minimal data, but should not fail on unknown method
336+
assert "Unknown peak picking method" not in str(e)
337+

0 commit comments

Comments
 (0)