OpenMS  2.6.0
IDBoostGraph.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2020.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Julianus Pfeuffer $
32 // $Authors: Julianus Pfeuffer $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 // define to get timings for connected components
38 //#define INFERENCE_BENCH
39 
40 #include <OpenMS/ANALYSIS/ID/MessagePasserFactory.h> //included in BPI
42 #include <OpenMS/CONCEPT/Types.h>
47 
48 #include <vector>
49 #include <unordered_map>
50 #include <queue>
51 
52 #include <boost/function.hpp>
53 #include <boost/graph/adjacency_list.hpp>
54 #include <boost/graph/depth_first_search.hpp>
55 #include <boost/graph/filtered_graph.hpp>
56 #include <boost/graph/properties.hpp>
57 #include <boost/variant.hpp>
58 #include <boost/variant/detail/hash_variant.hpp>
59 #include <boost/variant/static_visitor.hpp>
60 
61 namespace OpenMS
62 {
63  struct ScoreToTgtDecLabelPairs;
64 
65  namespace Internal
66  {
67 
80  //TODO Add OPENMS_DLLAPI everywhere
81  class OPENMS_DLLAPI IDBoostGraph
82  {
83 
84  public:
85 
86  // boost has a weird extra semicolon in their strong typedef
87  #pragma clang diagnostic push
88  #pragma clang diagnostic ignored "-Wextra-semi"
89 
91  BOOST_STRONG_TYPEDEF(boost::blank, PeptideCluster)
92 
93 
94  struct ProteinGroup
95  {
96  int size = 0;
97  int tgts = 0;
98  double score = 0.;
99  };
100 
102  BOOST_STRONG_TYPEDEF(String, Peptide)
103 
104 
105  BOOST_STRONG_TYPEDEF(Size, RunIndex)
106 
107 
108  BOOST_STRONG_TYPEDEF(int, Charge)
109 
110  #pragma clang diagnostic pop
111 
112  //typedefs
113  //TODO rename ProteinGroup type since it collides with the actual OpenMS ProteinGroup
114  typedef boost::variant<ProteinHit*, ProteinGroup, PeptideCluster, Peptide, RunIndex, Charge, PeptideHit*> IDPointer;
115  typedef boost::variant<const ProteinHit*, const ProteinGroup*, const PeptideCluster*, const Peptide, const RunIndex, const Charge, const PeptideHit*> IDPointerConst;
116  //TODO check the impact of different data structures to store nodes/edges
117  // Directed graphs would make the internal computations much easier (less in/out edge checking) but boost
118  // does not allow computation of "non-strongly" connected components for directed graphs, which is what we would
119  // need. We can think about after/while copying to CCs, to insert it into a directed graph!
120  typedef boost::adjacency_list <boost::setS, boost::vecS, boost::undirectedS, IDPointer> Graph;
121  typedef std::vector<Graph> Graphs;
122  typedef boost::adjacency_list <boost::setS, boost::vecS, boost::undirectedS, IDPointer> GraphConst;
123 
124  typedef boost::graph_traits<Graph>::vertex_descriptor vertex_t;
125  typedef boost::graph_traits<Graph>::edge_descriptor edge_t;
126 
127  typedef std::set<IDBoostGraph::vertex_t> ProteinNodeSet;
128  typedef std::set<IDBoostGraph::vertex_t> PeptideNodeSet;
129 
130 
133  public boost::default_dfs_visitor
134  {
135  public:
137  : gs(vgs), curr_v(0), next_v(0), m()
138  {}
139 
140  template < typename Vertex, typename Graph >
141  void start_vertex(Vertex u, const Graph & tg)
142  {
143  gs.emplace_back();
144  next_v = boost::add_vertex(tg[u], gs.back());
145  m[u] = next_v;
146  }
147 
148  template < typename Vertex, typename Graph >
149  void discover_vertex(Vertex /*u*/, const Graph & /*tg*/)
150  {
151  curr_v = next_v;
152  }
153 
154  template < typename Edge, typename Graph >
155  void examine_edge(Edge e, const Graph & tg)
156  {
157  if (m.find(e.m_target) == m.end())
158  {
159  next_v = boost::add_vertex(tg[e.m_target], gs.back());
160  m[e.m_target] = next_v;
161  }
162  else
163  {
164  next_v = m[e.m_target];
165  }
166 
167  boost::add_edge(m[e.m_source], next_v, gs.back());
168  }
169 
171  vertex_t curr_v, next_v;
173  std::map<vertex_t, vertex_t> m;
174  };
175 
176  //TODO group visitors by templates
179  public boost::static_visitor<OpenMS::String>
180  {
181  public:
182 
184  {
185  return pep->getSequence().toString() + "_" + pep->getCharge();
186  }
187 
189  {
190  return prot->getAccession();
191  }
192 
193  OpenMS::String operator()(const ProteinGroup& /*protgrp*/) const
194  {
195  return String("PG");
196  }
197 
198  OpenMS::String operator()(const PeptideCluster& /*pc*/) const
199  {
200  return String("PepClust");
201  }
202 
203  OpenMS::String operator()(const Peptide& peptide) const
204  {
205  return peptide;
206  }
207 
208  OpenMS::String operator()(const RunIndex& ri) const
209  {
210  return String("rep" + String(ri));
211  }
212 
213  OpenMS::String operator()(const Charge& chg) const
214  {
215  return String("chg" + String(chg));
216  }
217 
218  };
219 
222  template<class CharT>
224  public boost::static_visitor<>
225  {
226  public:
227 
228  explicit PrintAddressVisitor(std::basic_ostream<CharT> stream):
229  stream_(stream)
230  {}
231 
232  void operator()(PeptideHit* pep) const
233  {
234  stream_ << pep->getSequence().toUnmodifiedString() << ": " << pep << std::endl;
235  }
236 
237  void operator()(ProteinHit* prot) const
238  {
239  stream_ << prot->getAccession() << ": " << prot << std::endl;
240  }
241 
242  void operator()(const ProteinGroup& /*protgrp*/) const
243  {
244  stream_ << "PG" << std::endl;
245  }
246 
247  void operator()(const PeptideCluster& /*pc*/) const
248  {
249  stream_ << "PepClust" << std::endl;
250  }
251 
252  void operator()(const Peptide& peptide) const
253  {
254  stream_ << peptide << std::endl;
255  }
256 
257  void operator()(const RunIndex& ri) const
258  {
259  stream_ << "rep" << ri << std::endl;
260  }
261 
262  void operator()(const Charge& chg) const
263  {
264  stream_ << "chg" << chg << std::endl;
265  }
266 
267  std::basic_ostream<CharT> stream_;
268  };
269 
273  public boost::static_visitor<>
274  {
275  public:
276 
277  void operator()(PeptideHit* pep, double posterior) const
278  {
279  pep->setScore(posterior);
280  }
281 
282  void operator()(ProteinHit* prot, double posterior) const
283  {
284  prot->setScore(posterior);
285  }
286 
287  void operator()(ProteinGroup& pg, double posterior) const
288  {
289  pg.score = posterior;
290  }
291 
292  // Everything else, do nothing for now
293  template <class T>
294  void operator()(T& /*any node type*/, double /*posterior*/) const
295  {
296  // do nothing
297  }
298 
299  };
300 
302  public boost::static_visitor<double>
303  {
304  public:
305 
306  double operator()(PeptideHit* pep) const
307  {
308  return pep->getScore();
309  }
310 
311  double operator()(ProteinHit* prot) const
312  {
313  return prot->getScore();
314  }
315 
316  double operator()(ProteinGroup& pg) const
317  {
318  return pg.score;
319  }
320 
321  // Everything else, do nothing for now
322  template <class T>
323  double operator()(T& /*any node type*/) const
324  {
325  return -1.0;
326  }
327 
328  };
329 
332  std::vector<PeptideIdentification>& idedSpectra,
333  Size use_top_psms,
334  bool use_run_info,
335  bool best_psms_annotated,
336  const boost::optional<const ExperimentalDesign>& ed = boost::optional<const ExperimentalDesign>());
337 
339  ConsensusMap& cmap,
340  Size use_top_psms,
341  bool use_run_info,
342  bool use_unassigned_ids,
343  bool best_psms_annotated,
344  const boost::optional<const ExperimentalDesign>& ed = boost::optional<const ExperimentalDesign>());
345 
346 
347  //TODO think about templating to avoid wrapping to std::function
348  // although we usually do long-running tasks per CC such that the extra virtual call does not matter much
349  // Instead we gain type erasure.
351  void applyFunctorOnCCs(const std::function<unsigned long(Graph&, unsigned int)>& functor);
353  void applyFunctorOnCCsST(const std::function<void(Graph&)>& functor);
354 
357  void clusterIndistProteinsAndPeptides();
358 
359  //TODO create a new class for an extended Graph and try to reuse as much as possible
360  // use inheritance or templates
362  void clusterIndistProteinsAndPeptidesAndExtendGraph();
363 
370  void annotateIndistProteins(bool addSingletons = true);
371 
375  void calculateAndAnnotateIndistProteins(bool addSingletons = true);
376 
378  void computeConnectedComponents();
379 
386  void resolveGraphPeptideCentric(bool removeAssociationsInData = true);
387 
388 
389 
391  Size getNrConnectedComponents();
392 
396  const Graph& getComponent(Size cc);
397 
400  const ProteinIdentification& getProteinIDs();
401 
402  //TODO docu
403  //void buildExtendedGraph(bool use_all_psms, std::pair<int,int> chargeRange, unsigned int nrReplicates);
404 
408  static void printGraph(std::ostream& out, const Graph& fg);
409 
418  void getUpstreamNodesNonRecursive(std::queue<vertex_t>& q, const Graph& graph, int lvl,
419  bool stop_at_first, std::vector<vertex_t>& result);
420 
429  void getDownstreamNodesNonRecursive(std::queue<vertex_t>& q, const Graph& graph, int lvl,
430  bool stop_at_first, std::vector<vertex_t>& result);
431 
435  void getProteinScores_(ScoreToTgtDecLabelPairs& scores_and_tgt);
438  void getProteinGroupScoresAndTgtFraction(ScoreToTgtDecLabelPairs& scores_and_tgt_fraction);
439  void getProteinGroupScoresAndHitchhikingTgtFraction(ScoreToTgtDecLabelPairs& scores_and_tgt_fraction);
440 
441  private:
442 
444 
445  struct SequenceToReplicateChargeVariantHierarchy;
446 
447 
448  //TODO introduce class hierarchy:
449  /*
450  * IDGraph<UnderlyingIDStruc>
451  *
452  * - BasicGraph<>
453  * - ExtendedGraphClustered<>
454  * - ExtendedGraphClusteredWithRunInfo<>
455  *
456  * in theory extending a basic one is desirable to create the extended one. But it means we have to
457  * copy/move the graph (node by node) because the nodes are of a broader boost::variant type. So we probably have to
458  * duplicate code and offer a from-scratch step-wise building for the extended graph, too.
459  * Note that there could be several levels of extension in the future. For now I keep everything in one
460  * class by having potential storage for the broadest extended type. Differences in the underlying ID structure
461  * e.g. ConsensusMap or PeptideIDs from idXML currently only have an effect during building, so I just overload
462  * the constructors. In theory it would be nice to generalize on that, too, especially when we adapt to the new
463  * ID data structure.
464  */
465 
466 
467  /* ---------------- Either of them is used, preferably second --------------- */
469  Graph g;
470 
473  /* ---------------------------------------------------------------------------- */
474 
475  #ifdef INFERENCE_BENCH
476  std::vector<std::tuple<vertex_t, vertex_t, unsigned long, double>> sizes_and_times_{1};
478  #endif
479 
480 
481  /* ---- Only used when run information was available --------- */
482 
483  //TODO think about preallocating it, but the number of peptide hits is not easily computed
484  // since they are inside the pepIDs
485  //TODO would multiple sets be better?
486 
489  std::unordered_map<vertex_t, Size> pepHitVtx_to_run_;
490 
495  Size nrPrefractionationGroups_ = 0;
496 
497  /* ----------------------------------------------------------- */
498 
499 
502  vertex_t addVertexWithLookup_(const IDPointer& ptr, std::unordered_map<IDPointer, vertex_t, boost::hash<IDPointer>>& vertex_map);
503  //vertex_t addVertexWithLookup_(IDPointerConst& ptr, std::unordered_map<IDPointerConst, vertex_t, boost::hash<IDPointerConst>>& vertex_map);
504 
505 
507  void annotateIndistProteins_(const Graph& fg, bool addSingletons);
508  void calculateAndAnnotateIndistProteins_(const Graph& fg, bool addSingletons);
509 
519  void buildGraph_(ProteinIdentification& proteins,
520  std::vector<PeptideIdentification>& idedSpectra,
521  Size use_top_psms,
522  bool best_psms_annotated = false);
523 
524  void buildGraph_(ProteinIdentification& proteins,
525  ConsensusMap& cmap,
526  Size use_top_psms,
527  bool use_unassigned_ids,
528  bool best_psms_annotated = false);
529 
531  void addPeptideIDWithAssociatedProteins_(
532  PeptideIdentification& spectrum,
533  std::unordered_map<IDPointer, vertex_t, boost::hash<IDPointer>>& vertex_map,
534  const std::unordered_map<std::string, ProteinHit*>& accession_map,
535  Size use_top_psms,
536  bool best_psms_annotated);
537 
538  void addPeptideAndAssociatedProteinsWithRunInfo_(
539  PeptideIdentification& spectrum,
540  std::unordered_map<unsigned, unsigned>& indexToPrefractionationGroup,
541  std::unordered_map<IDPointer, vertex_t, boost::hash<IDPointer>>& vertex_map,
542  std::unordered_map<std::string, ProteinHit*>& accession_map,
543  Size use_top_psms
544  );
545 
552  void buildGraphWithRunInfo_(ProteinIdentification& proteins,
553  ConsensusMap& cmap,
554  Size use_top_psms,
555  bool use_unassigned_ids,
556  const ExperimentalDesign& ed);
557 
558  void buildGraphWithRunInfo_(ProteinIdentification& proteins,
559  std::vector<PeptideIdentification>& idedSpectra,
560  Size use_top_psms,
561  const ExperimentalDesign& ed);
562 
563 
565  void resolveGraphPeptideCentric_(Graph& fg, bool removeAssociationsInData);
566 
567  template<class NodeType>
568  void getDownstreamNodes(const vertex_t& start, const Graph& graph, std::vector<NodeType>& result)
569  {
570  Graph::adjacency_iterator adjIt, adjIt_end;
571  boost::tie(adjIt, adjIt_end) = boost::adjacent_vertices(start, graph);
572  for (;adjIt != adjIt_end; ++adjIt)
573  {
574  if (graph[*adjIt].type() == typeid(NodeType))
575  {
576  result.emplace_back(boost::get<NodeType>(graph[*adjIt]));
577  }
578  else if (graph[*adjIt].which() > graph[start].which())
579  {
580  getDownstreamNodes(*adjIt, graph, result);
581  }
582  }
583  }
584 
585  template<class NodeType>
586  void getUpstreamNodes(const vertex_t& start, const Graph graph, std::vector<NodeType>& result)
587  {
588  Graph::adjacency_iterator adjIt, adjIt_end;
589  boost::tie(adjIt, adjIt_end) = boost::adjacent_vertices(start, graph);
590  for (;adjIt != adjIt_end; ++adjIt)
591  {
592  if (graph[*adjIt].type() == typeid(NodeType))
593  {
594  result.emplace_back(boost::get<NodeType>(graph[*adjIt]));
595  }
596  else if (graph[*adjIt].which() < graph[start].which())
597  {
598  getUpstreamNodes(*adjIt, graph, result);
599  }
600  }
601  }
602  };
603 
605  } //namespace Internal
606 } //namespace OpenMS
607 
LogStream.h
OpenMS::Internal::IDBoostGraph::SetPosteriorVisitor::operator()
void operator()(ProteinGroup &pg, double posterior) const
Definition: IDBoostGraph.h:287
OpenMS::PeptideHit::getCharge
Int getCharge() const
returns the charge of the peptide
OpenMS::Internal::IDBoostGraph::PeptideNodeSet
std::set< IDBoostGraph::vertex_t > PeptideNodeSet
Definition: IDBoostGraph.h:128
OpenMS::ExperimentalDesign
Representation of an experimental design in OpenMS. Instances can be loaded with the ExperimentalDesi...
Definition: ExperimentalDesign.h:243
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor
Definition: IDBoostGraph.h:223
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::operator()
void operator()(const PeptideCluster &) const
Definition: IDBoostGraph.h:247
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::operator()
void operator()(PeptideHit *pep) const
Definition: IDBoostGraph.h:232
OpenMS::Internal::IDBoostGraph::ccs_
Graphs ccs_
the Graph split into connected components
Definition: IDBoostGraph.h:472
OpenMS::Internal::IDBoostGraph::vertex_t
boost::graph_traits< Graph >::vertex_descriptor vertex_t
Definition: IDBoostGraph.h:124
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::stream_
std::basic_ostream< CharT > stream_
Definition: IDBoostGraph.h:267
OpenMS::Internal::IDBoostGraph::SetPosteriorVisitor
Definition: IDBoostGraph.h:272
OpenMS::PeptideHit::getSequence
const AASequence & getSequence() const
returns the peptide sequence without trailing or following spaces
OpenMS::Internal::IDBoostGraph::SetPosteriorVisitor::operator()
void operator()(ProteinHit *prot, double posterior) const
Definition: IDBoostGraph.h:282
Types.h
OpenMS::Internal::IDBoostGraph::LabelVisitor::operator()
OpenMS::String operator()(const ProteinGroup &) const
Definition: IDBoostGraph.h:193
OpenMS::Internal::IDBoostGraph::LabelVisitor::operator()
OpenMS::String operator()(const Peptide &peptide) const
Definition: IDBoostGraph.h:203
OpenMS::Internal::IDBoostGraph::LabelVisitor::operator()
OpenMS::String operator()(const RunIndex &ri) const
Definition: IDBoostGraph.h:208
OpenMS::Internal::IDBoostGraph::LabelVisitor::operator()
OpenMS::String operator()(const Charge &chg) const
Definition: IDBoostGraph.h:213
OpenMS::String
A more convenient string class.
Definition: String.h:59
OpenMS::Internal::IDBoostGraph::GetPosteriorVisitor::operator()
double operator()(ProteinGroup &pg) const
Definition: IDBoostGraph.h:316
OpenMS::Internal::IDBoostGraph::Graph
boost::adjacency_list< boost::setS, boost::vecS, boost::undirectedS, IDPointer > Graph
Definition: IDBoostGraph.h:120
OpenMS::Internal::IDBoostGraph::dfs_ccsplit_visitor::next_v
vertex_t next_v
Definition: IDBoostGraph.h:171
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
OpenMS::ProteinHit
Representation of a protein hit.
Definition: ProteinHit.h:58
OpenMS::Internal::IDBoostGraph::SetPosteriorVisitor::operator()
void operator()(PeptideHit *pep, double posterior) const
Definition: IDBoostGraph.h:277
OpenMS::Internal::IDBoostGraph::getUpstreamNodes
void getUpstreamNodes(const vertex_t &start, const Graph graph, std::vector< NodeType > &result)
Definition: IDBoostGraph.h:586
OpenMS::AASequence::toString
String toString() const
returns the peptide as string with modifications embedded in brackets
OpenMS::AASequence::toUnmodifiedString
String toUnmodifiedString() const
returns the peptide as string without any modifications or (e.g., "PEPTIDER")
OpenMS::ProteinIdentification
Representation of a protein identification run.
Definition: ProteinIdentification.h:70
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::operator()
void operator()(ProteinHit *prot) const
Definition: IDBoostGraph.h:237
OpenMS::ProteinHit::getAccession
const String & getAccession() const
returns the accession of the protein
OpenMS::Internal::IDBoostGraph::g
Graph g
the initial boost Graph (will be cleared when split into CCs)
Definition: IDBoostGraph.h:445
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::operator()
void operator()(const Peptide &peptide) const
Definition: IDBoostGraph.h:252
OpenMS::Internal::IDBoostGraph::dfs_ccsplit_visitor::dfs_ccsplit_visitor
dfs_ccsplit_visitor(Graphs &vgs)
Definition: IDBoostGraph.h:136
OpenMS::Internal::IDBoostGraph::ProteinGroup
placeholder for peptides with the same parent proteins or protein groups
Definition: IDBoostGraph.h:94
ProteinIdentification.h
OpenMS::Internal::IDBoostGraph::Graphs
std::vector< Graph > Graphs
Definition: IDBoostGraph.h:121
OpenMS::Internal::IDBoostGraph::edge_t
boost::graph_traits< Graph >::edge_descriptor edge_t
Definition: IDBoostGraph.h:125
OpenMS::Internal::IDBoostGraph::LabelVisitor::operator()
OpenMS::String operator()(const PeptideHit *pep) const
Definition: IDBoostGraph.h:183
OpenMS::Internal::IDBoostGraph::LabelVisitor
Visits nodes in the boost graph (ptrs to an ID Object) and depending on their type creates a label.
Definition: IDBoostGraph.h:178
OpenMS::Internal::IDBoostGraph::pepHitVtx_to_run_
std::unordered_map< vertex_t, Size > pepHitVtx_to_run_
Definition: IDBoostGraph.h:489
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::operator()
void operator()(const ProteinGroup &) const
Definition: IDBoostGraph.h:242
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::operator()
void operator()(const RunIndex &ri) const
Definition: IDBoostGraph.h:257
OpenMS::Internal::IDBoostGraph::ProteinGroup::score
double score
Definition: IDBoostGraph.h:98
OpenMS::Internal::IDBoostGraph::dfs_ccsplit_visitor::m
std::map< vertex_t, vertex_t > m
A mapping from old node id to new node id to not duplicate existing ones in the new graph.
Definition: IDBoostGraph.h:173
OpenMS::Internal::IDBoostGraph::IDPointer
boost::variant< ProteinHit *, ProteinGroup, PeptideCluster, Peptide, RunIndex, Charge, PeptideHit * > IDPointer
an (currently unmodified) peptide sequence
Definition: IDBoostGraph.h:114
OpenMS::Internal::IDBoostGraph::GetPosteriorVisitor::operator()
double operator()(PeptideHit *pep) const
Definition: IDBoostGraph.h:306
MessagePasserFactory.h
OpenMS::Internal::IDBoostGraph::protIDs_
ProteinIdentification & protIDs_
Definition: IDBoostGraph.h:443
OpenMS::Internal::IDBoostGraph::getDownstreamNodes
void getDownstreamNodes(const vertex_t &start, const Graph &graph, std::vector< NodeType > &result)
Definition: IDBoostGraph.h:568
OpenMS::Internal::IDBoostGraph::dfs_ccsplit_visitor::discover_vertex
void discover_vertex(Vertex, const Graph &)
Definition: IDBoostGraph.h:149
OpenMS::ConsensusMap
A container for consensus elements.
Definition: ConsensusMap.h:80
OpenMS::Internal::IDBoostGraph::dfs_ccsplit_visitor::start_vertex
void start_vertex(Vertex u, const Graph &tg)
Definition: IDBoostGraph.h:141
OpenMS::Internal::IDBoostGraph::GetPosteriorVisitor::operator()
double operator()(ProteinHit *prot) const
Definition: IDBoostGraph.h:311
OpenMS::Internal::IDBoostGraph::SetPosteriorVisitor::operator()
void operator()(T &, double) const
Definition: IDBoostGraph.h:294
ExperimentalDesign.h
OpenMS::Internal::IDBoostGraph::LabelVisitor::operator()
OpenMS::String operator()(const PeptideCluster &) const
Definition: IDBoostGraph.h:198
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::PrintAddressVisitor
PrintAddressVisitor(std::basic_ostream< CharT > stream)
Definition: IDBoostGraph.h:228
OpenMS::PeptideIdentification
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:62
OpenMS::Internal::operator==
bool operator==(const IDBoostGraph::ProteinGroup &lhs, const IDBoostGraph::ProteinGroup &rhs)
OpenMS::Internal::IDBoostGraph::dfs_ccsplit_visitor::gs
Graphs & gs
Definition: IDBoostGraph.h:170
OpenMS::PeptideHit::getScore
double getScore() const
returns the PSM score
OpenMS::ScoreToTgtDecLabelPairs
Definition: IDScoreGetterSetter.h:53
OpenMS::Internal::IDBoostGraph::GetPosteriorVisitor
Definition: IDBoostGraph.h:301
OpenMS::Internal::IDBoostGraph::dfs_ccsplit_visitor::examine_edge
void examine_edge(Edge e, const Graph &tg)
Definition: IDBoostGraph.h:155
OpenMS::Internal::IDBoostGraph::IDPointerConst
boost::variant< const ProteinHit *, const ProteinGroup *, const PeptideCluster *, const Peptide, const RunIndex, const Charge, const PeptideHit * > IDPointerConst
Definition: IDBoostGraph.h:115
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::operator()
void operator()(const Charge &chg) const
Definition: IDBoostGraph.h:262
OpenMS::Internal::IDBoostGraph::ProteinNodeSet
std::set< IDBoostGraph::vertex_t > ProteinNodeSet
Definition: IDBoostGraph.h:127
OpenMS::Internal::IDBoostGraph::LabelVisitor::operator()
OpenMS::String operator()(const ProteinHit *prot) const
Definition: IDBoostGraph.h:188
OpenMS::Internal::IDBoostGraph::GraphConst
boost::adjacency_list< boost::setS, boost::vecS, boost::undirectedS, IDPointer > GraphConst
Definition: IDBoostGraph.h:122
OpenMS::ProteinHit::getScore
double getScore() const
returns the score of the protein hit
PeptideIdentification.h
OpenMS::Internal::IDBoostGraph::dfs_ccsplit_visitor
A boost dfs visitor that copies connected components into a vector of graphs.
Definition: IDBoostGraph.h:132
OpenMS::Internal::IDBoostGraph::GetPosteriorVisitor::operator()
double operator()(T &) const
Definition: IDBoostGraph.h:323
OpenMS::Internal::IDBoostGraph
Creates and maintains a boost graph based on the OpenMS ID datastructures.
Definition: IDBoostGraph.h:81
StandardTypes.h
OpenMS::ProteinHit::setScore
void setScore(const double score)
sets the score of the protein hit
OpenMS::PeptideHit::setScore
void setScore(double score)
sets the PSM score
OpenMS::PeptideHit
Representation of a peptide hit.
Definition: PeptideHit.h:55