OpenMS  2.7.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-2021.
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  {
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 
100 
103 
107  double scoreIsotopes(const PeakSpectrum & CID_spec, PeakSpectrum::ConstIterator it, Size charge);
109 
110 protected:
111 
113  void updateMembers_() override;
114 
115 
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 
123 
125 
128 
130 
131 public:
132 
133  };
134 
135 }
136 
run with CompNovoIonScoringBase
Definition: CompNovoIonScoringBase.h:55
~CompNovoIonScoringBase() override
destructor
double scoreIsotopes_(const PeakSpectrum &spec, PeakSpectrum::ConstIterator it, Map< double, IonScore > &CID_nodes, Size charge=1)
void addSingleChargedIons_(Map< double, IonScore > &ion_scores, PeakSpectrum &CID_spec)
CompNovoIonScoringBase(const CompNovoIonScoringBase &source)
copy constructor
double scoreIsotopes(const PeakSpectrum &CID_spec, PeakSpectrum::ConstIterator it, Size charge)
CompNovoIonScoringBase()
default constructor
CompNovoIonScoringBase & operator=(const CompNovoIonScoringBase &source)
void updateMembers_() override
update members method from DefaultParamHandler to update the members
double fragment_mass_tolerance_
Definition: CompNovoIonScoringBase.h:129
Map< Size, std::vector< double > > isotope_distributions_
Definition: CompNovoIonScoringBase.h:127
IsotopeType classifyIsotopes_(const PeakSpectrum &spec, PeakSpectrum::ConstIterator it)
IsotopeType
Definition: CompNovoIonScoringBase.h:60
virtual void scoreWitnessSet_(Size charge, double precursor_weight, Map< double, IonScore > &CID_nodes, const PeakSpectrum &CID_orig_spec)=0
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:93
The representation of a 1D spectrum.
Definition: MSSpectrum.h:71
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:128
Map class based on the STL map (containing several convenience functions)
Definition: Map.h:52
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:47
Definition: CompNovoIonScoringBase.h:67
Int is_isotope_1_mono
0 means not tested, 1 mean is, -1 is tail of isotopes
Definition: CompNovoIonScoringBase.h:83
double s_witness
Definition: CompNovoIonScoringBase.h:80
double score
Definition: CompNovoIonScoringBase.h:77
double s_yion
Definition: CompNovoIonScoringBase.h:79
double s_isotope_pattern_1
isotope pattern score charge 1
Definition: CompNovoIonScoringBase.h:82
IonScore & operator=(const IonScore &rhs)
double position
Definition: CompNovoIonScoringBase.h:81
double s_isotope_pattern_2
"" charge 2
Definition: CompNovoIonScoringBase.h:84
double s_bion
Definition: CompNovoIonScoringBase.h:78