OpenMS
MRMScoring.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Hannes Roest $a
6 // $Authors: Hannes Roest $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <string>
12 
14 #include <OpenMS/OPENSWATHALGO/OpenSwathAlgoConfig.h>
15 
21 
22 namespace OpenSwath
23 {
24 
46  class OPENMS_DLLAPI MRMScoring
47  {
48 
49  public:
51 
56 
61 
62  typedef boost::shared_ptr<OpenSwath::IFeature> FeatureType;
64 
70 
74 
78 
82 
85 
87  void initializeXCorrMatrix(const std::vector< std::vector< double > >& data);
88 
90  void initializeXCorrMatrix(OpenSwath::IMRMFeature* mrmfeature, const std::vector<std::string>& native_ids);
91 
93  void initializeXCorrContrastMatrix(OpenSwath::IMRMFeature* mrmfeature, const std::vector<std::string>& native_ids_set1, const std::vector<std::string>& native_ids_set2);
94 
96  void initializeXCorrPrecursorMatrix(OpenSwath::IMRMFeature* mrmfeature, const std::vector<std::string>& precursor_ids);
97 
99  void initializeXCorrPrecursorContrastMatrix(OpenSwath::IMRMFeature* mrmfeature, const std::vector<std::string>& precursor_ids, const std::vector<std::string>& native_ids);
100 
102  void initializeXCorrPrecursorContrastMatrix(const std::vector< std::vector< double > >& data_precursor, const std::vector< std::vector< double > >& data_fragments);
103 
105  void initializeXCorrPrecursorCombinedMatrix(OpenSwath::IMRMFeature* mrmfeature, const std::vector<std::string>& precursor_ids, const std::vector<std::string>& native_ids);
106 
113 
121  double calcXcorrCoelutionWeightedScore(const std::vector<double>& normalized_library_intensity);
122 
125 
128 
131 
138 
146 
149 
157 
166  double calcXcorrShapeWeightedScore(const std::vector<double>& normalized_library_intensity);
167 
170 
172  std::vector<double> calcSeparateXcorrContrastShapeScore();
173 
176 
179 
187 
190 
192  static void calcLibraryScore(OpenSwath::IMRMFeature* mrmfeature,
193  const std::vector<TransitionType>& transitions, double& correlation,
194  double& norm_manhattan, double& manhattan, double& dotprod,
195  double& spectral_angle, double& rmsd);
196 
198  static double calcRTScore(const PeptideType& peptide, double normalized_experimental_rt);
199 
201  // using a vector of SignalToNoiseEstimatorMedian that were calculated for
202  // each chromatogram of the transition_group.
203  static double calcSNScore(OpenSwath::IMRMFeature* mrmfeature,
204  std::vector<OpenSwath::ISignalToNoisePtr>& signal_noise_estimators);
205 
206  static std::vector<double> calcSeparateSNScore(OpenSwath::IMRMFeature* mrmfeature,
207  std::vector<OpenSwath::ISignalToNoisePtr>& signal_noise_estimators);
208 
212 
216 
220 
224 
226  void initializeMIMatrix(OpenSwath::IMRMFeature* mrmfeature, const std::vector<std::string>& native_ids);
227 
229  void initializeMIContrastMatrix(OpenSwath::IMRMFeature* mrmfeature, const std::vector<std::string>& native_ids_set1, const std::vector<std::string>& native_ids_set2);
230 
232  void initializeMIPrecursorMatrix(OpenSwath::IMRMFeature* mrmfeature, const std::vector<std::string>& precursor_ids);
233 
235  void initializeMIPrecursorContrastMatrix(OpenSwath::IMRMFeature* mrmfeature, const std::vector<std::string>& precursor_ids, const std::vector<std::string>& native_ids);
236 
238  void initializeMIPrecursorCombinedMatrix(OpenSwath::IMRMFeature* mrmfeature, const std::vector<std::string>& precursor_ids, const std::vector<std::string>& native_ids);
239 
240  double calcMIScore();
241  double calcMIWeightedScore(const std::vector<double>& normalized_library_intensity);
245  std::vector<double> calcSeparateMIContrastScore();
246 
248 
249  private:
254 
258 
262 
265 
268 
272 
276 
278 
282 
285 
289 
293  };
294 }
Definition: ITransition.h:31
This class implements different scores for peaks found in SRM/MRM.
Definition: MRMScoring.h:47
const XCorrMatrixType & getXCorrContrastMatrix() const
non-mutable access to the cross-correlation contrast matrix
const OpenMS::Matrix< double > & getMIMatrix() const
non-mutable access to the MI matrix
double calcMIPrecursorCombinedScore()
double calcXcorrCoelutionWeightedScore(const std::vector< double > &normalized_library_intensity)
Calculate the weighted cross-correlation coelution score.
XCorrMatrixType xcorr_precursor_combined_matrix_
the precomputed cross correlation with the MS1 trace
Definition: MRMScoring.h:274
OpenSwath::LightProtein ProteinType
Definition: MRMScoring.h:60
void initializeMIPrecursorMatrix(OpenSwath::IMRMFeature *mrmfeature, const std::vector< std::string > &precursor_ids)
Initialize the scoring object and building the MI matrix.
double calcMIPrecursorContrastScore()
OpenMS::Matrix< double > mi_precursor_contrast_matrix_
the precomputed contrast mutual information matrix against the MS1 trace
Definition: MRMScoring.h:287
void initializeXCorrMatrix(OpenSwath::IMRMFeature *mrmfeature, const std::vector< std::string > &native_ids)
Initialize the scoring object and building the cross-correlation matrix.
OpenMS::Matrix< double > xcorr_contrast_matrix_max_peak_sec_
contains max Peaks from xcorr_contrast_matrix_
Definition: MRMScoring.h:264
const OpenMS::Matrix< double > & getMIPrecursorCombinedMatrix() const
non-mutable access to the MI precursor combined matrix
OpenMS::Matrix< double > mi_precursor_matrix_
the precomputed mutual information matrix of the MS1 trace
Definition: MRMScoring.h:284
const XCorrMatrixType & getXCorrMatrix() const
non-mutable access to the cross-correlation matrix
OpenMS::Matrix< XCorrArrayType > XCorrMatrixType
Cross Correlation matrix.
Definition: MRMScoring.h:55
const OpenMS::Matrix< double > & getMIPrecursorContrastMatrix() const
non-mutable access to the MI precursor contrast matrix
void initializeXCorrPrecursorCombinedMatrix(OpenSwath::IMRMFeature *mrmfeature, const std::vector< std::string > &precursor_ids, const std::vector< std::string > &native_ids)
Initialize the scoring object and building the cross-correlation matrix of chromatograms of precursor...
OpenMS::Matrix< int > xcorr_matrix_max_peak_
contains max Peaks from xcorr_matrix_
Definition: MRMScoring.h:256
std::vector< double > calcSeparateMIContrastScore()
void initializeXCorrPrecursorContrastMatrix(const std::vector< std::vector< double > > &data_precursor, const std::vector< std::vector< double > > &data_fragments)
Initialize the scoring object and building the cross-correlation matrix of chromatograms of precursor...
XCorrMatrixType xcorr_matrix_
the precomputed cross correlation matrix
Definition: MRMScoring.h:253
static std::vector< double > calcSeparateSNScore(OpenSwath::IMRMFeature *mrmfeature, std::vector< OpenSwath::ISignalToNoisePtr > &signal_noise_estimators)
boost::shared_ptr< OpenSwath::IFeature > FeatureType
Definition: MRMScoring.h:62
double calcMIWeightedScore(const std::vector< double > &normalized_library_intensity)
double calcXcorrContrastShapeScore()
calculate the cross-correlation contrast shape score
std::vector< double > calcSeparateXcorrContrastCoelutionScore()
calculate the separate cross-correlation contrast score
OpenSwath::LightCompound PeptideType
Definition: MRMScoring.h:59
OpenMS::Matrix< double > mi_matrix_
the precomputed mutual information matrix
Definition: MRMScoring.h:279
const OpenMS::Matrix< double > & getMIContrastMatrix() const
non-mutable access to the MI contrast matrix
void initializeXCorrContrastMatrix(OpenSwath::IMRMFeature *mrmfeature, const std::vector< std::string > &native_ids_set1, const std::vector< std::string > &native_ids_set2)
Initialize the scoring object and building the cross-correlation matrix of chromatograms of set1 (e....
double calcXcorrPrecursorShapeScore()
calculate the precursor cross-correlation shape score
double calcXcorrShapeWeightedScore(const std::vector< double > &normalized_library_intensity)
Calculate the weighted cross-correlation shape score.
double calcXcorrCoelutionScore()
Calculate the cross-correlation coelution score.
void initializeMIContrastMatrix(OpenSwath::IMRMFeature *mrmfeature, const std::vector< std::string > &native_ids_set1, const std::vector< std::string > &native_ids_set2)
Initialize the scoring object and building the MI matrix of chromatograms of set1 (e....
double calcXcorrPrecursorCombinedCoelutionScore()
calculate the precursor cross-correlation coelution score including the transitions
std::vector< double > calcSeparateXcorrContrastShapeScore()
calculate the separate cross-correlation contrast shape score
void initializeXCorrPrecursorContrastMatrix(OpenSwath::IMRMFeature *mrmfeature, const std::vector< std::string > &precursor_ids, const std::vector< std::string > &native_ids)
Initialize the scoring object and building the cross-correlation matrix of chromatograms of precursor...
OpenSwath::LightTransition TransitionType
Definition: MRMScoring.h:58
double calcXcorrPrecursorContrastSumFragShapeScore()
Calculate the precursor cross-correlation contrast score against the sum of transitions implemented t...
XCorrMatrixType xcorr_precursor_contrast_matrix_
the precomputed cross correlation against the MS1 trace
Definition: MRMScoring.h:270
OpenSwath::SpectrumPtr SpectrumType
Definition: MRMScoring.h:57
XCorrMatrixType xcorr_precursor_matrix_
the precomputed cross correlation matrix of the MS1 trace
Definition: MRMScoring.h:267
double calcXcorrPrecursorCoelutionScore()
calculate the precursor cross-correlation contrast score
double calcXcorrPrecursorContrastSumFragCoelutionScore()
Calculate the precursor cross-correlation contrast score against the sum of transitions implemented t...
void initializeMIMatrix(OpenSwath::IMRMFeature *mrmfeature, const std::vector< std::string > &native_ids)
Initialize the scoring object and building the MI matrix.
double calcMIPrecursorScore()
double calcXcorrPrecursorContrastShapeScore()
calculate the precursor cross-correlation shape score against the transitions
double calcXcorrShapeScore()
Calculate the cross-correlation shape score.
double calcXcorrPrecursorCombinedShapeScore()
calculate the precursor cross-correlation shape score including the transitions
void initializeXCorrMatrix(const std::vector< std::vector< double > > &data)
Initialize the scoring object and building the cross-correlation matrix.
const XCorrMatrixType & getXCorrPrecursorCombinedMatrix() const
non-mutable access to the cross-correlation precursor contrast matrix
void initializeMIPrecursorContrastMatrix(OpenSwath::IMRMFeature *mrmfeature, const std::vector< std::string > &precursor_ids, const std::vector< std::string > &native_ids)
Initialize the mutual information vector against the MS1 trace.
static double calcSNScore(OpenSwath::IMRMFeature *mrmfeature, std::vector< OpenSwath::ISignalToNoisePtr > &signal_noise_estimators)
calculate the Signal to Noise ratio
OpenMS::Matrix< double > mi_contrast_matrix_
the precomputed contrast mutual information matrix
Definition: MRMScoring.h:281
OpenMS::Matrix< double > xcorr_matrix_max_peak_sec_
Definition: MRMScoring.h:257
XCorrMatrixType xcorr_contrast_matrix_
the precomputed contrast cross correlation
Definition: MRMScoring.h:260
double calcXcorrContrastCoelutionScore()
calculate the cross-correlation contrast score
OpenMS::Matrix< double > mi_precursor_combined_matrix_
the precomputed contrast mutual information matrix with the MS1 trace
Definition: MRMScoring.h:291
void initializeXCorrPrecursorMatrix(OpenSwath::IMRMFeature *mrmfeature, const std::vector< std::string > &precursor_ids)
Initialize the scoring object and building the cross-correlation matrix.
static double calcRTScore(const PeptideType &peptide, double normalized_experimental_rt)
calculate the retention time correlation score
void initializeMIPrecursorCombinedMatrix(OpenSwath::IMRMFeature *mrmfeature, const std::vector< std::string > &precursor_ids, const std::vector< std::string > &native_ids)
Initialize the mutual information vector with the MS1 trace.
static void calcLibraryScore(OpenSwath::IMRMFeature *mrmfeature, const std::vector< TransitionType > &transitions, double &correlation, double &norm_manhattan, double &manhattan, double &dotprod, double &spectral_angle, double &rmsd)
calculate the library correlation score
double calcXcorrPrecursorContrastCoelutionScore()
Calculate the precursor cross-correlation contrast score against the transitions.
const XCorrMatrixType & getXCorrPrecursorContrastMatrix() const
non-mutable access to the cross-correlation precursor contrast matrix
Definition: Scoring.h:18
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:270
Definition: TransitionExperiment.h:179
Definition: TransitionExperiment.h:127
Definition: TransitionExperiment.h:20
Definition: Scoring.h:46