Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
IDDecoyProbability.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-2017.
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 #ifndef OPENMS_ANALYSIS_ID_IDDECOYPROBABILITY_H
36 #define OPENMS_ANALYSIS_ID_IDDECOYPROBABILITY_H
37 
42 
43 #include <vector>
44 
45 namespace OpenMS
46 {
58  class OPENMS_DLLAPI IDDecoyProbability :
59  public DefaultParamHandler
60  {
61 public:
62 
65 
68 
70  virtual ~IDDecoyProbability();
71 
73  IDDecoyProbability & operator=(const IDDecoyProbability & rhs);
74 
81  void apply(std::vector<PeptideIdentification> & prob_ids,
82  const std::vector<PeptideIdentification> & fwd_ids,
83  const std::vector<PeptideIdentification> & rev_ids);
84 
85  void apply(std::vector<PeptideIdentification> & ids);
86 
87 protected:
88 
94  {
96  max_intensity(0),
97  diff_score(0),
98  min_score(0),
99  max_score(0),
100  max_intensity_bin(0)
101  {
102  }
103 
105  max_intensity(rhs.max_intensity),
106  diff_score(rhs.diff_score),
107  min_score(rhs.min_score),
108  max_score(rhs.max_score),
109  max_intensity_bin(rhs.max_intensity_bin)
110  {
111  }
112 
114  {
115  if (this != &rhs)
116  {
117  max_intensity = rhs.max_intensity;
118  diff_score = rhs.diff_score;
119  min_score = rhs.min_score;
120  max_score = rhs.max_score;
121  max_intensity_bin = rhs.max_intensity_bin;
122  }
123  return *this;
124  }
125 
127  double diff_score;
128  double min_score;
129  double max_score;
131  };
132 
133  // normalizes histograms
134  void normalizeBins_(const std::vector<double> & scores, std::vector<double> & binned, Transformation_ & trafo);
135 
136  // returns the probability of given score with the transformations of reverse and forward searches and the results of the fits
137  double getProbability_(const Math::GammaDistributionFitter::GammaDistributionFitResult & result_gamma,
138  const Transformation_ & gamma_trafo,
139  const Math::GaussFitter::GaussFitResult & result_gauss,
140  const Transformation_ & gauss_trafo,
141  double score);
142 
143 
144  void generateDistributionImage_(const std::vector<double> & ids, const String & formula, const String & filename);
145 
146  void generateDistributionImage_(const std::vector<double> & all_ids, const Transformation_ & all_trans, const String & fwd_formula, const String & rev_formula, const String & filename);
147 
148 
149  void apply_(std::vector<PeptideIdentification> & ids, const std::vector<double> & rev_scores, const std::vector<double> & fwd_scores, const std::vector<double> & all_scores);
150 
151  };
152 
153 } // namespace OpenMS
154 
155 #endif // OPENMS_ANALYSIS_ID_IDDECOYPROBABILITY_H
struct to be used to store a transformation (used for fitting)
Definition: IDDecoyProbability.h:93
A more convenient string class.
Definition: String.h:57
IDDecoyProbability calculates probabilities using decoy approach.
Definition: IDDecoyProbability.h:58
double max_intensity
Definition: IDDecoyProbability.h:126
Transformation_()
Definition: IDDecoyProbability.h:95
double max_score
Definition: IDDecoyProbability.h:129
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
Size max_intensity_bin
Definition: IDDecoyProbability.h:130
double diff_score
Definition: IDDecoyProbability.h:127
Transformation_(const Transformation_ &rhs)
Definition: IDDecoyProbability.h:104
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
struct of parameters of a Gaussian distribution
Definition: GaussFitter.h:64
struct to represent the parameters of a gamma distribution
Definition: GammaDistributionFitter.h:66
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
double min_score
Definition: IDDecoyProbability.h:128
Transformation_ & operator=(const Transformation_ &rhs)
Definition: IDDecoyProbability.h:113

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:00 using doxygen 1.8.13