Skip to content

Commit

Permalink
correctly implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Jun 6, 2024
1 parent 8725b0b commit 54f89e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/depiction_targeted_preproc/workflow/proc/pick_peaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 54f89e7

Please sign in to comment.