Skip to content

Commit

Permalink
Allow user to pass model_dir to MS²PIP in feature generator (fixes #134)
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfG committed Mar 28, 2024
1 parent 23dfa95 commit eea7ef9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ms2rescore/feature_generators/ms2pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def __init__(
ms2_tolerance: float = 0.02,
spectrum_path: Optional[str] = None,
spectrum_id_pattern: str = "(.*)",
model_dir: Optional[str] = None,
processes: 1,
**kwargs,
) -> None:
Expand All @@ -71,6 +72,8 @@ def __init__(
spectrum_id_pattern : str, optional
Regular expression pattern to extract spectrum ID from spectrum file. Defaults to
:py:const:`.*`.
model_dir
Directory containing MS²PIP models. Defaults to :py:const:`None` (use MS²PIP default).
processes : int, optional
Number of processes to use. Defaults to 1.
Expand All @@ -85,6 +88,7 @@ def __init__(
self.ms2_tolerance = ms2_tolerance
self.spectrum_path = spectrum_path
self.spectrum_id_pattern = spectrum_id_pattern
self.model_dir = model_dir
self.processes = processes

@property
Expand Down Expand Up @@ -194,6 +198,7 @@ def add_features(self, psm_list: PSMList) -> None:
model=self.model,
ms2_tolerance=self.ms2_tolerance,
compute_correlations=False,
model_dir=self.model_dir,
processes=self.processes,
)
except NoMatchingSpectraFound as e:
Expand Down

0 comments on commit eea7ef9

Please sign in to comment.