libpappsomspp
Library for mass spectrometry
grpsubgroup.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
3  *
4  * This file is part of the PAPPSOms++ library.
5  *
6  * PAPPSOms++ is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * PAPPSOms++ is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Contributors:
20  * Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
21  *implementation
22  ******************************************************************************/
23 
24 
25 #pragma once
26 
27 
28 #include <memory>
29 #include <vector>
30 #include "grpprotein.h"
31 #include "grppeptideset.h"
32 
33 
34 namespace pappso
35 {
36 
37 class GrpSubGroup;
38 typedef std::shared_ptr<const GrpSubGroup> GrpSubGroupSpConst;
39 typedef std::shared_ptr<GrpSubGroup> GrpSubGroupSp;
40 
41 
42 class GrpSubGroup
43 {
44  private:
45  std::vector<GrpProtein *> m_grpProteinPtrList;
46  GrpPeptideSet m_peptidePtrList;
47  unsigned int m_subGroupNumber = 0;
48  unsigned int m_groupNumber = 0;
49 
50  public:
51  GrpSubGroup(GrpProtein *p_protein);
52  GrpSubGroup(const GrpSubGroup &other);
53 
54 
55  /** \brief sort subgroups between each other
56  * a subgroup containing less peptides is weaker (less) than the other
57  */
58  bool operator<(const GrpSubGroup &other) const;
61  const GrpPeptideSet &getPeptideSet() const;
62  bool merge(GrpSubGroup *p_subgroup);
63  bool includes(const GrpSubGroup *p_subgroup) const;
64  void numbering();
65  void setSubGroupNumber(unsigned int i);
66  void setGroupNumber(unsigned int i);
67  const QString &getFirstAccession() const;
68 
69  std::size_t peptideListSize() const;
70  unsigned int maxCount() const;
71 
72 
73  const QString getGroupingId() const;
74  unsigned int getGroupNumber() const;
75  unsigned int getSubGroupNumber() const;
76 
77  const std::vector<GrpProtein *> &getGrpProteinList() const;
78 };
79 
80 
81 } // namespace pappso
pappso::GrpSubGroup::merge
bool merge(GrpSubGroup *p_subgroup)
Definition: grpsubgroup.cpp:161
pappso::GrpSubGroup
Definition: grpsubgroup.h:64
pappso::GrpSubGroup::getFirstAccession
const QString & getFirstAccession() const
Definition: grpsubgroup.cpp:247
pappso::GrpSubGroup::getPeptideSet
const GrpPeptideSet & getPeptideSet() const
Definition: grpsubgroup.cpp:155
pappso::GrpSubGroup::getGroupNumber
unsigned int getGroupNumber() const
Definition: grpsubgroup.cpp:69
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks
Definition: aa.cpp:39
pappso::GrpSubGroup::getSubGroupNumber
unsigned int getSubGroupNumber() const
Definition: grpsubgroup.cpp:74
pappso::GrpPeptideSet
Definition: grppeptideset.h:57
pappso::GrpSubGroupSp
std::shared_ptr< GrpSubGroup > GrpSubGroupSp
Definition: grpsubgroup.h:60
pappso::GrpSubGroup::maxCount
unsigned int maxCount() const
Definition: grpsubgroup.cpp:95
pappso::GrpSubGroup::numbering
void numbering()
Definition: grpsubgroup.cpp:220
pappso::GrpSubGroup::~GrpSubGroup
~GrpSubGroup()
Definition: grpsubgroup.cpp:145
pappso::GrpSubGroup::includes
bool includes(const GrpSubGroup *p_subgroup) const
Definition: grpsubgroup.cpp:187
pappso::GrpSubGroup::GrpSubGroup
GrpSubGroup(GrpProtein *p_protein)
Definition: grpsubgroup.cpp:57
pappso::GrpSubGroup::makeGrpSubGroupSp
GrpSubGroupSp makeGrpSubGroupSp()
Definition: grpsubgroup.cpp:149
grppeptideset.h
pappso::GrpSubGroupSpConst
std::shared_ptr< const GrpSubGroup > GrpSubGroupSpConst
Definition: grpsubgroup.h:58
pappso::GrpSubGroup::m_grpProteinPtrList
std::vector< GrpProtein * > m_grpProteinPtrList
Definition: grpsubgroup.h:66
pappso::GrpSubGroup::m_groupNumber
unsigned int m_groupNumber
Definition: grpsubgroup.h:69
pappso::GrpSubGroup::m_subGroupNumber
unsigned int m_subGroupNumber
Definition: grpsubgroup.h:68
pappso::GrpSubGroup::getGrpProteinList
const std::vector< GrpProtein * > & getGrpProteinList() const
Definition: grpsubgroup.cpp:79
pappso::GrpSubGroup::getGroupingId
const QString getGroupingId() const
Definition: grpsubgroup.cpp:84
pappso::GrpSubGroup::operator<
bool operator<(const GrpSubGroup &other) const
sort subgroups between each other a subgroup containing less peptides is weaker (less) than the other
Definition: grpsubgroup.cpp:108
pappso::GrpSubGroup::setGroupNumber
void setGroupNumber(unsigned int i)
Definition: grpsubgroup.cpp:200
pappso::GrpSubGroup::setSubGroupNumber
void setSubGroupNumber(unsigned int i)
Definition: grpsubgroup.cpp:210
grpprotein.h
pappso::GrpSubGroup::m_peptidePtrList
GrpPeptideSet m_peptidePtrList
Definition: grpsubgroup.h:67
pappso::GrpSubGroup::peptideListSize
std::size_t peptideListSize() const
Definition: grpsubgroup.cpp:261