From 333019dffe290e6a227e6ac581fb8d74771ebfb4 Mon Sep 17 00:00:00 2001 From: Leonardo Schwarz Date: Mon, 26 Aug 2024 13:22:06 +0200 Subject: [PATCH] fix bug when setting the filtering none --- .../spectrum/peak_picking/findmf_peak_picker.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/depiction/spectrum/peak_picking/findmf_peak_picker.py b/src/depiction/spectrum/peak_picking/findmf_peak_picker.py index d3952c8..e002b44 100644 --- a/src/depiction/spectrum/peak_picking/findmf_peak_picker.py +++ b/src/depiction/spectrum/peak_picking/findmf_peak_picker.py @@ -37,9 +37,12 @@ def pick_peaks( area=self.area, max_peaks=self.max_peaks, ) - return self.peak_filtering.filter_peaks( - spectrum_mz_arr=mz_arr, - spectrum_int_arr=int_arr, - peak_mz_arr=peak_mz_arr, - peak_int_arr=peak_int_arr, - ) + if self.peak_filtering is not None: + return self.peak_filtering.filter_peaks( + spectrum_mz_arr=mz_arr, + spectrum_int_arr=int_arr, + peak_mz_arr=peak_mz_arr, + peak_int_arr=peak_int_arr, + ) + else: + return peak_mz_arr, peak_int_arr