libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
peptidefixedmodificationbuilder.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
26
27using namespace pappso;
28
33
37
38void
40{
41
42
43 m_aaModificationList.append(aa);
44
45 m_pattern.setPattern(QString("[%1]").arg(m_aaModificationList));
46}
47
48
49void
50PeptideFixedModificationBuilder::setPeptideSp(std::int8_t sequence_database_id,
51 const ProteinSp &protein_sp,
52 bool is_decoy,
53 const PeptideSp &peptide_sp_original,
54 unsigned int start,
55 bool is_nter,
56 unsigned int missed_cleavage_number,
57 bool semi_enzyme)
58{
59
60 qDebug() << "PeptideFixedModificationBuilder::setPeptide begin";
61
62 std::vector<unsigned int> position_list;
63 getModificationPositionList(position_list, peptide_sp_original.get()->getSequence());
64
65 Peptide peptide(*peptide_sp_original.get());
66 unsigned int size = peptide.size();
67
68 for(unsigned int pos : position_list)
69 {
70 if((m_isProtNterMod) && (is_nter))
71 {
72 peptide.addAaModification(mp_mod, pos);
73 }
74 else if((m_isProtCterMod) && (protein_sp.get()->size() == (start + size)))
75 {
76 peptide.addAaModification(mp_mod, pos);
77 }
78 else if(m_isProtElseMod)
79 {
80 peptide.addAaModification(mp_mod, pos);
81 }
82 }
83
84 PeptideSp peptide_sp = peptide.makePeptideSp();
85 // set fixed modifications
86 m_sink->setPeptideSp(sequence_database_id,
87 protein_sp,
88 is_decoy,
89 peptide_sp,
90 start,
91 is_nter,
92 missed_cleavage_number,
93 semi_enzyme);
94 qDebug() << "PeptideFixedModificationBuilder::setPeptide end";
95}
void setPeptideSp(std::int8_t sequence_database_id, const ProteinSp &protein_sp, bool is_decoy, const PeptideSp &peptide_sp_original, unsigned int start, bool is_nter, unsigned int missed_cleavage_number, bool semi_enzyme) override
function to give the products of modifications for a digested peptide
virtual void getModificationPositionList(std::vector< unsigned int > &position_list, const QString &peptide_str) final
PeptideSp makePeptideSp() const
Definition peptide.cpp:160
unsigned int size() const override
Definition peptide.cpp:217
const QString getSequence() const override
print amino acid sequence without modifications
Definition peptide.cpp:255
void addAaModification(AaModificationP aaModification, unsigned int position)
adds a modification to amino acid sequence
Definition peptide.cpp:222
unsigned int size() const
protein amino acid sequence size
Definition protein.cpp:116
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
std::shared_ptr< const Peptide > PeptideSp
const AaModification * AaModificationP
std::shared_ptr< const Protein > ProteinSp
shared pointer on a Protein object
Definition protein.h:47