OpenMS
PeptideProteinResolution.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- 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>
15 #include <vector>
16 #include <set>
17 
18 namespace OpenMS
19 {
22  struct OPENMS_DLLAPI ConnectedComponent
23  {
24  std::set<Size> prot_grp_indices;
25  std::set<Size> pep_indices;
27  friend std::ostream& operator<<(std::ostream& os, const ConnectedComponent& conn_comp);
28  };
29 
53  class OPENMS_DLLAPI PeptideProteinResolution
54  {
55 
56  private:
62  typedef std::map<Size, std::set<Size> > IndexMap_;
63 
65  // TODO WIP for better tie resolution
66  // std::vector<std::pair<bool,bool>> indist_prot_grp_td_;
71 
75  std::map<String, Size> prot_acc_to_indist_prot_grp_;
76 
79 
80  public:
83  PeptideProteinResolution(bool statistics = false);
84 
85 
93  static void resolve(ProteinIdentification& protein,
94  std::vector<PeptideIdentification>& peptides,
95  bool resolve_ties,
96  bool targets_first);
97 
102  static void run(std::vector<ProteinIdentification>& inferred_protein_id,
103  std::vector<PeptideIdentification>& inferred_peptide_ids);
104 
112  const std::vector<PeptideIdentification>& peptides,
113  bool skip_sort = false);
114 
122  std::vector<PeptideIdentification>& peptides);
123 
129 
130 
145  ProteinIdentification& protein,
146  std::vector<PeptideIdentification>& peptides);
147 };
148 
149 } //namespace OpenMS
150 
Resolves shared peptides based on protein scores.
Definition: PeptideProteinResolution.h:54
std::map< String, Size > prot_acc_to_indist_prot_grp_
Definition: PeptideProteinResolution.h:75
void buildGraph(ProteinIdentification &protein, const std::vector< PeptideIdentification > &peptides, bool skip_sort=false)
void resolveGraph(ProteinIdentification &protein, std::vector< PeptideIdentification > &peptides)
IndexMap_ pep_to_indist_prot_grp_
mapping indist. protein group indices <- peptide identification indices
Definition: PeptideProteinResolution.h:70
static void run(std::vector< ProteinIdentification > &inferred_protein_id, std::vector< PeptideIdentification > &inferred_peptide_ids)
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:68
static void resolve(ProteinIdentification &protein, std::vector< PeptideIdentification > &peptides, bool resolve_ties, bool targets_first)
std::map< Size, std::set< Size > > IndexMap_
Definition: PeptideProteinResolution.h:62
bool statistics_
log debug information?
Definition: PeptideProteinResolution.h:78
PeptideProteinResolution(bool statistics=false)
void resolveConnectedComponent(ConnectedComponent &conn_comp, ProteinIdentification &protein, std::vector< PeptideIdentification > &peptides)
Representation of a protein identification run.
Definition: ProteinIdentification.h:50
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
Definition: PeptideProteinResolution.h:23
friend std::ostream & operator<<(std::ostream &os, const ConnectedComponent &conn_comp)
Overloaded operator '<<' for ConnectedComponents.
std::set< Size > pep_indices
Definition: PeptideProteinResolution.h:25
std::set< Size > prot_grp_indices
Definition: PeptideProteinResolution.h:24