libpappsomspp
Library for mass spectrometry
grpexperiment.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 <map>
28 #include <QString>
29 #include <QDebug>
30 #include "../types.h"
31 #include "grpgroupingmonitor.h"
32 #include "grppeptideset.h"
33 #include "grpmappeptidetogroup.h"
34 #include "grpgroup.h"
35 #include "grpsubgroup.h"
36 
37 namespace pappso
38 {
39 
40 
41 class PMSPP_LIB_DECL GrpExperiment
42 {
43  private:
44  GrpGroupingMonitorInterface *mp_monitor = nullptr;
45  bool m_isRemoveNonInformativeSubgroups = true;
46  std::map<QString, GrpProteinSp> m_mapProteins;
47  std::map<QString, std::map<unsigned long, GrpPeptideSp>> m_mapPeptides;
48 
49  std::list<GrpPeptideSp> m_grpPeptideList;
50  std::list<GrpProteinSp> m_grpProteinList;
51  bool m_isGroupingStarted = false;
52  std::list<GrpProtein *> m_remainingGrpProteinList;
53 
54  GrpPeptideSet m_grpPostGroupingProteinListRemoval;
55 
56  GrpPeptideSet m_grpPreGroupingProteinListRemoval;
57 
58  std::list<GrpGroupSp> m_grpGroupSpList;
59 
60  void addSubGroupSp(GrpMapPeptideToGroup &grp_map_peptide_to_group,
61  GrpSubGroupSp &grpSubGroupSp) const;
62  void numbering();
63  void removeNonInformativeSubGroups();
64 
65  public:
66  GrpProteinSp &getGrpProteinSp(const QString &acc, const QString &description);
67  GrpPeptideSp &setGrpPeptide(const GrpProteinSp &proteinSp,
68  const QString &sequence,
69  pappso_double mass);
70 
72  virtual ~GrpExperiment();
73 
74  void startGrouping();
75 
76  std::vector<GrpProteinSpConst> getGrpProteinSpList() const;
77 
78  void setRemoveNonInformativeSubgroups(bool ok);
79 
80  /** @brief protein to remove with its entire group after grouping is completed
81  * typically : to use with protein contaminants if you want to ignore any
82  * group containing one contaminant protein
83  */
84  void addPostGroupingGrpProteinSpRemoval(GrpProteinSp sp_protein);
85 
86  /** @brief protein peptides to remove before grouping
87  * typically : remove protein contaminants in special metaproteomics cases
88  */
89  void addPreGroupingGrpProteinSpRemoval(GrpProteinSp sp_protein);
90 
91  std::vector<GrpGroupSpConst> getGrpGroupSpList() const;
92 };
93 
94 
95 } // namespace pappso
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:69
grpgroupingmonitor.h
grpgroup.h
pappso::GrpExperiment
Definition: grpexperiment.h:63
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition: exportinmportconfig.h:14
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks
Definition: aa.cpp:39
pappso::GrpSubGroupSp
std::shared_ptr< GrpSubGroup > GrpSubGroupSp
Definition: grpsubgroup.h:60
grpsubgroup.h
pappso::GrpProteinSp
std::shared_ptr< GrpProtein > GrpProteinSp
Definition: grpprotein.h:58
pappso::GrpGroupingMonitorInterface
Definition: grpgroupingmonitor.h:54
pappso::GrpPeptideSp
std::shared_ptr< GrpPeptide > GrpPeptideSp
Definition: grppeptide.h:61
grppeptideset.h
grpmappeptidetogroup.h