OpenMS
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-2023.
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  {
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 
101 
104 
108  double scoreIsotopes(const PeakSpectrum & CID_spec, PeakSpectrum::ConstIterator it, Size charge);
110 
111 protected:
112 
114  void updateMembers_() override;
115 
116 
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 
126 
128  std::map<Size, std::vector<double> > isotope_distributions_;
129 
131 
132 public:
133 
134  };
135 
136 }
137 
run with CompNovoIonScoringBase
Definition: CompNovoIonScoringBase.h:56
~CompNovoIonScoringBase() override
destructor
IsotopeType classifyIsotopes_(const PeakSpectrum &spec, PeakSpectrum::ConstIterator it) const
CompNovoIonScoringBase(const CompNovoIonScoringBase &source)
copy constructor
double scoreIsotopes(const PeakSpectrum &CID_spec, PeakSpectrum::ConstIterator it, Size charge)
CompNovoIonScoringBase()
default constructor
virtual void scoreWitnessSet_(Size charge, double precursor_weight, std::map< double, IonScore > &CID_nodes, const PeakSpectrum &CID_orig_spec)=0
double scoreIsotopes_(const PeakSpectrum &spec, PeakSpectrum::ConstIterator it, std::map< double, IonScore > &CID_nodes, Size charge=1)
CompNovoIonScoringBase & operator=(const CompNovoIonScoringBase &source)
void updateMembers_() override
update members method from DefaultParamHandler to update the members
double fragment_mass_tolerance_
Definition: CompNovoIonScoringBase.h:130
void addSingleChargedIons_(std::map< double, IonScore > &ion_scores, PeakSpectrum &CID_spec)
IsotopeType
Definition: CompNovoIonScoringBase.h:61
std::map< Size, std::vector< double > > isotope_distributions_
Definition: CompNovoIonScoringBase.h:128
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
The representation of a 1D spectrum.
Definition: MSSpectrum.h:70
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:136
int Int
Signed integer type.
Definition: Types.h:102
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48
Definition: CompNovoIonScoringBase.h:68
Int is_isotope_1_mono
0 means not tested, 1 mean is, -1 is tail of isotopes
Definition: CompNovoIonScoringBase.h:84
double s_witness
Definition: CompNovoIonScoringBase.h:81
double score
Definition: CompNovoIonScoringBase.h:78
double s_yion
Definition: CompNovoIonScoringBase.h:80
double s_isotope_pattern_1
isotope pattern score charge 1
Definition: CompNovoIonScoringBase.h:83
IonScore & operator=(const IonScore &rhs)
double position
Definition: CompNovoIonScoringBase.h:82
double s_isotope_pattern_2
"" charge 2
Definition: CompNovoIonScoringBase.h:85
double s_bion
Definition: CompNovoIonScoringBase.h:79