Skip to content

Commit

Permalink
Merge pull request #323 from MannLabs/configure_ms2_fragment_number
Browse files Browse the repository at this point in the history
Make fragment calibration configurable
  • Loading branch information
odespard authored Aug 26, 2024
2 parents 470dac7 + 13c2058 commit ca14460
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
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

0 comments on commit ca14460

Please sign in to comment.