OpenMS
PeptideEvidence.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: Timo Sachsenberg $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <OpenMS/CONCEPT/Types.h>
13 
14 namespace OpenMS
15 {
16 
24  class OPENMS_DLLAPI PeptideEvidence
25  {
26 public:
27  static const int UNKNOWN_POSITION; // == -1
28 
29  // Note: we use 0 as position of the N-terminus while e.g. mzTab or other formats start counting at 1.
30  static const int N_TERMINAL_POSITION;
31  static const char UNKNOWN_AA; // PeptideEvidence::UNKNOWN_AA = 'X';
32 
33  // Note: we use '[' and ']' instead of e.g. '-' as in mzTab specification
34  static const char N_TERMINAL_AA;
35  static const char C_TERMINAL_AA;
36 
39 
41  explicit PeptideEvidence(const String& accession, Int start=UNKNOWN_POSITION, Int end=UNKNOWN_POSITION, char aa_before=UNKNOWN_AA, char aa_after=UNKNOWN_AA);
42 
44  PeptideEvidence(const PeptideEvidence&) = default;
45 
47  PeptideEvidence(PeptideEvidence&&) noexcept = default;
48 
52 
56  PeptideEvidence& operator=(PeptideEvidence&&) = default; // TODO: add noexcept (gcc 4.8 bug)
57 
59  bool operator==(const PeptideEvidence& rhs) const;
60 
62  bool operator<(const PeptideEvidence& rhs) const;
63 
65  bool operator!=(const PeptideEvidence& rhs) const;
66 
68  bool hasValidLimits() const;
69 
71  const String& getProteinAccession() const;
72 
74  void setProteinAccession(const String& s);
75 
77  void setStart(const Int a);
78 
80  Int getStart() const;
81 
83  void setEnd(const Int a);
84 
86  Int getEnd() const;
87 
89  void setAABefore(const char acid);
90 
92  char getAABefore() const;
93 
95  void setAAAfter(const char acid);
96 
98  char getAAAfter() const;
99 
100 protected:
102 
104 
106 
108 
109  char aa_after_;
110  };
111 
112 }
113 
Representation of a peptide evidence.
Definition: PeptideEvidence.h:25
static const char C_TERMINAL_AA
Definition: PeptideEvidence.h:35
void setAAAfter(const char acid)
sets the amino acid single letter code after the sequence (subsequent amino acid in the protein)....
void setProteinAccession(const String &s)
set the protein accession the peptide matches to. If not available set to empty string.
Int getStart() const
get the position in the protein (starting at 0 for the N-terminus). If not available UNKNOWN_POSITION...
char aa_before_
Definition: PeptideEvidence.h:107
char aa_after_
Definition: PeptideEvidence.h:109
Int end_
Definition: PeptideEvidence.h:105
void setStart(const Int a)
set the position of the last AA of the peptide in protein coordinates (starting at 0 for the N-termin...
static const char N_TERMINAL_AA
Definition: PeptideEvidence.h:34
static const int UNKNOWN_POSITION
Definition: PeptideEvidence.h:27
bool operator<(const PeptideEvidence &rhs) const
Less operator.
static const int N_TERMINAL_POSITION
Definition: PeptideEvidence.h:30
PeptideEvidence(const String &accession, Int start=UNKNOWN_POSITION, Int end=UNKNOWN_POSITION, char aa_before=UNKNOWN_AA, char aa_after=UNKNOWN_AA)
Constructor.
const String & getProteinAccession() const
get the protein accession the peptide matches to. If not available the empty string is returned.
PeptideEvidence(PeptideEvidence &&) noexcept=default
Move constructor.
PeptideEvidence()
Constructor.
PeptideEvidence(const PeptideEvidence &)=default
Copy constructor.
char getAAAfter() const
returns the amino acid single letter code after the sequence (subsequent amino acid in the protein)....
String accession_
Definition: PeptideEvidence.h:101
bool hasValidLimits() const
start and end numbers in evidence represent actual numeric indices
char getAABefore() const
returns the amino acid single letter code before the sequence (preceding amino acid in the protein)....
static const char UNKNOWN_AA
Definition: PeptideEvidence.h:31
Int start_
Definition: PeptideEvidence.h:103
bool operator==(const PeptideEvidence &rhs) const
Equality operator.
void setEnd(const Int a)
set the position of the last AA of the peptide in protein coordinates (starting at 0 for the N-termin...
PeptideEvidence & operator=(PeptideEvidence &&)=default
Move assignment operator.
Int getEnd() const
get the position of the last AA of the peptide in protein coordinates (starting at 0 for the N-termin...
PeptideEvidence & operator=(const PeptideEvidence &)=default
Assignment operator.
void setAABefore(const char acid)
sets the amino acid single letter code before the sequence (preceding amino acid in the protein)....
bool operator!=(const PeptideEvidence &rhs) const
not equal
A more convenient string class.
Definition: String.h:34
int Int
Signed integer type.
Definition: Types.h:72
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19