OpenMS
Loading...
Searching...
No Matches
PeptideProteinResolution.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: Julianus Pfeuffer $
6// $Authors: Julianus Pfeuffer $
7// --------------------------------------------------------------------------
8
9#pragma once
10
16#include <vector>
17#include <set>
18#include <unordered_map>
19
20namespace OpenMS
21{
24 struct OPENMS_DLLAPI ConnectedComponent
25 {
26 std::set<Size> prot_grp_indices;
27 std::set<Size> pep_indices;
29 friend std::ostream& operator<<(std::ostream& os, const ConnectedComponent& conn_comp);
30 };
31
55 class OPENMS_DLLAPI PeptideProteinResolution
56 {
57
58 private:
64 typedef std::map<Size, std::set<Size> > IndexMap_;
65
67 // TODO WIP for better tie resolution
68 // std::vector<std::pair<bool,bool>> indist_prot_grp_td_;
73
77 std::unordered_map<String, Size> prot_acc_to_indist_prot_grp_;
78
81
82 public:
85 PeptideProteinResolution(bool statistics = false);
86
87
95 static void resolve(ProteinIdentification& protein,
97 bool resolve_ties,
98 bool targets_first);
99
104 static void run(std::vector<ProteinIdentification>& inferred_protein_id,
105 PeptideIdentificationList& inferred_peptide_ids);
106
114 const PeptideIdentificationList& peptides,
115 bool skip_sort = false);
116
124 PeptideIdentificationList& peptides);
125
131
132
147 ProteinIdentification& protein,
148 PeptideIdentificationList& peptides);
149};
150
151} //namespace OpenMS
152
Container for peptide identifications from multiple spectra.
Definition PeptideIdentificationList.h:66
Resolves shared peptides based on protein scores.
Definition PeptideProteinResolution.h:56
void resolveGraph(ProteinIdentification &protein, PeptideIdentificationList &peptides)
static void resolve(ProteinIdentification &protein, PeptideIdentificationList &peptides, bool resolve_ties, bool targets_first)
std::unordered_map< String, Size > prot_acc_to_indist_prot_grp_
Definition PeptideProteinResolution.h:77
void buildGraph(ProteinIdentification &protein, const PeptideIdentificationList &peptides, bool skip_sort=false)
IndexMap_ pep_to_indist_prot_grp_
mapping indist. protein group indices <- peptide identification indices
Definition PeptideProteinResolution.h:72
ConnectedComponent findConnectedComponent(Size &root_prot_grp)
IndexMap_ indist_prot_grp_to_pep_
if the protein group at index i contains a target (first) and/or decoy (second)
Definition PeptideProteinResolution.h:70
std::map< Size, std::set< Size > > IndexMap_
Definition PeptideProteinResolution.h:64
bool statistics_
log debug information?
Definition PeptideProteinResolution.h:80
static void run(std::vector< ProteinIdentification > &inferred_protein_id, PeptideIdentificationList &inferred_peptide_ids)
void resolveConnectedComponent(ConnectedComponent &conn_comp, ProteinIdentification &protein, PeptideIdentificationList &peptides)
PeptideProteinResolution(bool statistics=false)
Representation of a protein identification run.
Definition ProteinIdentification.h:56
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
Definition PeptideProteinResolution.h:25
std::set< Size > pep_indices
Definition PeptideProteinResolution.h:27
std::set< Size > prot_grp_indices
Definition PeptideProteinResolution.h:26
friend std::ostream & operator<<(std::ostream &os, const ConnectedComponent &conn_comp)
Overloaded operator '<<' for ConnectedComponents.