libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
experimentalspectrum.h
Go to the documentation of this file.
1/**
2 * \file pappsomspp/processing/specglob/experimentalspectrum.h
3 * \date 08/11/2023
4 * \author Olivier Langella
5 * \brief transform a spectrum to SpecGlob spectra
6 *
7 * C++ implementation of the SpecGlob algorithm described in :
8 * 1. Prunier, G. et al. Fast alignment of mass spectra in large proteomics
9 * datasets, capturing dissimilarities arising from multiple complex
10 * modifications of peptides. BMC Bioinformatics 24, 421 (2023).
11 *
12 * HAL Id : hal-04296170 , version 1
13 * Mot de passe : hxo20cl
14 * DOI : 10.1186/s12859-023-05555-y
15 */
16
17
18/*
19 * SpecGlobTool, Spectra to peptide alignment tool
20 * Copyright (C) 2023 Olivier Langella
21 * <olivier.langella@universite-paris-saclay.fr>
22 *
23 * This program is free software: you can redistribute it and/or modify
24 * it under the terms of the GNU General Public License as published by
25 * the Free Software Foundation, either version 3 of the License, or
26 * (at your option) any later version.
27 *
28 * This program is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU General Public License for more details.
32 *
33 * You should have received a copy of the GNU General Public License
34 * along with this program. If not, see <http://www.gnu.org/licenses/>.
35 *
36 */
37
38#pragma once
39
42#include "types.h"
43
44
45namespace pappso
46{
47namespace specglob
48{
49
56
58
59typedef std::shared_ptr<const ExperimentalSpectrum> ExperimentalSpectrumCsp;
60/**
61 * @todo write docs
62 */
63class PMSPP_LIB_DECL ExperimentalSpectrum : public std::vector<ExperimentalSpectrumDataPoint>
64{
65 public:
66 /**
67 * Default constructor
68 */
70 pappso::PrecisionPtr precision_ptr);
71
72 /**
73 * specpeptidoms post-processing constructor
74 */
76 pappso::PrecisionPtr precision_ptr,
77 double precursor_mass_error);
78
79 /**
80 * Copy constructor
81 *
82 * @param other TODO
83 */
85
86 /**
87 * Destructor
88 */
89 virtual ~ExperimentalSpectrum();
90
91 std::vector<double> getMassList() const;
92
93 /** @brief compute the symmetric mass
94 * for debuggin purpose
95 */
96 double getSymetricMz(double mz) const;
97
98 double getTargetMzSum() const;
99
100 double getPrecursorMass() const;
101
102 std::vector<double> getMassList(ExperimentalSpectrumDataPointType type) const;
103
104 QString toString() const;
105
107
108 /** @brief find the peak for wich mass difference from rbegin corresponds to
109 * aaTheoMass Find if a peak back in the peak list has a mass difference that
110 * corresponds to the targeted mass
111 *
112 * @param start_position reverse iterator on the reference peak to look for
113 * mass difference from
114 * @param targeted_mass_range the mass difference to look forconst
115 * pappso::PeptideSp peptide_sp
116 * @return a reverse iterator on the peak (found) or the end of the search
117 * (not found)
118 */
119 std::vector<ExperimentalSpectrumDataPoint>::const_reverse_iterator
120 reverseFindDiffMz(std::size_t start_position, const pappso::MzRange &targeted_mass_range) const;
121
122 private:
123 /** @brief add symmetric peaks to the spectrum
124 * Create a SymetricPeakList that contain symmetric peaks and the information
125 * if a peak is the initial peak, the symmetric peak, or both if already
126 * exist.
127 * assuming fragment ion charge is 1
128 */
130
131 void createSymetricPeakList(double precursor_mass_error);
132
133 /** @brief find the correspondin mz in the mass spectrum (given the precision)
134 */
135 std::vector<pappso::DataPoint>::const_iterator findMz(double mz);
136
137 private:
142};
143} // namespace specglob
144} // namespace pappso
Class representing a fully specified mass spectrum.
double getSymetricMz(double mz) const
compute the symmetric mass for debuggin purpose
const pappso::QualifiedMassSpectrum & getQualifiedMassSpectrum() const
std::vector< ExperimentalSpectrumDataPoint >::const_reverse_iterator reverseFindDiffMz(std::size_t start_position, const pappso::MzRange &targeted_mass_range) const
find the peak for wich mass difference from rbegin corresponds to aaTheoMass Find if a peak back in t...
ExperimentalSpectrum(const pappso::QualifiedMassSpectrum &qmass_spectrum, pappso::PrecisionPtr precision_ptr)
void createSymetricPeakList()
add symmetric peaks to the spectrum Create a SymetricPeakList that contain symmetric peaks and the in...
std::vector< pappso::DataPoint >::const_iterator findMz(double mz)
find the correspondin mz in the mass spectrum (given the precision)
pappso::QualifiedMassSpectrum m_qualifiedMassSpectrum
#define PMSPP_LIB_DECL
std::shared_ptr< const ExperimentalSpectrum > ExperimentalSpectrumCsp
ExperimentalSpectrumDataPointType
Definition types.h:78
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
const PrecisionBase * PrecisionPtr
Definition precision.h:122