libpappsomspp
Library for mass spectrometry
peptidesemienzyme.cpp
Go to the documentation of this file.
1 
2 /*******************************************************************************
3  * Copyright (c) 2016 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 #include "peptidesemienzyme.h"
26 #include "../exception/exceptionnotpossible.h"
27 
28 namespace pappso
29 {
31 {
32 }
33 
35 {
36 }
37 
38 void
39 PeptideSemiEnzyme::setPeptide(std::int8_t sequence_database_id,
40  const ProteinSp &protein_sp,
41  bool is_decoy,
42  const QString &peptide,
43  unsigned int start,
44  bool is_nter,
45  unsigned int missed_cleavage_number,
46  bool semi_enzyme)
47 {
48  // if (start == 1) {
49  // m_sink->setPeptide(protein_sp, peptide, start);
50  // 2 begin
51  // size = 6
52  // i=5
53 
54  //}
55  if(semi_enzyme)
56  {
58  QObject::tr("ERROR : semi_ensyme flag is true.\n This is not possible, "
59  "because only PeptideSemiEnzyme is autorized to set it "
60  "true, and this can not be used several times."));
61  }
62 
63  m_sink->setPeptide(sequence_database_id,
64  protein_sp,
65  is_decoy,
66  peptide,
67  start,
68  is_nter,
69  missed_cleavage_number,
70  false); // transmits orignal peptide
71  unsigned int max = peptide.size();
72  // unsigned int maxi = max-1;
73  for(unsigned int i = 1; i < max; i++)
74  {
75  m_sink->setPeptide(sequence_database_id,
76  protein_sp,
77  is_decoy,
78  peptide.left(i),
79  start,
80  is_nter,
81  missed_cleavage_number,
82  true);
83  m_sink->setPeptide(sequence_database_id,
84  protein_sp,
85  is_decoy,
86  peptide.right(i),
87  start + (max - i),
88  false,
89  missed_cleavage_number,
90  true);
91  }
92 }
93 } // namespace pappso
virtual void setPeptide(std::int8_t sequence_database_id, const ProteinSp &protein_sp, bool is_decoy, const PeptideStr &peptide, unsigned int start, bool is_nter, unsigned int missed_cleavage_number, bool semi_enzyme)=0
function to give the products of a protein digestion by an enzyme
void setPeptide(std::int8_t sequence_database_id, const ProteinSp &protein_sp, bool is_decoy, const QString &peptide, unsigned int start, bool is_nter, unsigned int missed_cleavage_number, bool semi_enzyme) override
function to give the products of a protein digestion by an enzyme
EnzymeProductInterface * m_sink
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
std::shared_ptr< const Protein > ProteinSp
shared pointer on a Protein object
Definition: protein.h:43
@ max
maximum of intensities