OpenMS
Loading...
Searching...
No Matches
ConsensusMapMergerAlgorithm.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
15
16#include <unordered_set>
17
18namespace OpenMS
19{
36 class OPENMS_DLLAPI ConsensusMapMergerAlgorithm:
38 public ProgressLogger
39 {
40 public:
42
52
57 void mergeAllIDRuns(ConsensusMap& cmap) const;
58
64 const std::map<unsigned, unsigned>& mapIdx_to_new_protIDRun) const;
65
66 private:
67
72 bool checkOldRunConsistency_(const std::vector<ProteinIdentification>& protRuns, const std::string& experiment_type) const;
74 bool checkOldRunConsistency_(const std::vector<ProteinIdentification>& protRuns, const ProteinIdentification& ref, const std::string& experiment_type) const;
75
76
77 static size_t accessionHash_(const ProteinHit& p)
78 {
79 return std::hash<std::string>()(p.getAccession());
80 }
81 static bool accessionEqual_(const ProteinHit& p1, const ProteinHit& p2)
82 {
83 return p1.getAccession() == p2.getAccession();
84 }
85 using hash_type = std::size_t (*)(const ProteinHit&);
86 using equal_type = bool (*)(const ProteinHit&, const ProteinHit&);
87
88 };
89} // namespace OpenMS
Merges identification data in ConsensusMaps.
Definition ConsensusMapMergerAlgorithm.h:39
bool(*)(const ProteinHit &, const ProteinHit &) equal_type
Definition ConsensusMapMergerAlgorithm.h:86
void mergeAllIDRuns(ConsensusMap &cmap) const
void mergeProteinsAcrossFractionsAndReplicates(ConsensusMap &cmap, const ExperimentalDesign &exp_design) const
bool checkOldRunConsistency_(const std::vector< ProteinIdentification > &protRuns, const std::string &experiment_type) const
std::size_t(*)(const ProteinHit &) hash_type
Definition ConsensusMapMergerAlgorithm.h:85
static size_t accessionHash_(const ProteinHit &p)
Definition ConsensusMapMergerAlgorithm.h:77
bool checkOldRunConsistency_(const std::vector< ProteinIdentification > &protRuns, const ProteinIdentification &ref, const std::string &experiment_type) const
Same as above but with specific reference run.
void mergeProteinIDRuns(ConsensusMap &cmap, const std::map< unsigned, unsigned > &mapIdx_to_new_protIDRun) const
static bool accessionEqual_(const ProteinHit &p1, const ProteinHit &p2)
Definition ConsensusMapMergerAlgorithm.h:81
A container for consensus elements.
Definition ConsensusMap.h:67
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
Representation of an experimental design in OpenMS. Instances can be loaded with the ExperimentalDesi...
Definition ExperimentalDesign.h:109
Base class for all classes that want to report their progress.
Definition ProgressLogger.h:27
Representation of a protein hit.
Definition ProteinHit.h:34
const std::string & getAccession() const
returns the accession of the protein
Representation of a protein identification run.
Definition ProteinIdentification.h:55
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19