| OpenMS 2.5.0

PeptideIdentification.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: Timo Sachsenberg $
32 // $Authors: $
33 // --------------------------------------------------------------------------
34
35 #pragma once
36
37 #include <OpenMS/METADATA/PeptideHit.h>
38 #include <OpenMS/METADATA/MetaInfoInterface.h>
39 #include <OpenMS/METADATA/ProteinHit.h>
40
41 #include <string>
42 #include <map>
43
44 namespace OpenMS
45 {
62 class OPENMS_DLLAPI PeptideIdentification :
63 public MetaInfoInterface
64 {
65 public:
66
68 typedef PeptideHit HitType;
69
71
72 PeptideIdentification();
75 virtual ~PeptideIdentification() noexcept;
77 PeptideIdentification(const PeptideIdentification&) = default;
79 PeptideIdentification(PeptideIdentification&&) noexcept = default;
80
82 PeptideIdentification& operator=(const PeptideIdentification&) = default;
84 PeptideIdentification& operator=(PeptideIdentification&&) = default; // TODO: add noexcept (gcc 4.8 bug)
86 bool operator==(const PeptideIdentification& rhs) const;
88 bool operator!=(const PeptideIdentification& rhs) const;
90
92 double getRT() const;
94 void setRT(double rt);
96 bool hasRT() const;
97
99 double getMZ() const;
101 void setMZ(double mz);
103 bool hasMZ() const;
104
106 const std::vector<PeptideHit>& getHits() const;
108 std::vector<PeptideHit>& getHits();
110 void insertHit(const PeptideHit& hit);
112 void insertHit(PeptideHit&& hit);
114 void setHits(const std::vector<PeptideHit>& hits);
115
117 double getSignificanceThreshold() const;
119 void setSignificanceThreshold(double value);
120
122 const String& getScoreType() const;
124 void setScoreType(const String& type);
125
127 bool isHigherScoreBetter() const;
129 void setHigherScoreBetter(bool value);
130
132 const String& getIdentifier() const;
134 void setIdentifier(const String& id);
135
137 const String& getBaseName() const;
139 void setBaseName(const String& base_name);
140
142 const String getExperimentLabel() const;
144 void setExperimentLabel(const String& type);
145
147 void assignRanks();
148
154 void sort();
155
161 void sortByRank();
162
164 bool empty() const;
165
167 static std::vector<PeptideHit> getReferencingHits(const std::vector<PeptideHit>&, const std::set<String>& accession);
168
169 protected:
170
171 String id_;
172 std::vector<PeptideHit> hits_;
173 double significance_threshold_;
174 String score_type_;
175 bool higher_score_better_;
176 // hint: here is an alignment gap of 7 bytes <-- here --> use it when introducing new members with sizeof(m)<=4
177 String base_name_;
178 double mz_;
179 double rt_;
180
181 };
182
183 } //namespace OpenMS
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::PeptideIdentification::HitType
PeptideHit HitType
Hit type definition.
Definition: PeptideIdentification.h:68
std
STL namespace.
ProteinHit.h
PeptideHit.h
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::PeptideHit
Representation of a peptide hit.
Definition: PeptideHit.h:54
OpenMS::PeptideIdentification
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:62
MetaInfoInterface.h
OpenMS::MetaInfoInterface
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:60