OpenMS
OfflinePrecursorIonSelection.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: Timo Sachsenberg $
6 // $Authors: Alexandra Zerck $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 
17 
18 namespace OpenMS
19 {
20  class PeptideIdentification;
21  class ProteinIdentification;
22  class String;
23 
24 
34  class OPENMS_DLLAPI OfflinePrecursorIonSelection :
35  public DefaultParamHandler
36  {
37 public:
38  typedef PSLPFormulation::IndexTriple IndexTriple;
39 
42 
53  const PeakMap& experiment,
54  PeakMap& ms2,
55  std::set<Int>& charges_set,
56  bool feature_based);
57 
65  void getMassRanges(const FeatureMap& features,
66  const PeakMap& experiment,
67  std::vector<std::vector<std::pair<Size, Size> > >& indices);
68 
69  void createProteinSequenceBasedLPInclusionList(String include, String rt_model_file, String pt_model_file, FeatureMap& precursors);
70 
72  {
73  solver_ = solver;
74  std::cout << " LPSolver set to " << solver_ << std::endl;
75  }
76 
78  {
79  return solver_;
80  }
81 
82 private:
83 
84  template <typename PairType>
86  {
87  bool operator()(const PairType & left, const PairType & right) const
88  {
89  return left.second < right.second;
90  }
91 
92  };
93 
94  typedef std::map<std::pair<double, double>, int, PairComparatorSecondElement<std::pair<double, double> > > ExclusionListType_;
95 
99  void calculateXICs_(const FeatureMap& features,
100  const std::vector<std::vector<std::pair<Size, Size> > >& mass_ranges,
101  const PeakMap& experiment,
102  const std::set<Int>& charges_set,
103  std::vector<std::vector<std::pair<Size, double> > >& xics);
104 
108  void checkMassRanges_(std::vector<std::vector<std::pair<Size, Size> > >& mass_ranges,
109  const PeakMap& experiment);
110 
112  void updateExclusionList_(ExclusionListType_& exclusion_list) const;
113 
115  };
116 
117 }
118 
119 
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
A container for features.
Definition: FeatureMap.h:80
SOLVER
Definition: LPWrapper.h:108
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:46
Implements different algorithms for precursor ion selection.
Definition: OfflinePrecursorIonSelection.h:36
std::map< std::pair< double, double >, int, PairComparatorSecondElement< std::pair< double, double > > > ExclusionListType_
Definition: OfflinePrecursorIonSelection.h:94
void setLPSolver(LPWrapper::SOLVER solver)
Definition: OfflinePrecursorIonSelection.h:71
void makePrecursorSelectionForKnownLCMSMap(const FeatureMap &features, const PeakMap &experiment, PeakMap &ms2, std::set< Int > &charges_set, bool feature_based)
Makes the precursor selection for a given feature map, either feature or scan based.
void calculateXICs_(const FeatureMap &features, const std::vector< std::vector< std::pair< Size, Size > > > &mass_ranges, const PeakMap &experiment, const std::set< Int > &charges_set, std::vector< std::vector< std::pair< Size, double > > > &xics)
Calculate the sum of intensities of relevant features for each scan separately.
void checkMassRanges_(std::vector< std::vector< std::pair< Size, Size > > > &mass_ranges, const PeakMap &experiment)
Eliminates overlapping peaks.
LPWrapper::SOLVER getLPSolver()
Definition: OfflinePrecursorIonSelection.h:77
void updateExclusionList_(ExclusionListType_ &exclusion_list) const
reduce scan count for each entry, and remove every entry which has reached 0 counts
void getMassRanges(const FeatureMap &features, const PeakMap &experiment, std::vector< std::vector< std::pair< Size, Size > > > &indices)
Calculates the mass ranges for each feature and stores them as indices of the raw data.
LPWrapper::SOLVER solver_
Definition: OfflinePrecursorIonSelection.h:114
void createProteinSequenceBasedLPInclusionList(String include, String rt_model_file, String pt_model_file, FeatureMap &precursors)
PSLPFormulation::IndexTriple IndexTriple
Definition: OfflinePrecursorIonSelection.h:38
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
Definition: OfflinePrecursorIonSelection.h:86
bool operator()(const PairType &left, const PairType &right) const
Definition: OfflinePrecursorIonSelection.h:87