pappsomspp
Library for mass spectrometry
peptidemodificatorpipeline.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2016 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 #pragma once
25 
26 
27 #include "enzymeproductinterface.h"
28 #include "peptidemodificatortee.h"
29 
30 namespace pappso
31 {
32 
33 class PMSPP_LIB_DECL PeptideModificatorPipeline
34  : public PeptideModificatorInterface,
35  public PeptideSpSinkInterface,
36  public EnzymeProductInterface
37 {
38  private:
39  PeptideModificatorTee *mp_peptideModificatorTee = nullptr;
40 
41  PeptideModificatorInterface *m_sink = nullptr;
42 
43  PeptideSpSinkInterface *mp_lastPeptideSinkInterface;
44 
45  PeptideModificatorInterface *mp_firstModificator = nullptr;
46 
47  std::vector<PeptideModificatorInterface *> m_pepModificatorPtrList;
48 
49  void parseFixedModification(const QString &mod_str,
50  bool Nter,
51  bool Cter,
52  bool else_prot);
53  void privAddFixedModificationString(const QString &mod_str,
54  bool Nter,
55  bool Cter,
56  bool else_prot);
57  void parsePotentialModification(const QString &mod_str,
58  bool Nter,
59  bool Cter,
60  bool else_prot);
61  void privAddPotentialModificationString(const QString &mod_str,
62  bool Nter,
63  bool Cter,
64  bool else_prot);
65  void parseLabeledModification(const QString &mod_str,
66  bool Nter,
67  bool Cter,
68  bool else_prot);
69 
70  public:
73  virtual ~PeptideModificatorPipeline();
74 
75  void addFixedModificationString(const QString &mod_str);
76  // protein Nter modification
77  void addFixedNterModificationString(const QString &mod_str);
78  // protein Cter modification
79  void addFixedCterModificationString(const QString &mod_str);
80 
81  void addPotentialModificationString(const QString &mod_str);
82  // protein Nter modification
83  void addPotentialNterModificationString(const QString &mod_str);
84  // protein Cter modification
85  void addPotentialCterModificationString(const QString &mod_str);
86 
87  void setSink(PeptideModificatorInterface *sink) override;
88 
89  void setPeptideSp(std::int8_t sequence_database_id,
90  const ProteinSp &protein_sp,
91  bool is_decoy,
92  const PeptideSp &peptide_sp_original,
93  unsigned int start,
94  bool is_nter,
95  unsigned int missed_cleavage_number,
96  bool semi_enzyme) override;
97  void setPeptide(std::int8_t sequence_database_id,
98  const ProteinSp &protein_sp,
99  bool is_decoy,
100  const QString &peptide_str,
101  unsigned int start,
102  bool is_nter,
103  unsigned int missed_cleavage_number,
104  bool semi_enzyme) override;
105 
106  void addLabeledModificationString(const QString &mod_str);
107 };
108 
109 
110 } // namespace pappso
enzymeproductinterface.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition: exportinmportconfig.h:12
peptidemodificatortee.h
pappso
Definition: aa.cpp:38
pappso::PeptideModificatorPipeline
Definition: peptidemodificatorpipeline.h:52
pappso::PeptideModificatorInterface
Definition: enzymeproductinterface.h:83
pappso::ProteinSp
std::shared_ptr< const Protein > ProteinSp
shared pointer on a Protein object
Definition: protein.h:62
pappso::PeptideDirection::Nter
pappso::PeptideSp
std::shared_ptr< const Peptide > PeptideSp
Definition: aamodification.h:66
pappso::PeptideDirection::Cter