50 class PeptideIdentification;
51 class ProteinIdentification;
95 static std::map<String, std::vector<std::vector<double>>> extractAndTransformScores(
96 const std::vector<ProteinIdentification> & protein_ids,
97 const std::vector<PeptideIdentification> & peptide_ids,
98 const bool split_charge,
99 const bool top_hits_only,
100 const bool target_decoy_available,
101 const double fdr_for_targets_smaller);
116 static void updateScores(
118 const String & search_engine,
120 const bool prob_correct,
121 const bool split_charge,
122 std::vector<ProteinIdentification> & protein_ids,
123 std::vector<PeptideIdentification> & peptide_ids,
124 bool & unable_to_fit_data,
125 bool & data_might_not_be_well_fit);
135 bool fit(std::vector<double> & search_engine_scores,
const String& outlier_handling);
145 bool fitGumbelGauss(std::vector<double>& search_engine_scores,
const String& outlier_handling);
154 bool fit(std::vector<double> & search_engine_scores, std::vector<double> & probabilities,
const String& outlier_handling);
157 void fillDensities(
const std::vector<double> & x_scores, std::vector<double> & incorrect_density, std::vector<double> & correct_density);
159 void fillLogDensities(
const std::vector<double> & x_scores, std::vector<double> & incorrect_density, std::vector<double> & correct_density);
161 void fillLogDensitiesGumbel(
const std::vector<double> & x_scores, std::vector<double> & incorrect_density, std::vector<double> & correct_density);
163 double computeLogLikelihood(
const std::vector<double> & incorrect_density,
const std::vector<double> & correct_density);
169 double computeLLAndIncorrectPosteriorsFromLogDensities(
170 const std::vector<double>& incorrect_log_density,
171 const std::vector<double>& correct_log_density,
172 std::vector<double>& incorrect_posterior);
180 std::pair<double, double> pos_neg_mean_weighted_posteriors(
const std::vector<double> &x_scores,
181 const std::vector<double> &incorrect_posteriors);
189 std::pair<double, double> pos_neg_sigma_weighted_posteriors(
const std::vector<double> &x_scores,
190 const std::vector<double> &incorrect_posteriors,
191 const std::pair<double, double>& means);
196 return correctly_assigned_fit_param_;
202 return incorrectly_assigned_fit_param_;
208 return incorrectly_assigned_fit_gumbel_param_;
214 return negative_prior_;
220 double z = exp((params.
x0 - x) / params.
sigma);
221 return (z * exp(-1 * z)) / params.
sigma;
228 double computeProbability(
double score)
const;
231 TextFile initPlots(std::vector<double> & x_scores);
243 void plotTargetDecoyEstimation(std::vector<double> & target, std::vector<double> & decoy);
248 return smallest_score_;
252 void tryGnuplot(
const String& gp_file);
256 void processOutliers_(std::vector<double>& x_scores,
const String& outlier_handling)
const;
259 static double transformScore_(
const String & engine,
const PeptideHit & hit);