diff --git a/src/depiction/spectrum/peak_picking/ms_peak_picker_wrapper.py b/src/depiction/spectrum/peak_picking/ms_peak_picker_wrapper.py index 293186c..cb059b1 100644 --- a/src/depiction/spectrum/peak_picking/ms_peak_picker_wrapper.py +++ b/src/depiction/spectrum/peak_picking/ms_peak_picker_wrapper.py @@ -5,12 +5,8 @@ from dataclasses import dataclass from typing import TYPE_CHECKING -import loguru import ms_peak_picker import numpy as np -import scipy - -from depiction.spectrum.peak_picking.basic_peak_picker import BasicPeakPicker if TYPE_CHECKING: from numpy.typing import NDArray @@ -31,7 +27,7 @@ def pick_peaks(self, mz_arr: NDArray[float], int_arr: NDArray[float]) -> tuple[N peak_mz = np.array([peak.mz for peak in peak_list]) peak_int = np.array([peak.intensity for peak in peak_list]) - if self.peak_filtering is not None: + if self.peak_filtering is not None and len(peak_mz) > 0: peak_mz, peak_int = self.peak_filtering.filter_peaks( spectrum_mz_arr=mz_arr, spectrum_int_arr=int_arr, diff --git a/src/depiction_targeted_preproc/workflow/proc/pick_peaks.py b/src/depiction_targeted_preproc/workflow/proc/pick_peaks.py index cfdfb95..e8c70a8 100644 --- a/src/depiction_targeted_preproc/workflow/proc/pick_peaks.py +++ b/src/depiction_targeted_preproc/workflow/proc/pick_peaks.py @@ -22,8 +22,8 @@ def proc_pick_peaks( ) -> None: config = PipelineParameters.parse_yaml(config_path) - # TODO configurable - peak_filtering = FilterNHighestIntensityPartitioned(max_count=200, n_partitions=8), + # TODO configurable filtering + peak_filtering = FilterNHighestIntensityPartitioned(max_count=200, n_partitions=8) parallel_config = ParallelConfig(n_jobs=config.n_jobs, task_size=None) match config.peak_picker: