Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef OPENMS_ANALYSIS_ID_IDDECOYPROBABILITY_H
00036 #define OPENMS_ANALYSIS_ID_IDDECOYPROBABILITY_H
00037
00038 #include <OpenMS/METADATA/PeptideIdentification.h>
00039 #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h>
00040 #include <OpenMS/MATH/STATISTICS/GammaDistributionFitter.h>
00041 #include <OpenMS/MATH/STATISTICS/GaussFitter.h>
00042
00043 #include <vector>
00044
00045 namespace OpenMS
00046 {
00058 class OPENMS_DLLAPI IDDecoyProbability :
00059 public DefaultParamHandler
00060 {
00061 public:
00062
00064 IDDecoyProbability();
00065
00067 IDDecoyProbability(const IDDecoyProbability & rhs);
00068
00070 virtual ~IDDecoyProbability();
00071
00073 IDDecoyProbability & operator=(const IDDecoyProbability & rhs);
00074
00081 void apply(std::vector<PeptideIdentification> & prob_ids,
00082 const std::vector<PeptideIdentification> & fwd_ids,
00083 const std::vector<PeptideIdentification> & rev_ids);
00084
00085 void apply(std::vector<PeptideIdentification> & ids);
00086
00087 protected:
00088
00093 struct Transformation_
00094 {
00095 Transformation_() :
00096 max_intensity(0),
00097 diff_score(0),
00098 min_score(0),
00099 max_score(0),
00100 max_intensity_bin(0)
00101 {
00102 }
00103
00104 Transformation_(const Transformation_ & rhs) :
00105 max_intensity(rhs.max_intensity),
00106 diff_score(rhs.diff_score),
00107 min_score(rhs.min_score),
00108 max_score(rhs.max_score),
00109 max_intensity_bin(rhs.max_intensity_bin)
00110 {
00111 }
00112
00113 Transformation_ & operator=(const Transformation_ & rhs)
00114 {
00115 if (this != &rhs)
00116 {
00117 max_intensity = rhs.max_intensity;
00118 diff_score = rhs.diff_score;
00119 min_score = rhs.min_score;
00120 max_score = rhs.max_score;
00121 max_intensity_bin = rhs.max_intensity_bin;
00122 }
00123 return *this;
00124 }
00125
00126 DoubleReal max_intensity;
00127 DoubleReal diff_score;
00128 DoubleReal min_score;
00129 DoubleReal max_score;
00130 Size max_intensity_bin;
00131 };
00132
00133
00134 void normalizeBins_(const std::vector<DoubleReal> & scores, std::vector<DoubleReal> & binned, Transformation_ & trafo);
00135
00136
00137 DoubleReal getProbability_(const Math::GammaDistributionFitter::GammaDistributionFitResult & result_gamma,
00138 const Transformation_ & gamma_trafo,
00139 const Math::GaussFitter::GaussFitResult & result_gauss,
00140 const Transformation_ & gauss_trafo,
00141 DoubleReal score);
00142
00143
00144 void generateDistributionImage_(const std::vector<DoubleReal> & ids, const String & formula, const String & filename);
00145
00146 void generateDistributionImage_(const std::vector<DoubleReal> & all_ids, const Transformation_ & all_trans, const String & fwd_formula, const String & rev_formula, const String & filename);
00147
00148
00149 void apply_(std::vector<PeptideIdentification> & ids, const std::vector<DoubleReal> & rev_scores, const std::vector<DoubleReal> & fwd_scores, const std::vector<DoubleReal> & all_scores);
00150
00151 };
00152
00153 }
00154
00155 #endif // OPENMS_ANALYSIS_ID_IDDECOYPROBABILITY_H