OpenMS  3.0.0
CompNovoIonScoringBase.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2022.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Timo Sachsenberg $
32 // $Authors: Andreas Bertsch $
33 // --------------------------------------------------------------------------
34 
35 
36 #pragma once
37 
38 // OpenMS includes
42 
43 // stl includes
44 #include <vector>
45 #include <map>
46 
47 namespace OpenMS
48 {
54  class OPENMS_DLLAPI CompNovoIonScoringBase :
55  public DefaultParamHandler
56  {
57 
58 public:
59 
61  {
62  PARENT = 0,
63  CHILD = 1,
64  LONE = 2
65  };
66 
67  struct OPENMS_DLLAPI IonScore
68  {
69  IonScore();
70 
71  IonScore(const IonScore & rhs);
72 
73  virtual ~IonScore();
74 
75  IonScore & operator=(const IonScore & rhs);
76 
77 
78  double score;
79  double s_bion;
80  double s_yion;
81  double s_witness;
82  double position;
86  };
87 
88 
94 
97 
99  ~CompNovoIonScoringBase() override;
101 
103  CompNovoIonScoringBase & operator=(const CompNovoIonScoringBase & source);
104 
108  double scoreIsotopes(const PeakSpectrum & CID_spec, PeakSpectrum::ConstIterator it, Size charge);
110 
111 protected:
112 
114  void updateMembers_() override;
115 
116 
117  IsotopeType classifyIsotopes_(const PeakSpectrum & spec, PeakSpectrum::ConstIterator it) const;
118 
119  double scoreIsotopes_(const PeakSpectrum & spec, PeakSpectrum::ConstIterator it, std::map<double, IonScore> & CID_nodes, Size charge = 1);
120 
121  virtual void scoreWitnessSet_(Size charge, double precursor_weight, std::map<double, IonScore> & CID_nodes, const PeakSpectrum & CID_orig_spec) = 0;
122 
123  void addSingleChargedIons_(std::map<double, IonScore> & ion_scores, PeakSpectrum & CID_spec);
124 
125  void initIsotopeDistributions_();
126 
128  std::map<Size, std::vector<double> > isotope_distributions_;
129 
131 
132 public:
133 
134  };
135 
136 }
137 
DefaultParamHandler.h
OpenMS::CompNovoIonScoringBase::IonScore::position
double position
Definition: CompNovoIonScoringBase.h:82
OpenMS::CompNovoIonScoringBase::IonScore::s_isotope_pattern_2
double s_isotope_pattern_2
"" charge 2
Definition: CompNovoIonScoringBase.h:85
OpenMS::CompNovoIonScoringBase::IonScore::s_yion
double s_yion
Definition: CompNovoIonScoringBase.h:80
OpenMS::CompNovoIonScoringBase
run with CompNovoIonScoringBase
Definition: CompNovoIonScoringBase.h:54
OpenMS::CompNovoIonScoringBase::IsotopeType
IsotopeType
Definition: CompNovoIonScoringBase.h:60
OpenMS::CompNovoIonScoringBase::IonScore::s_isotope_pattern_1
double s_isotope_pattern_1
isotope pattern score charge 1
Definition: CompNovoIonScoringBase.h:83
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
OpenMS::CompNovoIonScoringBase::IonScore::is_isotope_1_mono
Int is_isotope_1_mono
0 means not tested, 1 mean is, -1 is tail of isotopes
Definition: CompNovoIonScoringBase.h:84
OpenMS::DefaultParamHandler
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
OpenMS::CompNovoIonScoringBase::IonScore
Definition: CompNovoIonScoringBase.h:67
OpenMS::Int
int Int
Signed integer type.
Definition: Types.h:102
OpenMS::CompNovoIonScoringBase::IonScore::s_bion
double s_bion
Definition: CompNovoIonScoringBase.h:79
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::CompNovoIonScoringBase::isotope_distributions_
std::map< Size, std::vector< double > > isotope_distributions_
Definition: CompNovoIonScoringBase.h:128
OpenMS::CompNovoIonScoringBase::fragment_mass_tolerance_
double fragment_mass_tolerance_
Definition: CompNovoIonScoringBase.h:130
MSExperiment.h
OpenMS::CompNovoIonScoringBase::IonScore::s_witness
double s_witness
Definition: CompNovoIonScoringBase.h:81
OpenMS::MSSpectrum::ConstIterator
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:130
OpenMS::MSSpectrum
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
StandardTypes.h
OpenMS::CompNovoIonScoringBase::IonScore::score
double score
Definition: CompNovoIonScoringBase.h:78