OpenMS
PeptideIdentification.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg $
6 // $Authors: $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
14 
15 
16 #include <string>
17 #include <map>
18 
19 namespace OpenMS
20 {
21  class ConsensusMap;
37  class OPENMS_DLLAPI PeptideIdentification :
38  public MetaInfoInterface
39  {
40 public:
41 
44 
46 
50  virtual ~PeptideIdentification() noexcept;
55 
57  PeptideIdentification& operator=(const PeptideIdentification&) = default;
59  PeptideIdentification& operator=(PeptideIdentification&&) = default; // TODO: add noexcept (gcc 4.8 bug)
61  bool operator==(const PeptideIdentification& rhs) const;
63  bool operator!=(const PeptideIdentification& rhs) const;
65 
67  double getRT() const;
69  void setRT(double rt);
71  bool hasRT() const;
72 
74  double getMZ() const;
76  void setMZ(double mz);
78  bool hasMZ() const;
79 
81  const std::vector<PeptideHit>& getHits() const;
83  std::vector<PeptideHit>& getHits();
85  void insertHit(const PeptideHit& hit);
87  void insertHit(PeptideHit&& hit);
89  void setHits(const std::vector<PeptideHit>& hits);
90  void setHits(std::vector<PeptideHit>&& hits);
91 
93  double getSignificanceThreshold() const;
95  void setSignificanceThreshold(double value);
96 
98  const String& getScoreType() const;
100  void setScoreType(const String& type);
101 
103  bool isHigherScoreBetter() const;
105  void setHigherScoreBetter(bool value);
106 
108  const String& getIdentifier() const;
110  void setIdentifier(const String& id);
111 
113  const String& getBaseName() const;
115  void setBaseName(const String& base_name);
116 
118  const String getExperimentLabel() const;
120  void setExperimentLabel(const String& type);
121 
124  // TODO make a mandatory data member, add to idXML schema, think about storing the
125  // extracted spectrum "number" only!
126  String getSpectrumReference() const;
129  void setSpectrumReference(const String& ref);
130 
132  void assignRanks();
133 
139  void sort();
140 
146  void sortByRank();
147 
149  bool empty() const;
150 
152  static std::vector<PeptideHit> getReferencingHits(const std::vector<PeptideHit>&, const std::set<String>& accession);
153 
162  static std::multimap<String, std::pair<Size, Size>> buildUIDsFromAllPepIDs(const ConsensusMap &cmap);
163 
182  static String buildUIDFromPepID(const PeptideIdentification& pep_id,
183  const std::map<String, StringList>& identifier_to_msrunpath);
184 
185 protected:
186 
187  String id_;
188  std::vector<PeptideHit> hits_;
189  double significance_threshold_;
190  String score_type_;
191  bool higher_score_better_;
192  // hint: here is an alignment gap of 7 bytes <-- here --> use it when introducing new members with sizeof(m)<=4
193  String base_name_;
194  double mz_;
195  double rt_;
196 
197  };
198 
199 } //namespace OpenMS
A container for consensus elements.
Definition: ConsensusMap.h:66
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:35
Representation of a peptide hit.
Definition: PeptideHit.h:31
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:39
PeptideHit HitType
Hit type definition.
Definition: PeptideIdentification.h:43
virtual ~PeptideIdentification() noexcept
destructor
A more convenient string class.
Definition: String.h:34
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:44
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19