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

Make fragment calibration configurable #323

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions alphadia/constants/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ calibration:
# TODO: remove this parameter
norm_rt_mode: 'linear'

# the maximum number of fragments with correlation scores exceeding correlation_threshold to use for calibrating fragment mz (i.e. ms2)
max_fragments: 5000

# the correlation threshold for fragments used to calibrate fragment mz (i.e. ms2)
min_correlation: 0.7

search_initial:
# Number of peak groups identified in the convolution score to classify with target decoy comeptition
initial_num_candidates: 1
Expand Down
7 changes: 5 additions & 2 deletions alphadia/workflow/peptidecentric.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,11 @@ def filter_dfs(self, precursor_df, fragments_df):
by="correlation", ascending=False
)
# Determine the number of fragments to keep
min_fragments, max_fragments = 500, 5000
min_correlation = 0.7
min_fragments, max_fragments = (
500,
self.config["calibration"]["max_fragments"],
) # TODO remove min_fragments as it seems to have no effect
min_correlation = self.config["calibration"]["min_correlation"]

high_corr_count = (fragments_df_filtered["correlation"] > min_correlation).sum()
stop_rank = min(max(high_corr_count, min_fragments), max_fragments)
Expand Down
Loading