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
40#include "../../massspectrum/qualifiedmassspectrum.h"
41#include "../../exportinmportconfig.h"
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 * Copy constructor
74 *
75 * @param other TODO
76 */
78
79 /**
80 * Destructor
81 */
82 virtual ~ExperimentalSpectrum();
83
84 std::vector<double> getMassList() const;
85
86 /** @brief compute the symetric mass
87 * for debuggin purpose
88 */
89 double getSymetricMz(double mz) const;
90
91 double getTargetMzSum() const;
92
93 double getPrecursorMass() const;
94
95 std::vector<double> getMassList(ExperimentalSpectrumDataPointType type) const;
96
97 QString toString() const;
98
99 const pappso::QualifiedMassSpectrum &getQualifiedMassSpectrum() const;
100
101 /** @brief find the peak for wich mass difference from rbegin corresponds to
102 * aaTheoMass Find if a peak back in the peak list has a mass difference that
103 * corresponds to the targeted mass
104 *
105 * @param start_position reverse iterator on the reference peak to look for
106 * mass difference from
107 * @param targeted_mass_range the mass difference to look forconst
108 * pappso::PeptideSp peptide_sp
109 * @return a reverse iterator on the peak (found) or the end of the search
110 * (not found)
111 */
112 std::vector<ExperimentalSpectrumDataPoint>::const_reverse_iterator
113 reverseFindDiffMz(std::size_t start_position,
114 const pappso::MzRange &targeted_mass_range) const;
115
116 private:
117 /** @brief add symetric peaks to the spectrum
118 * Create a SymetricPeakList that contain symmetric peaks and the information
119 * if a peak is the initial peak, the symmetric peak, or both if already
120 * exist.
121 * assuming fragment ion charge is 1
122 */
123 void createSymetricPeakList();
124
125 /** @brief find the correspondin mz in the mass spectrum (given the precision)
126 */
127 std::vector<pappso::DataPoint>::const_iterator findMz(double mz);
128
129 private:
134};
135} // namespace specglob
136} // namespace pappso
Class representing a fully specified mass spectrum.
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
This header contains all the type re-definitions and all the global variables definitions used in the...