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 
18 
19 // Kernel classes
28 
30 
31 #ifdef _OPENMP
32 #include <omp.h>
33 #endif
34 
35 bool SortDoubleDoublePairFirst(const std::pair<double, double>& left, const std::pair<double, double>& right);
36 
37 namespace OpenMS
38 {
39 
62  class OPENMS_DLLAPI MRMFeatureFinderScoring :
63  public DefaultParamHandler,
64  public ProgressLogger
65  {
66 
67 public:
69 
75  // a transition group holds the chromatographic data and peaks across
76  // multiple chromatograms from the same compound
78  typedef std::map<String, MRMTransitionGroupType> TransitionGroupMapType;
79 
81 
84 
87 
89 
90 
104  void pickExperiment(const PeakMap & chromatograms,
105  FeatureMap& output,
106  const TargetedExperiment& transition_exp,
107  const TransformationDescription& trafo,
108  const PeakMap& swath_map);
109 
125  FeatureMap& output,
126  const OpenSwath::LightTargetedExperiment& transition_exp,
127  const TransformationDescription& trafo,
128  const std::vector<OpenSwath::SwathMap>& swath_maps,
129  TransitionGroupMapType& transition_group_map);
130 
140 
158  void scorePeakgroups(MRMTransitionGroupType& transition_group,
159  const TransformationDescription & trafo,
160  const std::vector<OpenSwath::SwathMap>& swath_maps,
161  FeatureMap& output,
162  bool ms1only = false) const;
163 
166  void setStrictFlag(bool f)
167  {
168  strict_ = f;
169  }
170 
181  {
182  ms1_map_ = ms1_map;
183  }
184 
201  const OpenSwath::LightTargetedExperiment& transition_exp,
202  TransitionGroupMapType& transition_group_map,
204  double rt_extraction_window);
205 private:
206 
215  MRMTransitionGroupType& transition_group_detection) const;
216 
227  MRMTransitionGroupType& transition_group_identification,
228  MRMTransitionGroupType& transition_group_identification_decoy) const;
229 
247  OpenSwathScoring& scorer,
248  const size_t feature_idx,
249  const std::vector<std::string> & native_ids_detection,
250  const double det_intensity_ratio_score,
251  const double det_mi_ratio_score,
252  const std::vector<OpenSwath::SwathMap>& swath_maps) const;
253 
254  void prepareFeatureOutput_(OpenMS::MRMFeature& mrmfeature, bool ms1only, int charge) const;
255 
257  void updateMembers_() override;
258 
259  // parameters
264  bool strict_;
267 
268  // scoring parameters
275 
276  double sn_win_len_;
277  unsigned int sn_bin_count_;
279 
281 
282  // members
283  std::map<OpenMS::String, const PeptideType*> PeptideRefMap_;
287 
288  // data
290 
291  };
292 }
293 
294 #undef run_identifier
295 
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:65
MRMTransitionGroup< MSChromatogram, TransitionType > MRMTransitionGroupType
Definition: MRMFeatureFinderScoring.h:77
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:264
OpenSwath::LightProtein ProteinType
Definition: MRMFeatureFinderScoring.h:73
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:270
double sn_win_len_
Definition: MRMFeatureFinderScoring.h:276
double spacing_for_spectra_resampling_
Definition: MRMFeatureFinderScoring.h:272
OpenMS::EmgScoring emgscoring_
Definition: MRMFeatureFinderScoring.h:286
int stop_report_after_feature_
Definition: MRMFeatureFinderScoring.h:262
OpenSwath::LightCompound PeptideType
Definition: MRMFeatureFinderScoring.h:72
OpenMS::DIAScoring diascoring_
Definition: MRMFeatureFinderScoring.h:285
bool write_convex_hull_
Definition: MRMFeatureFinderScoring.h:263
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:283
OpenSwath::SpectrumAccessPtr ms1_map_
Definition: MRMFeatureFinderScoring.h:289
OpenSwath::LightTransition TransitionType
Type definitions.
Definition: MRMFeatureFinderScoring.h:70
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:180
double rt_normalization_factor_
Definition: MRMFeatureFinderScoring.h:269
OpenSwath_Scores_Usage su_
Definition: MRMFeatureFinderScoring.h:284
double uis_threshold_sn_
Definition: MRMFeatureFinderScoring.h:273
double quantification_cutoff_
Definition: MRMFeatureFinderScoring.h:261
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:166
unsigned int sn_bin_count_
Definition: MRMFeatureFinderScoring.h:277
double uis_threshold_peak_area_
Definition: MRMFeatureFinderScoring.h:274
String spectrum_addition_method_
Definition: MRMFeatureFinderScoring.h:271
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:71
bool write_log_messages_
Definition: MRMFeatureFinderScoring.h:278
void updateMembers_() override
Synchronize members with param class.
bool use_ms1_ion_mobility_
Definition: MRMFeatureFinderScoring.h:265
std::map< String, MRMTransitionGroupType > TransitionGroupMapType
Definition: MRMFeatureFinderScoring.h:78
double rt_extraction_window_
Definition: MRMFeatureFinderScoring.h:260
OpenSwath::LightModification ModificationType
Definition: MRMFeatureFinderScoring.h:74
void prepareFeatureOutput_(OpenMS::MRMFeature &mrmfeature, bool ms1only, int charge) const
double im_extra_drift_
Definition: MRMFeatureFinderScoring.h:280
String scoring_model_
Definition: MRMFeatureFinderScoring.h:266
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
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:165
Definition: TransitionExperiment.h:127
Definition: TransitionExperiment.h:185
Definition: TransitionExperiment.h:20