OpenMS
MRMFeatureFinderScoring.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 #define USE_SP_INTERFACE
12 
13 // Actual scoring
15 
19 
20 // Kernel classes
29 
31 
32 #ifdef _OPENMP
33 #include <omp.h>
34 #endif
35 
36 bool SortDoubleDoublePairFirst(const std::pair<double, double>& left, const std::pair<double, double>& right);
37 
38 namespace OpenMS
39 {
40 
63  class OPENMS_DLLAPI MRMFeatureFinderScoring :
64  public DefaultParamHandler,
65  public ProgressLogger
66  {
67 
68 public:
70 
76  // a transition group holds the chromatographic data and peaks across
77  // multiple chromatograms from the same compound
79  typedef std::map<String, MRMTransitionGroupType> TransitionGroupMapType;
80 
82 
85 
88 
90 
91 
105  void pickExperiment(const PeakMap & chromatograms,
106  FeatureMap& output,
107  const TargetedExperiment& transition_exp,
108  const TransformationDescription& trafo,
109  const PeakMap& swath_map);
110 
126  FeatureMap& output,
127  const OpenSwath::LightTargetedExperiment& transition_exp,
128  const TransformationDescription& trafo,
129  const std::vector<OpenSwath::SwathMap>& swath_maps,
130  TransitionGroupMapType& transition_group_map);
131 
141 
159  void scorePeakgroups(MRMTransitionGroupType& transition_group,
160  const TransformationDescription & trafo,
161  const std::vector<OpenSwath::SwathMap>& swath_maps,
162  FeatureMap& output,
163  bool ms1only = false) const;
164 
167  void setStrictFlag(bool f)
168  {
169  strict_ = f;
170  }
171 
182  {
183  ms1_map_ = ms1_map;
184  }
185 
202  const OpenSwath::LightTargetedExperiment& transition_exp,
203  TransitionGroupMapType& transition_group_map,
205  double rt_extraction_window);
206 private:
207 
216  MRMTransitionGroupType& transition_group_detection) const;
217 
228  MRMTransitionGroupType& transition_group_identification,
229  MRMTransitionGroupType& transition_group_identification_decoy) const;
230 
248  OpenSwathScoring& scorer,
249  const size_t feature_idx,
250  const std::vector<std::string> & native_ids_detection,
251  const double det_intensity_ratio_score,
252  const double det_mi_ratio_score,
253  const std::vector<OpenSwath::SwathMap>& swath_maps) const;
254 
255  void prepareFeatureOutput_(OpenMS::MRMFeature& mrmfeature, bool ms1only, int charge) const;
256 
258  void updateMembers_() override;
259 
260  // parameters
265  bool strict_;
268 
269  // scoring parameters
276 
277  double sn_win_len_;
278  unsigned int sn_bin_count_;
280 
282 
283  // members
284  std::map<OpenMS::String, const PeptideType*> PeptideRefMap_;
289 
290  // data
292 
293  };
294 }
295 
296 #undef run_identifier
297 
bool SortDoubleDoublePairFirst(const std::pair< double, double > &left, const std::pair< double, double > &right)
Scoring of an spectrum at the peak apex of an chromatographic elution peak.
Definition: DIAScoring.h:63
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
Scoring of an elution peak using an exponentially modified gaussian distribution model.
Definition: EmgScoring.h:35
A container for features.
Definition: FeatureMap.h:80
The MRMFeatureFinder finds and scores peaks of transitions that co-elute.
Definition: MRMFeatureFinderScoring.h:66
MRMTransitionGroup< MSChromatogram, TransitionType > MRMTransitionGroupType
Definition: MRMFeatureFinderScoring.h:78
OpenSwath_Ind_Scores scoreIdentification_(MRMTransitionGroupType &transition_group_identification, OpenSwathScoring &scorer, const size_t feature_idx, const std::vector< std::string > &native_ids_detection, const double det_intensity_ratio_score, const double det_mi_ratio_score, const std::vector< OpenSwath::SwathMap > &swath_maps) const
Provides scoring for target and decoy identification against detecting transitions.
bool strict_
Definition: MRMFeatureFinderScoring.h:265
OpenSwath::LightProtein ProteinType
Definition: MRMFeatureFinderScoring.h:74
void mapExperimentToTransitionList(const OpenSwath::SpectrumAccessPtr &input, const OpenSwath::LightTargetedExperiment &transition_exp, TransitionGroupMapType &transition_group_map, TransformationDescription trafo, double rt_extraction_window)
Map the chromatograms to the transitions.
int add_up_spectra_
Definition: MRMFeatureFinderScoring.h:271
double sn_win_len_
Definition: MRMFeatureFinderScoring.h:277
double spacing_for_spectra_resampling_
Definition: MRMFeatureFinderScoring.h:273
OpenMS::EmgScoring emgscoring_
Definition: MRMFeatureFinderScoring.h:288
int stop_report_after_feature_
Definition: MRMFeatureFinderScoring.h:263
OpenMS::SONARScoring sonarscoring_
Definition: MRMFeatureFinderScoring.h:287
OpenSwath::LightCompound PeptideType
Definition: MRMFeatureFinderScoring.h:73
OpenMS::DIAScoring diascoring_
Definition: MRMFeatureFinderScoring.h:286
bool write_convex_hull_
Definition: MRMFeatureFinderScoring.h:264
void splitTransitionGroupsIdentification_(const MRMTransitionGroupType &transition_group, MRMTransitionGroupType &transition_group_identification, MRMTransitionGroupType &transition_group_identification_decoy) const
Splits combined transition groups into identification transition groups.
~MRMFeatureFinderScoring() override
Destructor.
std::map< OpenMS::String, const PeptideType * > PeptideRefMap_
Definition: MRMFeatureFinderScoring.h:284
OpenSwath::SpectrumAccessPtr ms1_map_
Definition: MRMFeatureFinderScoring.h:291
OpenSwath::LightTransition TransitionType
Type definitions.
Definition: MRMFeatureFinderScoring.h:71
void pickExperiment(const OpenSwath::SpectrumAccessPtr &input, FeatureMap &output, const OpenSwath::LightTargetedExperiment &transition_exp, const TransformationDescription &trafo, const std::vector< OpenSwath::SwathMap > &swath_maps, TransitionGroupMapType &transition_group_map)
Pick and score features in a single experiment from chromatograms.
void setMS1Map(OpenSwath::SpectrumAccessPtr ms1_map)
Add an MS1 map containing spectra.
Definition: MRMFeatureFinderScoring.h:181
double rt_normalization_factor_
Definition: MRMFeatureFinderScoring.h:270
OpenSwath_Scores_Usage su_
Definition: MRMFeatureFinderScoring.h:285
double uis_threshold_sn_
Definition: MRMFeatureFinderScoring.h:274
double quantification_cutoff_
Definition: MRMFeatureFinderScoring.h:262
void splitTransitionGroupsDetection_(const MRMTransitionGroupType &transition_group, MRMTransitionGroupType &transition_group_detection) const
Splits combined transition groups into detection transition groups.
void setStrictFlag(bool f)
Set the flag for strict mapping.
Definition: MRMFeatureFinderScoring.h:167
unsigned int sn_bin_count_
Definition: MRMFeatureFinderScoring.h:278
double uis_threshold_peak_area_
Definition: MRMFeatureFinderScoring.h:275
String spectrum_addition_method_
Definition: MRMFeatureFinderScoring.h:272
void scorePeakgroups(MRMTransitionGroupType &transition_group, const TransformationDescription &trafo, const std::vector< OpenSwath::SwathMap > &swath_maps, FeatureMap &output, bool ms1only=false) const
Score all peak groups of a transition group.
void pickExperiment(const PeakMap &chromatograms, FeatureMap &output, const TargetedExperiment &transition_exp, const TransformationDescription &trafo, const PeakMap &swath_map)
Picker and prepare functions.
void prepareProteinPeptideMaps_(const OpenSwath::LightTargetedExperiment &transition_exp)
Prepares the internal mappings of peptides and proteins.
OpenSwath::LightTargetedExperiment TargetedExpType
Definition: MRMFeatureFinderScoring.h:72
bool write_log_messages_
Definition: MRMFeatureFinderScoring.h:279
void updateMembers_() override
Synchronize members with param class.
bool use_ms1_ion_mobility_
Definition: MRMFeatureFinderScoring.h:266
std::map< String, MRMTransitionGroupType > TransitionGroupMapType
Definition: MRMFeatureFinderScoring.h:79
double rt_extraction_window_
Definition: MRMFeatureFinderScoring.h:261
OpenSwath::LightModification ModificationType
Definition: MRMFeatureFinderScoring.h:75
void prepareFeatureOutput_(OpenMS::MRMFeature &mrmfeature, bool ms1only, int charge) const
double im_extra_drift_
Definition: MRMFeatureFinderScoring.h:281
String scoring_model_
Definition: MRMFeatureFinderScoring.h:267
A multi-chromatogram MRM feature.
Definition: MRMFeature.h:26
The representation of a group of transitions in a targeted proteomics experiment.
Definition: MRMTransitionGroup.h:42
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:46
A class that calls the scoring routines.
Definition: OpenSwathScoring.h:40
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:27
Scoring of an spectrum using SONAR data.
Definition: SONARScoring.h:30
A more convenient string class.
Definition: String.h:34
A description of a targeted experiment containing precursor and production ions.
Definition: TargetedExperiment.h:39
Generic description of a coordinate transformation.
Definition: TransformationDescription.h:37
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
boost::shared_ptr< ISpectrumAccess > SpectrumAccessPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:131
Definition: TransitionExperiment.h:120
Definition: TransitionExperiment.h:179
Definition: OpenSwathScores.h:173
Definition: TransitionExperiment.h:127
Definition: TransitionExperiment.h:185
Definition: TransitionExperiment.h:20