OpenMS  2.5.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  namespace Internal
63 {
64 
77  //TODO Add OPENMS_DLLAPI everywhere
78  class OPENMS_DLLAPI IDBoostGraph
79  {
80 
81  public:
82 
83  // boost has a weird extra semicolon in their strong typedef
84  #pragma clang diagnostic push
85  #pragma clang diagnostic ignored "-Wextra-semi"
86 
88  BOOST_STRONG_TYPEDEF(boost::blank, PeptideCluster)
89 
90 
91  BOOST_STRONG_TYPEDEF(double, ProteinGroup)
92 
93 
94  BOOST_STRONG_TYPEDEF(String, Peptide)
95 
96 
97  BOOST_STRONG_TYPEDEF(Size, RunIndex)
98 
99 
100  BOOST_STRONG_TYPEDEF(int, Charge)
101 
102  #pragma clang diagnostic pop
103 
104  //typedefs
105  //TODO rename ProteinGroup type since it collides with the actual OpenMS ProteinGroup
106  typedef boost::variant<ProteinHit*, ProteinGroup, PeptideCluster, Peptide, RunIndex, Charge, PeptideHit*> IDPointer;
107  typedef boost::variant<const ProteinHit*, const ProteinGroup*, const PeptideCluster*, const Peptide, const RunIndex, const Charge, const PeptideHit*> IDPointerConst;
108  //TODO check the impact of different data structures to store nodes/edges
109  // Directed graphs would make the internal computations much easier (less in/out edge checking) but boost
110  // does not allow computation of "non-strongly" connected components for directed graphs, which is what we would
111  // need. We can think about after/while copying to CCs, to insert it into a directed graph!
112  typedef boost::adjacency_list <boost::setS, boost::vecS, boost::undirectedS, IDPointer> Graph;
113  typedef std::vector<Graph> Graphs;
114  typedef boost::adjacency_list <boost::setS, boost::vecS, boost::undirectedS, IDPointer> GraphConst;
115 
116  typedef boost::graph_traits<Graph>::vertex_descriptor vertex_t;
117  typedef boost::graph_traits<Graph>::edge_descriptor edge_t;
118 
119  typedef std::set<IDBoostGraph::vertex_t> ProteinNodeSet;
120  typedef std::set<IDBoostGraph::vertex_t> PeptideNodeSet;
121 
122 
125  public boost::default_dfs_visitor
126  {
127  public:
129  : gs(vgs), curr_v(0), next_v(0), m()
130  {}
131 
132  template < typename Vertex, typename Graph >
133  void start_vertex(Vertex u, const Graph & tg)
134  {
135  gs.emplace_back();
136  next_v = boost::add_vertex(tg[u], gs.back());
137  m[u] = next_v;
138  }
139 
140  template < typename Vertex, typename Graph >
141  void discover_vertex(Vertex /*u*/, const Graph & /*tg*/)
142  {
143  curr_v = next_v;
144  }
145 
146  template < typename Edge, typename Graph >
147  void examine_edge(Edge e, const Graph & tg)
148  {
149  if (m.find(e.m_target) == m.end())
150  {
151  next_v = boost::add_vertex(tg[e.m_target], gs.back());
152  m[e.m_target] = next_v;
153  }
154  else
155  {
156  next_v = m[e.m_target];
157  }
158 
159  boost::add_edge(m[e.m_source], next_v, gs.back());
160  }
161 
163  vertex_t curr_v, next_v;
165  std::map<vertex_t, vertex_t> m;
166  };
167 
168  //TODO group visitors by templates
171  public boost::static_visitor<OpenMS::String>
172  {
173  public:
174 
176  {
177  return pep->getSequence().toString() + "_" + pep->getCharge();
178  }
179 
181  {
182  return prot->getAccession();
183  }
184 
185  OpenMS::String operator()(const ProteinGroup& /*protgrp*/) const
186  {
187  return String("PG");
188  }
189 
190  OpenMS::String operator()(const PeptideCluster& /*pc*/) const
191  {
192  return String("PepClust");
193  }
194 
195  OpenMS::String operator()(const Peptide& peptide) const
196  {
197  return peptide;
198  }
199 
200  OpenMS::String operator()(const RunIndex& ri) const
201  {
202  return String("rep" + String(ri));
203  }
204 
205  OpenMS::String operator()(const Charge& chg) const
206  {
207  return String("chg" + String(chg));
208  }
209 
210  };
211 
214  template<class CharT>
216  public boost::static_visitor<>
217  {
218  public:
219 
220  explicit PrintAddressVisitor(std::basic_ostream<CharT> stream):
221  stream_(stream)
222  {}
223 
224  void operator()(PeptideHit* pep) const
225  {
226  stream_ << pep->getSequence().toUnmodifiedString() << ": " << pep << std::endl;
227  }
228 
229  void operator()(ProteinHit* prot) const
230  {
231  stream_ << prot->getAccession() << ": " << prot << std::endl;
232  }
233 
234  void operator()(const ProteinGroup& /*protgrp*/) const
235  {
236  stream_ << "PG" << std::endl;
237  }
238 
239  void operator()(const PeptideCluster& /*pc*/) const
240  {
241  stream_ << "PepClust" << std::endl;
242  }
243 
244  void operator()(const Peptide& peptide) const
245  {
246  stream_ << peptide << std::endl;
247  }
248 
249  void operator()(const RunIndex& ri) const
250  {
251  stream_ << "rep" << ri << std::endl;
252  }
253 
254  void operator()(const Charge& chg) const
255  {
256  stream_ << "chg" << chg << std::endl;
257  }
258 
259  std::basic_ostream<CharT> stream_;
260  };
261 
265  public boost::static_visitor<>
266  {
267  public:
268 
269  void operator()(PeptideHit* pep, double posterior) const
270  {
271  pep->setScore(posterior);
272  }
273 
274  void operator()(ProteinHit* prot, double posterior) const
275  {
276  prot->setScore(posterior);
277  }
278 
279  void operator()(ProteinGroup& pg, double posterior) const
280  {
281  pg = posterior;
282  }
283 
284  // Everything else, do nothing for now
285  template <class T>
286  void operator()(T& /*any node type*/, double /*posterior*/) const
287  {
288  // do nothing
289  }
290 
291  };
292 
294  public boost::static_visitor<double>
295  {
296  public:
297 
298  double operator()(PeptideHit* pep) const
299  {
300  return pep->getScore();
301  }
302 
303  double operator()(ProteinHit* prot) const
304  {
305  return prot->getScore();
306  }
307 
308  double operator()(ProteinGroup& pg) const
309  {
310  return pg;
311  }
312 
313  // Everything else, do nothing for now
314  template <class T>
315  double operator()(T& /*any node type*/) const
316  {
317  return -1.0;
318  }
319 
320  };
321 
324  std::vector<PeptideIdentification>& idedSpectra,
325  Size use_top_psms,
326  bool use_run_info,
327  const boost::optional<const ExperimentalDesign>& ed = boost::optional<const ExperimentalDesign>());
328 
330  ConsensusMap& cmap,
331  Size use_top_psms,
332  bool use_run_info,
333  bool use_unassigned_ids,
334  const boost::optional<const ExperimentalDesign>& ed = boost::optional<const ExperimentalDesign>());
335 
336 
338  void applyFunctorOnCCs(const std::function<unsigned long(Graph&)>& functor);
340  void applyFunctorOnCCsST(const std::function<void(Graph&)>& functor);
341 
344  void clusterIndistProteinsAndPeptides();
345 
346  //TODO create a new class for an extended Graph and try to reuse as much as possible
347  // use inheritance or templates
349  void clusterIndistProteinsAndPeptidesAndExtendGraph();
350 
357  void annotateIndistProteins(bool addSingletons = true);
358 
362  void calculateAndAnnotateIndistProteins(bool addSingletons = true);
363 
365  void computeConnectedComponents();
366 
367 
368 
370  Size getNrConnectedComponents();
371 
372  const Graph& getComponent(Size cc);
373 
374  ProteinIdentification& getProteinIDs();
375 
376  //TODO docu
377  //void buildExtendedGraph(bool use_all_psms, std::pair<int,int> chargeRange, unsigned int nrReplicates);
378 
379  static void printGraph(std::ostream& out, const Graph& fg);
380 
381  private:
382 
384 
385  struct SequenceToReplicateChargeVariantHierarchy;
386 
387 
388  //TODO introduce class hierarchy:
389  /*
390  * IDGraph<UnderlyingIDStruc>
391  *
392  * - BasicGraph<>
393  * - ExtendedGraphClustered<>
394  * - ExtendedGraphClusteredWithRunInfo<>
395  *
396  * in theory extending a basic one is desirable to create the extended one. But it means we have to
397  * copy/move the graph (node by node) because the nodes are of a broader boost::variant type. So we probably have to
398  * duplicate code and offer a from-scratch step-wise building for the extended graph, too.
399  * Note that there could be several levels of extension in the future. For now I keep everything in one
400  * class by having potential storage for the broadest extended type. Differences in the underlying ID structure
401  * e.g. ConsensusMap or PeptideIDs from idXML currently only have an effect during building, so I just overload
402  * the constructors. In theory it would be nice to generalize on that, too, especially when we adapt to the new
403  * ID data structure.
404  */
405 
406 
407  /* ---------------- Either of them is used, preferably second --------------- */
409  Graph g;
410 
413  /* ---------------------------------------------------------------------------- */
414 
415  #ifdef INFERENCE_BENCH
416  std::vector<std::tuple<vertex_t, vertex_t, unsigned long, double>> sizes_and_times_{1};
418  #endif
419 
420 
421  /* ---- Only used when run information was available --------- */
422 
423  //TODO think about preallocating it, but the number of peptide hits is not easily computed
424  // since they are inside the pepIDs
425 
426  //TODO would multiple sets be better?
427 
430  std::unordered_map<vertex_t, Size> pepHitVtx_to_run_;
431 
436  Size nrPrefractionationGroups_ = 0;
437 
438  /* ----------------------------------------------------------- */
439 
440 
443  vertex_t addVertexWithLookup_(IDPointer& ptr, std::unordered_map<IDPointer, vertex_t, boost::hash<IDPointer>>& vertex_map);
444  //vertex_t addVertexWithLookup_(IDPointerConst& ptr, std::unordered_map<IDPointerConst, vertex_t, boost::hash<IDPointerConst>>& vertex_map);
445 
446 
448  void annotateIndistProteins_(const Graph& fg, bool addSingletons);
449  void calculateAndAnnotateIndistProteins_(const Graph& fg, bool addSingletons);
450 
458  void buildGraph_(ProteinIdentification& proteins,
459  std::vector<PeptideIdentification>& idedSpectra,
460  Size use_top_psms);
461 
462  void buildGraph_(ProteinIdentification& proteins,
463  ConsensusMap& cmap,
464  Size use_top_psms,
465  bool use_unassigned_ids);
466 
468  void addPeptideIDWithAssociatedProteins_(
469  PeptideIdentification& spectrum,
470  std::unordered_map<IDPointer, vertex_t, boost::hash<IDPointer>>& vertex_map,
471  const std::unordered_map<std::string, ProteinHit*>& accession_map,
472  Size use_top_psms);
473 
474  void addPeptideAndAssociatedProteinsWithRunInfo_(
475  PeptideIdentification& spectrum,
476  std::unordered_map<unsigned, unsigned>& indexToPrefractionationGroup,
477  std::unordered_map<IDPointer, vertex_t, boost::hash<IDPointer>>& vertex_map,
478  std::unordered_map<std::string, ProteinHit*>& accession_map,
479  Size use_top_psms
480  );
481 
488  void buildGraphWithRunInfo_(ProteinIdentification& proteins,
489  ConsensusMap& cmap,
490  Size use_top_psms,
491  bool use_unassigned_ids,
492  const ExperimentalDesign& ed);
493 
494  void buildGraphWithRunInfo_(ProteinIdentification& proteins,
495  std::vector<PeptideIdentification>& idedSpectra,
496  Size use_top_psms,
497  const ExperimentalDesign& ed);
498 
499 
500  void getUpstreamNodesNonRecursive(std::queue<vertex_t>& q, Graph graph, int lvl,
501  bool stop_at_first, std::vector<vertex_t>& result);
502 
503  void resolveGraphPeptideCentric_(Graph& fg);
504 
505  template<class NodeType>
506  void getDownstreamNodes(vertex_t start, Graph graph, std::vector<NodeType>& result)
507  {
508  Graph::adjacency_iterator adjIt, adjIt_end;
509  boost::tie(adjIt, adjIt_end) = boost::adjacent_vertices(start, graph);
510  for (;adjIt != adjIt_end; ++adjIt)
511  {
512  if (graph[*adjIt].type() == typeid(NodeType))
513  {
514  result.emplace_back(boost::get<NodeType>(graph[*adjIt]));
515  }
516  else if (graph[*adjIt].which() > graph[start].which())
517  {
518  getDownstreamNodes(*adjIt, graph, result);
519  }
520  }
521  }
522 
523  template<class NodeType>
524  void getUpstreamNodes(vertex_t start, Graph graph, std::vector<NodeType>& result)
525  {
526  Graph::adjacency_iterator adjIt, adjIt_end;
527  boost::tie(adjIt, adjIt_end) = boost::adjacent_vertices(start, graph);
528  for (;adjIt != adjIt_end; ++adjIt)
529  {
530  if (graph[*adjIt].type() == typeid(NodeType))
531  {
532  result.emplace_back(boost::get<NodeType>(graph[*adjIt]));
533  }
534  else if (graph[*adjIt].which() < graph[start].which())
535  {
536  getUpstreamNodes(*adjIt, graph, result);
537  }
538  }
539  }
540  };
541 
542 } } //namespace OpenMS
543 
LogStream.h
OpenMS::Internal::IDBoostGraph::SetPosteriorVisitor::operator()
void operator()(ProteinGroup &pg, double posterior) const
Definition: IDBoostGraph.h:279
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:120
OpenMS::ExperimentalDesign
Representation of the Experimental Design in OpenMS. Instances can be loaded via the ExperimentalDesi...
Definition: ExperimentalDesign.h:85
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor
Definition: IDBoostGraph.h:215
OpenMS::Internal::IDBoostGraph::getUpstreamNodes
void getUpstreamNodes(vertex_t start, Graph graph, std::vector< NodeType > &result)
Definition: IDBoostGraph.h:524
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::operator()
void operator()(const PeptideCluster &) const
Definition: IDBoostGraph.h:239
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::operator()
void operator()(PeptideHit *pep) const
Definition: IDBoostGraph.h:224
OpenMS::Internal::IDBoostGraph::ccs_
Graphs ccs_
the Graph split into connected components
Definition: IDBoostGraph.h:412
OpenMS::Internal::IDBoostGraph::vertex_t
boost::graph_traits< Graph >::vertex_descriptor vertex_t
Definition: IDBoostGraph.h:116
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::stream_
std::basic_ostream< CharT > stream_
Definition: IDBoostGraph.h:259
OpenMS::Internal::IDBoostGraph::SetPosteriorVisitor
Definition: IDBoostGraph.h:264
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:274
Types.h
OpenMS::Internal::IDBoostGraph::LabelVisitor::operator()
OpenMS::String operator()(const ProteinGroup &) const
Definition: IDBoostGraph.h:185
OpenMS::Internal::IDBoostGraph::LabelVisitor::operator()
OpenMS::String operator()(const Peptide &peptide) const
Definition: IDBoostGraph.h:195
OpenMS::Internal::IDBoostGraph::LabelVisitor::operator()
OpenMS::String operator()(const RunIndex &ri) const
Definition: IDBoostGraph.h:200
OpenMS::Internal::IDBoostGraph::LabelVisitor::operator()
OpenMS::String operator()(const Charge &chg) const
Definition: IDBoostGraph.h:205
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::Internal::IDBoostGraph::GetPosteriorVisitor::operator()
double operator()(ProteinGroup &pg) const
Definition: IDBoostGraph.h:308
OpenMS::Internal::IDBoostGraph::Graph
boost::adjacency_list< boost::setS, boost::vecS, boost::undirectedS, IDPointer > Graph
Definition: IDBoostGraph.h:112
OpenMS::Internal::IDBoostGraph::dfs_ccsplit_visitor::next_v
vertex_t next_v
Definition: IDBoostGraph.h:163
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:57
OpenMS::Internal::IDBoostGraph::SetPosteriorVisitor::operator()
void operator()(PeptideHit *pep, double posterior) const
Definition: IDBoostGraph.h:269
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:71
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::operator()
void operator()(ProteinHit *prot) const
Definition: IDBoostGraph.h:229
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:385
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::operator()
void operator()(const Peptide &peptide) const
Definition: IDBoostGraph.h:244
OpenMS::Internal::IDBoostGraph::dfs_ccsplit_visitor::dfs_ccsplit_visitor
dfs_ccsplit_visitor(Graphs &vgs)
Definition: IDBoostGraph.h:128
ProteinIdentification.h
OpenMS::Internal::IDBoostGraph::Graphs
std::vector< Graph > Graphs
Definition: IDBoostGraph.h:113
OpenMS::Internal::IDBoostGraph::edge_t
boost::graph_traits< Graph >::edge_descriptor edge_t
Definition: IDBoostGraph.h:117
OpenMS::Internal::IDBoostGraph::LabelVisitor::operator()
OpenMS::String operator()(const PeptideHit *pep) const
Definition: IDBoostGraph.h:175
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:170
OpenMS::Internal::IDBoostGraph::pepHitVtx_to_run_
std::unordered_map< vertex_t, Size > pepHitVtx_to_run_
Definition: IDBoostGraph.h:430
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::operator()
void operator()(const ProteinGroup &) const
Definition: IDBoostGraph.h:234
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::operator()
void operator()(const RunIndex &ri) const
Definition: IDBoostGraph.h:249
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:165
OpenMS::Internal::IDBoostGraph::IDPointer
boost::variant< ProteinHit *, ProteinGroup, PeptideCluster, Peptide, RunIndex, Charge, PeptideHit * > IDPointer
placeholder for peptides with the same parent proteins or protein groups
Definition: IDBoostGraph.h:106
OpenMS::Internal::IDBoostGraph::GetPosteriorVisitor::operator()
double operator()(PeptideHit *pep) const
Definition: IDBoostGraph.h:298
MessagePasserFactory.h
OpenMS::Internal::IDBoostGraph::protIDs_
ProteinIdentification & protIDs_
Definition: IDBoostGraph.h:383
OpenMS::Internal::IDBoostGraph::getDownstreamNodes
void getDownstreamNodes(vertex_t start, Graph graph, std::vector< NodeType > &result)
Definition: IDBoostGraph.h:506
OpenMS::Internal::IDBoostGraph::dfs_ccsplit_visitor::discover_vertex
void discover_vertex(Vertex, const Graph &)
Definition: IDBoostGraph.h:141
OpenMS::ConsensusMap
A container for consensus elements.
Definition: ConsensusMap.h:79
OpenMS::Internal::IDBoostGraph::dfs_ccsplit_visitor::start_vertex
void start_vertex(Vertex u, const Graph &tg)
Definition: IDBoostGraph.h:133
OpenMS::Internal::IDBoostGraph::GetPosteriorVisitor::operator()
double operator()(ProteinHit *prot) const
Definition: IDBoostGraph.h:303
OpenMS::Internal::IDBoostGraph::SetPosteriorVisitor::operator()
void operator()(T &, double) const
Definition: IDBoostGraph.h:286
ExperimentalDesign.h
OpenMS::Internal::IDBoostGraph::LabelVisitor::operator()
OpenMS::String operator()(const PeptideCluster &) const
Definition: IDBoostGraph.h:190
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::PrintAddressVisitor
PrintAddressVisitor(std::basic_ostream< CharT > stream)
Definition: IDBoostGraph.h:220
OpenMS::PeptideIdentification
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:62
OpenMS::Internal::IDBoostGraph::dfs_ccsplit_visitor::gs
Graphs & gs
Definition: IDBoostGraph.h:162
OpenMS::PeptideHit::getScore
double getScore() const
returns the PSM score
OpenMS::Internal::IDBoostGraph::GetPosteriorVisitor
Definition: IDBoostGraph.h:293
OpenMS::Internal::IDBoostGraph::dfs_ccsplit_visitor::examine_edge
void examine_edge(Edge e, const Graph &tg)
Definition: IDBoostGraph.h:147
OpenMS::Internal::IDBoostGraph::IDPointerConst
boost::variant< const ProteinHit *, const ProteinGroup *, const PeptideCluster *, const Peptide, const RunIndex, const Charge, const PeptideHit * > IDPointerConst
Definition: IDBoostGraph.h:107
OpenMS::Internal::IDBoostGraph::PrintAddressVisitor::operator()
void operator()(const Charge &chg) const
Definition: IDBoostGraph.h:254
OpenMS::Internal::IDBoostGraph::ProteinNodeSet
std::set< IDBoostGraph::vertex_t > ProteinNodeSet
Definition: IDBoostGraph.h:119
OpenMS::Internal::IDBoostGraph::LabelVisitor::operator()
OpenMS::String operator()(const ProteinHit *prot) const
Definition: IDBoostGraph.h:180
OpenMS::Internal::IDBoostGraph::GraphConst
boost::adjacency_list< boost::setS, boost::vecS, boost::undirectedS, IDPointer > GraphConst
Definition: IDBoostGraph.h:114
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:124
OpenMS::Internal::IDBoostGraph::GetPosteriorVisitor::operator()
double operator()(T &) const
Definition: IDBoostGraph.h:315
OpenMS::Internal::IDBoostGraph
Creates and maintains a boost graph based on the OpenMS ID datastructures.
Definition: IDBoostGraph.h:78
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:54