libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
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
39namespace pappso
40{
41
42
43class Protein;
44
45/** \brief shared pointer on a Protein object
46 */
47typedef std::shared_ptr<const Protein> ProteinSp;
48
50{
51
52 public:
53 Protein();
54 Protein(const QString &description, const QString &sequence);
55 Protein(const Protein &protein);
56 virtual ~Protein();
57 ProteinSp makeProteinSp() const;
58
59 bool operator==(const Protein &other) const;
60
61 const QString &getSequence() const;
62
63 void setSequence(const QString &sequence);
64
65 const QString &getAccession() const;
66
67 virtual void setAccession(const QString &accession);
68
69 const QString &getDescription() const;
70
71 void setDescription(const QString &description);
72
73 /** \brief remove * characters at the end of the sequence
74 */
75 Protein &removeTranslationStop();
76
77 /** \brief reverse characters in the sequence
78 */
79 Protein &reverse();
80
81 /** \brief protein amino acid sequence size
82 */
83 unsigned int size() const;
84
85 /** \brief get monoisotopic mass of ProteinSp Protein::makeProteinSp() const
86 */
87 pappso_double getMass() const;
88
89 private:
90 /** \brief free text to describe the protein */
92 /** \brief a single unique identifier of the protein (usually the first word
93 * of description) */
94 QString m_accession;
95 /** \brief the amino acid sequence */
96 QString m_sequence;
97 /** \brief number of amino acid */
98 unsigned int m_length = 0;
99
100 static QRegularExpression m_removeTranslationStopRegExp;
101};
102
103
104} // namespace pappso
QString m_sequence
the amino acid sequence
Definition protein.h:96
static QRegularExpression m_removeTranslationStopRegExp
Definition protein.h:100
QString m_accession
a single unique identifier of the protein (usually the first word of description)
Definition protein.h:94
QString m_description
free text to describe the protein
Definition protein.h:91
#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:50
std::shared_ptr< const Protein > ProteinSp
shared pointer on a Protein object
Definition protein.h:47
bool operator==(Aa const &l, Aa const &r)
Definition aa.cpp:341