Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
PeptideHit.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-2016.
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: Nico Pfeifer $
32 // $Authors: $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_METADATA_PEPTIDEHIT_H
36 #define OPENMS_METADATA_PEPTIDEHIT_H
37 
38 #include <vector>
39 
40 #include <OpenMS/CONCEPT/Types.h>
45 
46 namespace OpenMS
47 {
55  class OPENMS_DLLAPI PeptideHit :
56  public MetaInfoInterface
57  {
58 public:
59 
61 
62  class OPENMS_DLLAPI ScoreMore
64  {
65 public:
66  template <typename Arg>
67  bool operator()(const Arg& a, const Arg& b)
68  {
69  return a.getScore() > b.getScore();
70  }
71 
72  };
73 
75  class OPENMS_DLLAPI ScoreLess
76  {
77 public:
78  template <typename Arg>
79  bool operator()(const Arg& a, const Arg& b)
80  {
81  return a.getScore() < b.getScore();
82  }
83 
84  };
85 
87  class OPENMS_DLLAPI RankLess
88  {
89 public:
90  template <typename Arg>
91  bool operator()(const Arg& a, const Arg& b)
92  {
93  return a.getRank() < b.getRank();
94  }
95 
96  };
98 
100  class OPENMS_DLLAPI PepXMLAnalysisResult
101  {
102 public:
103  String score_type; // e.g. peptideprophet / interprophet
104  bool higher_is_better; // is higher score better ?
105  double main_score; // posterior probability for example
106  std::map<String, double> sub_scores;
107 
108  bool operator==(const PepXMLAnalysisResult& rhs) const
109  {
110  return score_type == rhs.score_type
111  && higher_is_better == rhs.higher_is_better
112  && main_score == rhs.main_score
113  && sub_scores == rhs.sub_scores;
114  }
115 
117  {
118  if (this == &source) return *this;
119  score_type = source.score_type;
120  higher_is_better = source.higher_is_better;
121  main_score = source.main_score;
122  sub_scores = source.sub_scores;
123  return *this;
124  }
125 
126  };
127 
130  PeptideHit();
132 
134  PeptideHit(double score,
135  UInt rank,
136  Int charge,
137  const AASequence& sequence);
138 
140  PeptideHit(const PeptideHit& source);
141 
143  virtual ~PeptideHit();
145 
147  PeptideHit& operator=(const PeptideHit& source);
148 
150  bool operator==(const PeptideHit& rhs) const;
151 
153  bool operator!=(const PeptideHit& rhs) const;
154 
158  const AASequence& getSequence() const;
160 
162  void setSequence(const AASequence& sequence);
163 
165  Int getCharge() const;
166 
168  void setCharge(Int charge);
169 
171  const std::vector<PeptideEvidence>& getPeptideEvidences() const;
172 
174  void setPeptideEvidences(const std::vector<PeptideEvidence>& peptide_evidences);
175 
177  void addPeptideEvidence(const PeptideEvidence& peptide_evidence);
178 
180  double getScore() const;
181 
183  void setScore(double score);
184 
186  void setAnalysisResults(std::vector<PepXMLAnalysisResult> aresult);
187 
189  void addAnalysisResults(PepXMLAnalysisResult aresult);
190 
192  const std::vector<PepXMLAnalysisResult>& getAnalysisResults() const;
193 
195  UInt getRank() const;
196 
198  void setRank(UInt newrank);
200 
202  std::set<String> extractProteinAccessions() const;
203 
204 protected:
206 
208  double score_;
209 
211  std::vector<PepXMLAnalysisResult>* analysis_results_;
212 
215 
218 
220  std::vector<PeptideEvidence> peptide_evidences_;
221  };
222 
223 } // namespace OpenMS
224 
225 #endif // OPENMS_METADATA_PEPTIDEHIT_H
double main_score
Definition: PeptideHit.h:105
A more convenient string class.
Definition: String.h:57
Lesser predicate for scores of hits.
Definition: PeptideHit.h:87
UInt rank_
the position(rank) where the hit appeared in the hit list
Definition: PeptideHit.h:214
std::map< String, double > sub_scores
Definition: PeptideHit.h:106
Representation of a peptide/protein sequence.
Definition: AASequence.h:70
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
std::vector< PepXMLAnalysisResult > * analysis_results_
additional scores attached to the original, aggregated score
Definition: PeptideHit.h:211
bool operator()(const Arg &a, const Arg &b)
Definition: PeptideHit.h:67
bool higher_is_better
Definition: PeptideHit.h:104
bool operator()(const Arg &a, const Arg &b)
Definition: PeptideHit.h:91
String score_type
Definition: PeptideHit.h:103
Representation of a peptide hit.
Definition: PeptideHit.h:55
Representation of a peptide evidence.
Definition: PeptideEvidence.h:51
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:56
Int charge_
the charge of the peptide
Definition: PeptideHit.h:217
Analysis Result (containing search engine / prophet results)
Definition: PeptideHit.h:100
bool operator==(const PepXMLAnalysisResult &rhs) const
additional scores attached to the original, aggregated score
Definition: PeptideHit.h:108
Lesser predicate for scores of hits.
Definition: PeptideHit.h:75
double score_
the score of the peptide hit
Definition: PeptideHit.h:208
int Int
Signed integer type.
Definition: Types.h:103
bool operator()(const Arg &a, const Arg &b)
Definition: PeptideHit.h:79
AASequence sequence_
Definition: PeptideHit.h:205
PepXMLAnalysisResult & operator=(const PepXMLAnalysisResult &source)
Definition: PeptideHit.h:116
std::vector< PeptideEvidence > peptide_evidences_
information on the potential peptides observed through this PSM.
Definition: PeptideHit.h:220

OpenMS / TOPP release 2.0.0 Documentation generated on Tue Jan 31 2017 06:39:51 using doxygen 1.8.8