OpenMS  2.5.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-2020.
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 
46 namespace OpenMS
47 {
53  class OPENMS_DLLAPI CompNovoIonScoringBase :
54  public DefaultParamHandler
55  {
56 
57 public:
58 
60  {
61  PARENT = 0,
62  CHILD = 1,
63  LONE = 2
64  };
65 
66  struct OPENMS_DLLAPI IonScore
67  {
68  IonScore();
69 
70  IonScore(const IonScore & rhs);
71 
72  virtual ~IonScore();
73 
74  IonScore & operator=(const IonScore & rhs);
75 
76 
77  double score;
78  double s_bion;
79  double s_yion;
80  double s_witness;
81  double position;
85  };
86 
87 
93 
96 
98  ~CompNovoIonScoringBase() override;
100 
102  CompNovoIonScoringBase & operator=(const CompNovoIonScoringBase & source);
103 
107  double scoreIsotopes(const PeakSpectrum & CID_spec, PeakSpectrum::ConstIterator it, Size charge);
109 
110 protected:
111 
113  void updateMembers_() override;
114 
115 
116  IsotopeType classifyIsotopes_(const PeakSpectrum & spec, PeakSpectrum::ConstIterator it);
117 
118  double scoreIsotopes_(const PeakSpectrum & spec, PeakSpectrum::ConstIterator it, Map<double, IonScore> & CID_nodes, Size charge = 1);
119 
120  virtual void scoreWitnessSet_(Size charge, double precursor_weight, Map<double, IonScore> & CID_nodes, const PeakSpectrum & CID_orig_spec) = 0;
121 
122  void addSingleChargedIons_(Map<double, IonScore> & ion_scores, PeakSpectrum & CID_spec);
123 
124  void initIsotopeDistributions_();
125 
128 
130 
131 public:
132 
133  };
134 
135 }
136 
DefaultParamHandler.h
OpenMS::CompNovoIonScoringBase::IonScore::position
double position
Definition: CompNovoIonScoringBase.h:81
OpenMS::CompNovoIonScoringBase::IonScore::s_isotope_pattern_2
double s_isotope_pattern_2
"" charge 2
Definition: CompNovoIonScoringBase.h:84
OpenMS::CompNovoIonScoringBase::IonScore::s_yion
double s_yion
Definition: CompNovoIonScoringBase.h:79
OpenMS::CompNovoIonScoringBase
run with CompNovoIonScoringBase
Definition: CompNovoIonScoringBase.h:53
OpenMS::CompNovoIonScoringBase::IsotopeType
IsotopeType
Definition: CompNovoIonScoringBase.h:59
OpenMS::CompNovoIonScoringBase::IonScore::s_isotope_pattern_1
double s_isotope_pattern_1
isotope pattern score charge 1
Definition: CompNovoIonScoringBase.h:82
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:83
OpenMS::DefaultParamHandler
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:91
OpenMS::CompNovoIonScoringBase::IonScore
Definition: CompNovoIonScoringBase.h:66
OpenMS::CompNovoIonScoringBase::IonScore::s_bion
double s_bion
Definition: CompNovoIonScoringBase.h:78
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
int
OpenMS::CompNovoIonScoringBase::fragment_mass_tolerance_
double fragment_mass_tolerance_
Definition: CompNovoIonScoringBase.h:129
MSExperiment.h
OpenMS::CompNovoIonScoringBase::isotope_distributions_
Map< Size, std::vector< double > > isotope_distributions_
Definition: CompNovoIonScoringBase.h:127
OpenMS::CompNovoIonScoringBase::IonScore::s_witness
double s_witness
Definition: CompNovoIonScoringBase.h:80
OpenMS::Map
Map class based on the STL map (containing several convenience functions)
Definition: Map.h:50
OpenMS::MSSpectrum::ConstIterator
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:104
OpenMS::MSSpectrum
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
StandardTypes.h
OpenMS::CompNovoIonScoringBase::IonScore::score
double score
Definition: CompNovoIonScoringBase.h:77