libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
peptidebuilder.cpp
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#include "peptidebuilder.h"
25#include <QDebug>
26
27namespace pappso
28{
32
36void
38{
39
40 m_fixedModificationList.push_back(std::pair<char, AaModificationP>(aa, modification));
41}
42
43void
44PeptideBuilder::setPeptide(std::int8_t sequence_database_id,
45 const ProteinSp &protein_sp,
46 bool is_decoy,
47 const QString &peptide_str,
48 unsigned int start,
49 bool is_nter,
50 unsigned int missed_cleavage_number,
51 bool semi_enzyme)
52{
53
54 qDebug() << "PeptideBuilder::setPeptide begin";
55
56 Peptide peptide(peptide_str);
57
58 for(auto &&aamod_pair : m_fixedModificationList)
59 {
60 std::vector<unsigned int> position_list = peptide.getAaPositionList(aamod_pair.first);
61 for(auto &&position : position_list)
62 {
63 peptide.addAaModification(aamod_pair.second, position);
64 }
65 }
66
67 PeptideSp peptide_sp = peptide.makePeptideSp();
68 // set fixed modifications
69
70 qDebug() << "PeptideBuilder::setPeptide m_sink->setPeptideSp";
71 m_sink->setPeptideSp(sequence_database_id,
72 protein_sp,
73 is_decoy,
74 peptide_sp,
75 start,
76 is_nter,
77 missed_cleavage_number,
78 semi_enzyme);
79 qDebug() << "PeptideBuilder::setPeptide end";
80}
81
82} // namespace pappso
std::list< std::pair< char, AaModificationP > > m_fixedModificationList
void setPeptide(std::int8_t sequence_database_id, const ProteinSp &protein_sp, bool is_decoy, const QString &peptide_str, 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
PeptideModificatorInterface * m_sink
void addFixedAaModification(char aa, AaModificationP modification)
PeptideSp makePeptideSp() const
Definition peptide.cpp:160
std::vector< unsigned int > getAaPositionList(char aa) const
get positions of one amino acid in peptide
Definition peptide.cpp:567
void addAaModification(AaModificationP aaModification, unsigned int position)
adds a modification to amino acid sequence
Definition peptide.cpp:222
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