libpappsomspp
Library for mass spectrometry
aa.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/amino_acid/aaBase.h
3  * \date 7/3/2015
4  * \author Olivier Langella
5  * \brief amino acid model
6  */
7 
8 /*******************************************************************************
9  * Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
10  *
11  * This file is part of the PAPPSOms++ library.
12  *
13  * PAPPSOms++ is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation, either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * PAPPSOms++ is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
25  *
26  * Contributors:
27  * Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
28  *implementation
29  ******************************************************************************/
30 
31 
32 #pragma once
33 
34 #include <vector>
35 #include "../types.h"
36 #include "aabase.h"
37 #include "aamodification.h"
38 
39 
40 namespace pappso
41 {
42 
43 
44 class PMSPP_LIB_DECL Aa : public AaBase
45 {
46  public:
47  Aa(char aa_letter);
48  Aa(AminoAcidChar aa_char);
49  Aa(const Aa &aa);
50  Aa(Aa &&toCopy); // move constructor
51  Aa &operator=(const Aa &toCopy);
52 
53  virtual ~Aa();
54 
55  pappso_double getMass() const override;
56  int getNumberOfAtom(AtomIsotopeSurvey atom) const override final;
57  int getNumberOfIsotope(Isotope isotope) const override final;
58  unsigned int getNumberOfModification(AaModificationP mod) const;
59 
60  /* \brief print modification except internal modifications */
61  const QString toString() const;
62  /* \brief print all modifications */
63  const QString toAbsoluteString() const;
64 
65 
66  void addAaModification(AaModificationP aaModification);
67  void removeAaModification(AaModificationP aaModification);
68 
69 
70  /** @brief replaces all occurences of a modification by a new one
71  * @param oldmod modification to change
72  * @param newmod new modification
73  */
74  void replaceAaModification(AaModificationP oldmod, AaModificationP newmod);
75 
76 
77  AaModificationP getInternalNterModification() const;
78  AaModificationP getInternalCterModification() const;
79  void removeInternalNterModification();
80  void removeInternalCterModification();
81 
82  const std::vector<AaModificationP> &getModificationList() const;
83 
84  bool isLesser(Aa const &r) const;
85  bool isAaEqual(Aa const &r) const;
86 
87  private:
88  // const pappso_double _aa_mass;
89  std::vector<AaModificationP> m_listMod;
90 };
91 
92 bool operator<(const Aa &l, const Aa &r);
93 
94 bool operator==(const Aa &l, const Aa &r);
95 
96 } /* namespace pappso */
private amino acid model
amino acid modification model
Definition: aa.h:45
std::vector< AaModificationP > m_listMod
Definition: aa.h:89
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
AminoAcidChar
Definition: types.h:134
bool operator<(Aa const &l, Aa const &r)
Definition: aa.cpp:286
AtomIsotopeSurvey
Definition: types.h:77
double pappso_double
A type definition for doubles.
Definition: types.h:49
Isotope
Definition: types.h:92
bool operator==(Aa const &l, Aa const &r)
Definition: aa.cpp:280