libpappsomspp
Library for mass spectrometry
protein.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/protein/protein.h
3  * \date 2/7/2015
4  * \author Olivier Langella
5  * \brief object to handle a protein
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 <QString>
35 #include <memory>
36 #include "../types.h"
37 #include "../exportinmportconfig.h"
38 
39 namespace pappso
40 {
41 
42 
43 class Protein;
44 
45 /** \brief shared pointer on a Protein object
46  */
47 typedef std::shared_ptr<const Protein> ProteinSp;
48 
50 {
51  private:
52  /** \brief free text to describe the protein */
53  QString m_description;
54  /** \brief a single unique identifier of the protein (usually the first word
55  * of description) */
56  QString m_accession;
57  /** \brief the amino acid sequence */
58  QString m_sequence;
59  /** \brief number of amino acid */
60  unsigned int m_length = 0;
61 
62  static QRegularExpression m_removeTranslationStopRegExp;
63 
64  public:
65  Protein();
66  Protein(const QString &description, const QString &sequence);
67  Protein(const Protein &protein);
68  ProteinSp makeProteinSp() const;
69 
70  bool operator==(const Protein &other) const;
71  ~Protein();
72 
73  const QString &getSequence() const;
74 
75  void setSequence(const QString &sequence);
76 
77  const QString &getAccession() const;
78 
79  virtual void setAccession(const QString &accession);
80 
81  const QString &getDescription() const;
82 
83  void setDescription(const QString &description);
84 
85  /** \brief remove * characters at the end of the sequence
86  */
87  Protein &removeTranslationStop();
88 
89  /** \brief reverse characters in the sequence
90  */
91  Protein &reverse();
92 
93  /** \brief protein amino acid sequence size
94  */
95  unsigned int size() const;
96 
97  /** \brief get monoisotopic mass of ProteinSp Protein::makeProteinSp() const
98  */
99  pappso_double getMass() const;
100 };
101 
102 
103 } // namespace pappso
QString m_sequence
the amino acid sequence
Definition: protein.h:58
static QRegularExpression m_removeTranslationStopRegExp
Definition: protein.h:62
QString m_accession
a single unique identifier of the protein (usually the first word of description)
Definition: protein.h:56
QString m_description
free text to describe the protein
Definition: protein.h:53
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
double pappso_double
A type definition for doubles.
Definition: types.h:49
std::shared_ptr< const Protein > ProteinSp
shared pointer on a Protein object
Definition: protein.h:43
bool operator==(Aa const &l, Aa const &r)
Definition: aa.cpp:280