OpenMS
OpenSwathScores.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Hannes Roest $
6 // $Authors: Hannes Roest $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <OpenMS/OpenMSConfig.h>
12 #include <OpenMS/CONCEPT/Types.h>
13 
15 #include <vector>
16 
17 namespace OpenMS
18 {
19 
24  struct OPENMS_DLLAPI OpenSwath_Scores_Usage
25  {
26  bool use_coelution_score_ = true;
27  bool use_shape_score_ = true;
28  bool use_rt_score_ = true;
29  bool use_library_score_ = true;
30  bool use_elution_model_score_ = true;
31  bool use_intensity_score_ = true;
32  bool use_total_xic_score_ = true;
33  bool use_total_mi_score_ = true;
34  bool use_nr_peaks_score_ = true;
35  bool use_sn_score_ = true;
36  bool use_mi_score_ = true;
37  bool use_dia_scores_ = true;
38  bool use_im_scores = true;
39  bool use_ms1_correlation = true;
40  bool use_ms1_fullscan = true;
41  bool use_ms1_mi = true;
42  bool use_uis_scores = true;
43  bool use_ionseries_scores = true;
44  bool use_ms2_isotope_scores = true;
45  bool use_peak_shape_metrics = false;
46  };
47 
56  struct OPENMS_DLLAPI OpenSwath_Scores
57  {
58  double elution_model_fit_score = 0;
59  double library_corr = 0;
60  double library_norm_manhattan = 0;
61  double library_rootmeansquare = 0;
62  double library_sangle = 0;
63  double norm_rt_score = 0;
64 
65  double isotope_correlation = 0;
66  double isotope_overlap = 0;
67  double massdev_score = 0;
68  double xcorr_coelution_score = 0;
69  double xcorr_shape_score = 0;
70 
71  double yseries_score = 0;
72  double bseries_score = 0;
73  double log_sn_score = 0;
74 
75  double weighted_coelution_score = 0;
76  double weighted_xcorr_shape = 0;
77  double weighted_massdev_score = 0;
78 
79  double ms1_xcorr_coelution_score = -1;
80  double ms1_xcorr_coelution_contrast_score = 0;
81  double ms1_xcorr_coelution_combined_score = 0;
82  double ms1_xcorr_shape_score = -1;
83  double ms1_xcorr_shape_contrast_score = 0;
84  double ms1_xcorr_shape_combined_score = 0;
85  double ms1_ppm_score = 0;
86  double ms1_isotope_correlation = 0;
87  double ms1_isotope_overlap = 0;
88  double ms1_mi_score = -1;
89  double ms1_mi_contrast_score = 0;
90  double ms1_mi_combined_score = 0;
91 
92  double im_xcorr_coelution_score = 0;
93  double im_xcorr_shape_score = 0;
94  double im_delta_score = 0;
95  double im_ms1_delta_score = 0;
96  double im_drift = 0;
97  double im_drift_weighted = 0;
98  double im_delta = -1;
99  double im_ms1_contrast_coelution = 0;
100  double im_ms1_contrast_shape = 0;
101  double im_ms1_sum_contrast_coelution = 0;
102  double im_ms1_sum_contrast_shape = 0;
103  double im_ms1_drift = 0;
104  double im_ms1_delta = -1;
105 
106  double library_manhattan = 0;
107  double library_dotprod = 0;
108  double intensity = 0;
109  double total_xic = 0;
110  double nr_peaks = 0;
111  double sn_ratio = 0;
112  double mi_score = 0;
113  double weighted_mi_score = 0;
114 
115  double rt_difference = 0;
116  double normalized_experimental_rt = 0;
117  double raw_rt_score = 0;
118 
119  double dotprod_score_dia = 0;
120  double manhatt_score_dia = 0;
121 
122  OpenSwath_Scores() = default;
123 
124  double get_quick_lda_score(double library_corr_,
125  double library_norm_manhattan_,
126  double norm_rt_score_,
127  double xcorr_coelution_score_,
128  double xcorr_shape_score_,
129  double log_sn_score_) const;
130 
141  double calculate_lda_prescore(const OpenSwath_Scores& scores) const;
142 
152 
160  double calculate_swath_lda_prescore(const OpenSwath_Scores& scores) const;
161 
162  };
163 
164  struct OPENMS_DLLAPI OpenSwath_Ind_Scores
165  {
166  int ind_num_transitions = 0;
167  std::vector<OpenMS::String> ind_transition_names;
168  std::vector<double> ind_isotope_correlation;
169  std::vector<double> ind_isotope_overlap;
170  std::vector<double> ind_massdev_score;
171  std::vector<double> ind_xcorr_coelution_score;
172  std::vector<double> ind_xcorr_shape_score;
173  std::vector<double> ind_log_sn_score;
174  std::vector<double> ind_area_intensity;
175  std::vector<double> ind_total_area_intensity;
176  std::vector<double> ind_intensity_score;
177  std::vector<double> ind_apex_intensity;
178  std::vector<double> ind_apex_position;
179  std::vector<double> ind_fwhm;
180  std::vector<double> ind_total_mi;
181  std::vector<double> ind_log_intensity;
182  std::vector<double> ind_intensity_ratio;
183  std::vector<double> ind_mi_ratio;
184  std::vector<double> ind_mi_score;
185 
186  // peak shape metrics
187  std::vector<double> ind_start_position_at_5;
188  std::vector<double> ind_end_position_at_5;
189  std::vector<double> ind_start_position_at_10;
190  std::vector<double> ind_end_position_at_10;
191  std::vector<double> ind_start_position_at_50;
192  std::vector<double> ind_end_position_at_50;
193  std::vector<double> ind_total_width;
194  std::vector<double> ind_tailing_factor;
195  std::vector<double> ind_asymmetry_factor;
196  std::vector<double> ind_slope_of_baseline;
197  std::vector<double> ind_baseline_delta_2_height;
198  std::vector<double> ind_points_across_baseline;
199  std::vector<double> ind_points_across_half_height;
200 
201  OpenSwath_Ind_Scores() = default;
202 
203  };
204 
205 }
206 
207 
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
A structure to store which scores should be used by the OpenSWATH Algorithm.
Definition: OpenSwathScores.h:25
Definition: OpenSwathScores.h:165
std::vector< double > ind_end_position_at_50
Definition: OpenSwathScores.h:192
std::vector< double > ind_asymmetry_factor
Definition: OpenSwathScores.h:195
std::vector< double > ind_isotope_overlap
Definition: OpenSwathScores.h:169
std::vector< OpenMS::String > ind_transition_names
Definition: OpenSwathScores.h:167
std::vector< double > ind_xcorr_shape_score
Definition: OpenSwathScores.h:172
std::vector< double > ind_points_across_half_height
Definition: OpenSwathScores.h:199
std::vector< double > ind_slope_of_baseline
Definition: OpenSwathScores.h:196
std::vector< double > ind_xcorr_coelution_score
Definition: OpenSwathScores.h:171
std::vector< double > ind_start_position_at_5
Definition: OpenSwathScores.h:187
std::vector< double > ind_massdev_score
Definition: OpenSwathScores.h:170
std::vector< double > ind_apex_position
Definition: OpenSwathScores.h:178
std::vector< double > ind_tailing_factor
Definition: OpenSwathScores.h:194
std::vector< double > ind_intensity_ratio
Definition: OpenSwathScores.h:182
std::vector< double > ind_start_position_at_10
Definition: OpenSwathScores.h:189
std::vector< double > ind_end_position_at_5
Definition: OpenSwathScores.h:188
std::vector< double > ind_total_width
Definition: OpenSwathScores.h:193
std::vector< double > ind_total_mi
Definition: OpenSwathScores.h:180
std::vector< double > ind_end_position_at_10
Definition: OpenSwathScores.h:190
std::vector< double > ind_log_intensity
Definition: OpenSwathScores.h:181
std::vector< double > ind_total_area_intensity
Definition: OpenSwathScores.h:175
std::vector< double > ind_apex_intensity
Definition: OpenSwathScores.h:177
std::vector< double > ind_log_sn_score
Definition: OpenSwathScores.h:173
std::vector< double > ind_mi_ratio
Definition: OpenSwathScores.h:183
std::vector< double > ind_mi_score
Definition: OpenSwathScores.h:184
std::vector< double > ind_start_position_at_50
Definition: OpenSwathScores.h:191
std::vector< double > ind_isotope_correlation
Definition: OpenSwathScores.h:168
std::vector< double > ind_fwhm
Definition: OpenSwathScores.h:179
std::vector< double > ind_points_across_baseline
Definition: OpenSwathScores.h:198
std::vector< double > ind_baseline_delta_2_height
Definition: OpenSwathScores.h:197
std::vector< double > ind_area_intensity
Definition: OpenSwathScores.h:174
std::vector< double > ind_intensity_score
Definition: OpenSwathScores.h:176
A structure to hold the different scores computed by OpenSWATH.
Definition: OpenSwathScores.h:57
double calculate_swath_lda_prescore(const OpenSwath_Scores &scores) const
A full LDA model using DIA and non-DIA scores.
double calculate_lda_single_transition(const OpenSwath_Scores &scores) const
A scoring model for peak groups with a single transition.
double calculate_lda_prescore(const OpenSwath_Scores &scores) const
A quick LDA model based non-DIA scores.
double get_quick_lda_score(double library_corr_, double library_norm_manhattan_, double norm_rt_score_, double xcorr_coelution_score_, double xcorr_shape_score_, double log_sn_score_) const