All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
11 #include <OpenMS/CONCEPT/Types.h>
16 #include <vector>
17 #include <set>
18 
19 namespace OpenMS
20 {
23  struct OPENMS_DLLAPI ConnectedComponent
24  {
25  std::set<Size> prot_grp_indices;
26  std::set<Size> pep_indices;
28  friend std::ostream& operator<<(std::ostream& os, const ConnectedComponent& conn_comp);
29  };
30 
54  class OPENMS_DLLAPI PeptideProteinResolution
55  {
56 
57  private:
63  typedef std::map<Size, std::set<Size> > IndexMap_;
64 
66  // TODO WIP for better tie resolution
67  // std::vector<std::pair<bool,bool>> indist_prot_grp_td_;
72 
76  std::map<String, Size> prot_acc_to_indist_prot_grp_;
77 
80 
81  public:
84  PeptideProteinResolution(bool statistics = false);
85 
86 
94  static void resolve(ProteinIdentification& protein,
95  PeptideIdentificationList& peptides,
96  bool resolve_ties,
97  bool targets_first);
98 
103  static void run(std::vector<ProteinIdentification>& inferred_protein_id,
104  PeptideIdentificationList& inferred_peptide_ids);
105 
113  const PeptideIdentificationList& peptides,
114  bool skip_sort = false);
115 
123  PeptideIdentificationList& peptides);
124 
130 
131 
146  ProteinIdentification& protein,
147  PeptideIdentificationList& peptides);
148 };
149 
150 } //namespace OpenMS
151 
Container for peptide identifications from multiple spectra.
Definition: PeptideIdentificationList.h:66
Resolves shared peptides based on protein scores.
Definition: PeptideProteinResolution.h:55
std::map< String, Size > prot_acc_to_indist_prot_grp_
Definition: PeptideProteinResolution.h:76
void resolveGraph(ProteinIdentification &protein, PeptideIdentificationList &peptides)
static void resolve(ProteinIdentification &protein, PeptideIdentificationList &peptides, bool resolve_ties, bool targets_first)
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:71
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:69
std::map< Size, std::set< Size > > IndexMap_
Definition: PeptideProteinResolution.h:63
bool statistics_
log debug information?
Definition: PeptideProteinResolution.h:79
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:51
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:24
friend std::ostream & operator<<(std::ostream &os, const ConnectedComponent &conn_comp)
Overloaded operator '<<' for ConnectedComponents.
std::set< Size > pep_indices
Definition: PeptideProteinResolution.h:26
std::set< Size > prot_grp_indices
Definition: PeptideProteinResolution.h:25