pappsomspp
Library for mass spectrometry
grpprotein.h
Go to the documentation of this file.
1 
2 /*******************************************************************************
3  * Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
4  *
5  * This file is part of the PAPPSOms++ library.
6  *
7  * PAPPSOms++ is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * PAPPSOms++ is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
19  *
20  * Contributors:
21  * Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
22  *implementation
23  ******************************************************************************/
24 
25 #pragma once
26 
27 #include <memory>
28 #include <vector>
29 #include <QString>
30 
31 #include "grppeptide.h"
32 
33 namespace pappso
34 {
35 class GrpProtein;
36 typedef std::shared_ptr<const GrpProtein> GrpProteinSpConst;
37 typedef std::shared_ptr<GrpProtein> GrpProteinSp;
38 
39 class PMSPP_LIB_DECL GrpProtein
40 {
41  friend class GrpExperiment;
42 
43  private:
44  unsigned int m_groupNumber = 0;
45  unsigned int m_subGroupNumber = 0;
46  unsigned int m_rank = 0;
47  unsigned int m_count = 0;
48 
49  const QString m_accession;
50  const QString m_description;
51 
52  protected:
53  GrpProtein(const QString &accession, const QString &description);
54 
55  void countPlus();
56 
57  /** @brief ensure that each peptide in peptide list is unique and sorted by
58  * pointer adress
59  */
60  void strip();
61 
62 
63  std::vector<GrpPeptide *> m_grpPeptidePtrList;
64 
65  public:
66  GrpProtein(const GrpProtein &other);
67  ~GrpProtein();
68  void push_back(GrpPeptide *p_grpPeptide);
69  bool operator==(const GrpProtein &other) const;
70 
71  const QString &getAccession() const;
72  const QString &getDescription() const;
73  const QString getGroupingId() const;
74 
75  typedef std::vector<GrpPeptide *>::const_iterator const_iterator;
77  begin() const
78  {
79  return m_grpPeptidePtrList.begin();
80  }
81  const_iterator
82  end() const
83  {
84  return m_grpPeptidePtrList.end();
85  }
86  void setRank(unsigned int i);
87  void setGroupNumber(unsigned int i);
88  void setSubGroupNumber(unsigned int i);
89  unsigned int getGroupNumber() const;
90  unsigned int getSubGroupNumber() const;
91  unsigned int getRank() const;
92  unsigned int getCount() const;
93 };
94 } // namespace pappso
pappso::GrpProteinSpConst
std::shared_ptr< const GrpProtein > GrpProteinSpConst
Definition: grpprotein.h:54
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition: exportinmportconfig.h:12
pappso
Definition: aa.cpp:38
grppeptide.h
pappso::GrpPeptide
Definition: grppeptide.h:61
pappso::operator==
bool operator==(Aa const &l, Aa const &r)
Definition: aa.cpp:299
pappso::GrpProteinSp
std::shared_ptr< GrpProtein > GrpProteinSp
Definition: grpprotein.h:56
pappso::GrpProtein
Definition: grpprotein.h:58
pappso::GrpProtein::const_iterator
std::vector< GrpPeptide * >::const_iterator const_iterator
Definition: grpprotein.h:94