Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various minor improvements #137

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading