42 #include <unordered_set> 78 void apply(std::vector<PeptideIdentification> & fwd_ids, std::vector<PeptideIdentification> & rev_ids)
const;
85 void apply(std::vector<PeptideIdentification> &
id)
const;
93 void apply(std::vector<ProteinIdentification>& fwd_ids, std::vector<ProteinIdentification>& rev_ids)
const;
100 void apply(std::vector<ProteinIdentification>& ids)
const;
107 void applyEstimated(std::vector<ProteinIdentification>& ids)
const;
118 double applyEvaluateProteinIDs(
const std::vector<ProteinIdentification>& ids,
double pepCutoff = 1.0,
UInt fpCutoff = 50,
double diffWeight = 0.2);
119 double applyEvaluateProteinIDs(
const ProteinIdentification& ids,
double pepCutoff = 1.0,
UInt fpCutoff = 50,
double diffWeight = 0.2);
122 void applyBasic(std::vector<PeptideIdentification> & ids);
127 double rocN(
const std::vector<PeptideIdentification>& ids,
Size fp_cutoff)
const;
140 std::vector<std::pair<double,bool>>& scores_labels,
144 std::vector<std::pair<double,bool>>& scores_labels,
145 const std::vector<ProteinIdentification::ProteinGroup> & grps,
146 const std::unordered_set<std::string> & decoy_accs)
const;
149 std::vector<std::pair<double,bool>>& scores_labels,
150 const std::vector<PeptideIdentification> & ids,
152 int charge,
String identifier)
const;
155 std::vector<std::pair<double,bool>>& scores_labels,
156 const std::vector<PeptideIdentification> & targets,
157 const std::vector<PeptideIdentification> & decoys,
160 const String& identifier)
const;
163 const std::map<double,double>& scores_to_FDR,
164 std::vector<PeptideIdentification> &
id,
165 const std::string& score_type,
166 bool higher_better)
const;
168 template <
typename IDType>
169 void setScores_(
const std::map<double,double>& scores_to_FDR, IDType &
id,
const std::string& score_type,
bool higher_better)
const 171 String old_score_type =
id.getScoreType() +
"_score";
172 id.setScoreType(score_type);
173 id.setHigherScoreBetter(higher_better);
174 for (
auto& hit :
id.getHits())
176 double old_score = hit.getScore();
177 hit.setScore(scores_to_FDR.lower_bound(hit.getScore())->second);
178 hit.setMetaValue(old_score_type, old_score);
183 const std::map<double,double>& scores_to_FDR,
184 std::vector<ProteinIdentification::ProteinGroup>& grps,
185 const std::string& score_type,
186 bool higher_better)
const;
188 template <
typename IDType>
191 for (
auto const& hit :
id.getHits())
193 if (!hit.metaValueExists(
"target_decoy"))
197 OPENMS_PRETTY_FUNCTION,
198 "Meta value 'target_decoy' does not exist in all ProteinHits! Reindex the idXML file with 'PeptideIndexer'");
203 template <
typename HitType>
206 bool operator() (
const HitType& hit)
209 if (!hit.metaValueExists(
"target_decoy"))
213 OPENMS_PRETTY_FUNCTION,
214 "Meta value 'target_decoy' does not exist in all ProteinHits! Reindex the idXML file with 'PeptideIndexer'");
218 return std::string(hit.getMetaValue(
"target_decoy"))[0] ==
't';
223 template <
typename HitType>
226 bool operator() (
const HitType& )
232 template <
typename HitType>
235 bool operator() (
const HitType& )
242 template <
typename HitType>
243 std::pair<double,bool>
getScoreLabel_(
const HitType& hit, std::function<
bool(
const HitType&)> fun)
const 245 return std::make_pair(hit.getScore(), fun(hit));
249 void calculateFDRs_(
Map<double, double>& score_to_fdr, std::vector<double>& target_scores, std::vector<double>& decoy_scores,
bool q_value,
bool higher_score_better)
const;
253 void calculateEstimatedQVal_(std::map<double, double> &scores_to_FDR,
254 std::vector<std::pair<double, bool>> &scores_labels,
255 bool higher_score_better)
const;
258 void calculateFDRBasic_(std::map<double,double>& scores_to_FDR, std::vector<std::pair<double,bool>>& scores_labels,
bool qvalue,
bool higher_score_better);
263 double diffEstimatedEmpirical_(
const std::vector<std::pair<double, bool>>& scores_labels,
double pepCutoff = 1.0);
267 double rocN_(std::vector<std::pair<double, bool>>
const &scores_labels,
Size fpCutoff = 50)
const;
271 double trapezoidal_area_xEqy(
double exp1,
double exp2,
double act1,
double act2)
const;
274 double trapezoidal_area(
double x1,
double x2,
double y1,
double y2)
const;
Representation of a protein identification run.
Definition: ProteinIdentification.h:68
A more convenient string class.
Definition: String.h:58
void checkTDAnnotation_(const IDType &id) const
Definition: FalseDiscoveryRate.h:189
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
std::pair< double, bool > getScoreLabel_(const HitType &hit, std::function< bool(const HitType &)> fun) const
Definition: FalseDiscoveryRate.h:243
Definition: FalseDiscoveryRate.h:233
Definition: FalseDiscoveryRate.h:204
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Definition: FalseDiscoveryRate.h:224
Calculates an FDR from identifications.
Definition: FalseDiscoveryRate.h:65
void setScores_(const std::map< double, double > &scores_to_FDR, IDType &id, const std::string &score_type, bool higher_better) const
Definition: FalseDiscoveryRate.h:169
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:91
Map class based on the STL map (containing several convenience functions)
Definition: Map.h:50