libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
peptidemodel.h
Go to the documentation of this file.
1/**
2 * \file pappsomspp/processing/specglob/peptidemodel.h
3 * \date 14/11/2023
4 * \author Olivier Langella
5 * \brief SpecGlobTool peptide model
6 * \todo https://www.psidev.info/proforma
7 *
8 * C++ implementation of the SpecGlob algorithm described in :
9 * 1. Prunier, G. et al. Fast alignment of mass spectra in large proteomics
10 * datasets, capturing dissimilarities arising from multiple complex
11 * modifications of peptides. BMC Bioinformatics 24, 421 (2023).
12 *
13 * HAL Id : hal-04296170 , version 1
14 * Mot de passe : hxo20cl
15 * DOI : 10.1186/s12859-023-05555-y
16 */
17
18
19/*
20 * SpecGlobTool, Spectra to peptide alignment tool
21 * Copyright (C) 2023 Olivier Langella
22 * <olivier.langella@universite-paris-saclay.fr>
23 *
24 * This program is free software: you can redistribute ipetide to spectrum
25 * alignmentt and/or modify it under the terms of the GNU General Public License
26 * as published by the Free Software Foundation, either version 3 of the
27 * License, or (at your option) any later version.
28 *
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
33 *
34 * You should have received a copy of the GNU General Public License
35 * along with this program. If not, see <http://www.gnu.org/licenses/>.
36 *
37 */
38
39#pragma once
40
43#include "types.h"
45
46namespace pappso
47{
48namespace specglob
49{
50
59
60
62{
64 std::vector<pappso::DataPoint>::const_iterator
65 it_experimental_peak_match; // intensity of experimental matched peak
66 std::size_t aa_indice; // the amino acid indice in the peptide model (from 0
67 // to size, begining by nter)
68};
69/**
70 * @todo write docs
71 */
72class PMSPP_LIB_DECL PeptideModel : public std::vector<AminoAcidModel>
73{
74 public:
75 /**
76 * Default constructor
77 */
78 PeptideModel(const pappso::QualifiedMassSpectrum &qmass_spectrum, const pappso::Peptide &peptide);
79
81 /**
82 * Copy constructor
83 *
84 * @param other TODO
85 */
86 PeptideModel(const PeptideModel &other);
87
88 /**
89 * Destructor
90 */
91 virtual ~PeptideModel();
92
93 QString toString() const;
94
95 // void setPrecursorMass(double precursor_mass);
96
97 double getMass() const;
98
99 /** @brief get the m/z peptide model mass
100 * */
101 pappso_double getMz(unsigned int charge) const;
102
103 /** @brief mass delta between experimental and theoretical mass
104 */
105 double getMassDelta() const;
106
107 std::size_t modifCount() const;
108
109 void setBeginMassDelta(double);
110
112
113 std::vector<double> getTheoreticalIonMassList() const;
114
115
116 std::size_t getCountSharedPeaks() const;
117 double getIntensitySharedPeaks() const;
118 double getIntensityExperimentalPeaks() const;
119
121
122 /**
123 * Use to delete offset when there is two opposite mass in the hit modified
124 * example : [150.2]SDS[-150.2]KR --> SDSKR
125 *
126 * @param precision : The mass spectrometer precision
127 * @return true if model is modified
128 */
130
131 /** @brief try to replace mass differences with corresponding mutations mass
132 * delta
133 *
134 * amino acid list is tested as raw (no modification)
135 *
136 * @param aa_list amno acid list to test (beware of cysteine +
137 * carbamidomethyl)
138 * @param precision : The mass spectrometer precision
139 * @return true if model is modified
140 */
141 bool checkForMutations(const std::vector<Enums::AminoAcidChar> &aa_list, pappso::PrecisionPtr precision);
142
143
144 /** @brief try to replace mass differences with corresponding mutation mass
145 * delta
146 *
147 * amino acid candidate tested could bear some modifications
148 *
149 * @param amino_acid_candidate : The amino acid candidate to check
150 * @param precision : The mass spectrometer precision
151 * @return true if model is modified
152 */
153 bool checkForMutation(const pappso::Aa &amino_acid_candidate, pappso::PrecisionPtr precision);
154
155
156 /** @brief try to replace mass differences with the given modifications on a
157 * specific amino acid
158 *
159 * @param aa_modified the modified amino acid
160 * @param precision The mass spectrometer precision
161 * @return true if model is modified
162 */
163 bool checkForAaModification(const pappso::Aa &aa_modified, pappso::PrecisionPtr precision);
164
165 /** @brief try to replace mass differences with the given modification
166 *
167 * @param modification : The proposed modification pointer
168 * @param precision : The mass spectrometer precision
169 * @return true if model is modified
170 */
172 pappso::PrecisionPtr precision);
173
174 PeptideModel &operator=(const PeptideModel &other);
175
176 PeptideModel &copyDeep(const PeptideModel &other);
177 /**
178 * Use to try to explain negative offset with deletion of amino acids
179 *
180 * @param precision : The mass spectrometer precision
181 * @return true if model is modified
182 */
184
185
186 /**
187 * Use to remove brackets around not found Amino acids when the B or Y peak
188 * corresponding to the amino acid in the sequence is in the experimental peak
189 * list
190 *
191 * @param betterModified : The better sequence of hit Modified
192 * @param experimentalMassList : The list of mass that are in the experimental
193 * spectrum
194 * @param precision : The precision of the mass spectrometer
195 * @return the new sequence without brackets around found amino acids after
196 * all post treatments
197 */
199
200 const std::vector<TheoreticalPeakDataPoint> &getTheoreticalPeakDataPointList() const;
201
203
204 /** @brief get the peptide model in ProForma notation
205 * https://github.com/HUPO-PSI/ProForma/blob/master/README.md
206 * @return QString as described in ProForma
207 */
208 QString toProForma() const;
209
210 bool hasRemoval() const;
211
212 /** @brief try to remove left amino acid if there is a removal
213 * @return true if peptide model is modified
214 */
215 bool ltrimOnRemoval();
216
217 private:
219
220 private:
221 std::vector<TheoreticalPeakDataPoint> m_theoreticalPeakList;
222
226
229
230 std::size_t m_countSharedPeaks = 0;
233};
234} // namespace specglob
235} // namespace pappso
Class representing a fully specified mass spectrum.
pappso::AaModificationP m_nterModification
double getIntensityExperimentalPeaks() const
std::vector< TheoreticalPeakDataPoint > m_theoreticalPeakList
PeptideModel(const pappso::QualifiedMassSpectrum &qmass_spectrum, const pappso::Peptide &peptide)
std::size_t getCountSharedPeaks() const
void matchExperimentalPeaks(pappso::PrecisionPtr precision)
QString getTheoreticalPeakDataPointListToString() const
bool eliminateNegativeOffset(pappso::PrecisionPtr precision)
QString toProForma() const
get the peptide model in ProForma notation https://github.com/HUPO-PSI/ProForma/blob/master/README....
bool checkForAaModificationP(pappso::AaModificationP modification, pappso::PrecisionPtr precision)
try to replace mass differences with the given modification
pappso::AaModificationP m_cterModification
bool ltrimOnRemoval()
try to remove left amino acid if there is a removal
double getMassDelta() const
mass delta between experimental and theoretical mass
bool checkForMutations(const std::vector< Enums::AminoAcidChar > &aa_list, pappso::PrecisionPtr precision)
try to replace mass differences with corresponding mutations mass delta
PeptideModel & operator=(const PeptideModel &other)
pappso::MassSpectrumCstSPtr mcsp_peakList
const std::vector< TheoreticalPeakDataPoint > & getTheoreticalPeakDataPointList() const
pappso_double getMz(unsigned int charge) const
get the m/z peptide model mass
void generateTheoreticalPeaks(pappso::PrecisionPtr precision)
bool eliminateComplementaryDelta(pappso::PrecisionPtr precision)
bool checkForAaModification(const pappso::Aa &aa_modified, pappso::PrecisionPtr precision)
try to replace mass differences with the given modifications on a specific amino acid
bool checkForMutation(const pappso::Aa &amino_acid_candidate, pappso::PrecisionPtr precision)
try to replace mass differences with corresponding mutation mass delta
std::vector< double > getTheoreticalIonMassList() const
PeptideModel & copyDeep(const PeptideModel &other)
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
const AaModification * AaModificationP
double pappso_double
A type definition for doubles.
Definition types.h:61
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
const PrecisionBase * PrecisionPtr
Definition precision.h:122
SpectralAlignmentType alignment_type
std::vector< pappso::DataPoint >::const_iterator it_experimental_peak_match