OpenMS
Loading...
Searching...
No Matches
ClassFDR.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Timo Sachsenberg $
7// --------------------------------------------------------------------------
8
9#pragma once
10
11#include <OpenMS/config.h>
14
15#include <functional>
16#include <string>
17#include <vector>
18
19namespace OpenMS
20{
21 class PeptideHit;
22
42 class OPENMS_DLLAPI ClassFDR
43 {
44 public:
46 enum class Method
47 {
48 POOLED_NULL,
49 CLASS_TDC
50 };
51
53 struct OPENMS_DLLAPI ClassSummary
54 {
55 std::string name;
56 Size targets = 0;
57 Size decoys = 0;
58 Method method = Method::POOLED_NULL;
59 double pi0 = 1.0;
60 };
61
63 static const std::string CLASS_Q_VALUE;
64
77 static std::vector<ClassSummary> annotateClassQValues(PeptideIdentificationList& ids,
78 const std::function<std::string(const PeptideHit&)>& class_of,
79 bool use_all_hits = false);
80
86
88 static std::string classFromMetaValue(const PeptideHit& hit, const std::string& name);
89
92 static std::string classFromModifications(const PeptideHit& hit, const std::vector<std::string>& ignore);
93
95 static std::vector<double> storeyQValues(const std::vector<double>& p, double& pi0);
96 };
97} // namespace OpenMS
FDR within classes of PSMs (e.g. modified vs. unmodified, isoform-specific vs. canonical)
Definition ClassFDR.h:43
Method
how the q-values of a class were estimated
Definition ClassFDR.h:47
static std::string classFromModifications(const PeptideHit &hit, const std::vector< std::string > &ignore)
static std::vector< double > storeyQValues(const std::vector< double > &p, double &pi0)
Storey q-values (lambda = 0.5) of p in the same order; pi0 receives the null-fraction estimate.
static Size raiseToClassQValues(PeptideIdentificationList &ids)
Raise each hit's q-value (main score, which must be a q-value) to its class q-value,...
std::string name
Definition ClassFDR.h:55
static const std::string CLASS_Q_VALUE
meta value holding the class q-value of a hit
Definition ClassFDR.h:63
static std::vector< ClassSummary > annotateClassQValues(PeptideIdentificationList &ids, const std::function< std::string(const PeptideHit &)> &class_of, bool use_all_hits=false)
Annotate every target hit with its class q-value (meta value CLASS_Q_VALUE)
static std::string classFromMetaValue(const PeptideHit &hit, const std::string &name)
Class of a hit from the meta value name (its string form; "NA" if missing)
per-class summary
Definition ClassFDR.h:54
Represents a single spectrum match (candidate) for a specific tandem mass spectrum (MS/MS).
Definition PeptideHit.h:52
Container for peptide identifications from multiple spectra.
Definition PeptideIdentificationList.h:66
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19