libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
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 "
pappsomspp/export-import-config.h
"
42
#include "
types.h
"
43
44
45
namespace
pappso
46
{
47
namespace
specglob
48
{
49
50
struct
ExperimentalSpectrumDataPoint
51
{
52
ExperimentalSpectrumDataPointType
type
;
53
double
peak_mz
= 0;
54
std::size_t
indice
;
55
};
56
57
class
ExperimentalSpectrum
;
58
59
typedef
std::shared_ptr<const ExperimentalSpectrum>
ExperimentalSpectrumCsp
;
60
/**
61
* @todo write docs
62
*/
63
class
PMSPP_LIB_DECL
ExperimentalSpectrum
:
public
std::vector<ExperimentalSpectrumDataPoint>
64
{
65
public
:
66
/**
67
* Default constructor
68
*/
69
ExperimentalSpectrum
(
const
pappso::QualifiedMassSpectrum
&qmass_spectrum,
70
pappso::PrecisionPtr
precision_ptr);
71
72
/**
73
* specpeptidoms post-processing constructor
74
*/
75
ExperimentalSpectrum
(
const
pappso::QualifiedMassSpectrum
&qmass_spectrum,
76
pappso::PrecisionPtr
precision_ptr,
77
double
precursor_mass_error);
78
79
/**
80
* Copy constructor
81
*
82
* @param other TODO
83
*/
84
ExperimentalSpectrum
(
const
ExperimentalSpectrum
&other);
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
106
const
pappso::QualifiedMassSpectrum
&
getQualifiedMassSpectrum
()
const
;
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
*/
129
void
createSymetricPeakList
();
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
:
138
pappso::QualifiedMassSpectrum
m_qualifiedMassSpectrum
;
139
double
m_targetMzSum
;
140
double
m_precursorMass
;
141
pappso::PrecisionPtr
m_precisionPtr
;
142
};
143
}
// namespace specglob
144
}
// namespace pappso
pappso::MzRange
Definition
mzrange.h:46
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition
qualifiedmassspectrum.h:98
pappso::specglob::ExperimentalSpectrum
Definition
experimentalspectrum.h:64
pappso::specglob::ExperimentalSpectrum::getSymetricMz
double getSymetricMz(double mz) const
compute the symmetric mass for debuggin purpose
Definition
experimentalspectrum.cpp:207
pappso::specglob::ExperimentalSpectrum::getMassList
std::vector< double > getMassList() const
Definition
experimentalspectrum.cpp:195
pappso::specglob::ExperimentalSpectrum::getPrecursorMass
double getPrecursorMass() const
Definition
experimentalspectrum.cpp:237
pappso::specglob::ExperimentalSpectrum::getQualifiedMassSpectrum
const pappso::QualifiedMassSpectrum & getQualifiedMassSpectrum() const
Definition
experimentalspectrum.cpp:284
pappso::specglob::ExperimentalSpectrum::getTargetMzSum
double getTargetMzSum() const
Definition
experimentalspectrum.cpp:189
pappso::specglob::ExperimentalSpectrum::m_precisionPtr
pappso::PrecisionPtr m_precisionPtr
Definition
experimentalspectrum.h:141
pappso::specglob::ExperimentalSpectrum::m_precursorMass
double m_precursorMass
Definition
experimentalspectrum.h:140
pappso::specglob::ExperimentalSpectrum::reverseFindDiffMz
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...
Definition
experimentalspectrum.cpp:243
pappso::specglob::ExperimentalSpectrum::toString
QString toString() const
Definition
experimentalspectrum.cpp:226
pappso::specglob::ExperimentalSpectrum::ExperimentalSpectrum
ExperimentalSpectrum(const pappso::QualifiedMassSpectrum &qmass_spectrum, pappso::PrecisionPtr precision_ptr)
Definition
experimentalspectrum.cpp:45
pappso::specglob::ExperimentalSpectrum::createSymetricPeakList
void createSymetricPeakList()
add symmetric peaks to the spectrum Create a SymetricPeakList that contain symmetric peaks and the in...
Definition
experimentalspectrum.cpp:77
pappso::specglob::ExperimentalSpectrum::findMz
std::vector< pappso::DataPoint >::const_iterator findMz(double mz)
find the correspondin mz in the mass spectrum (given the precision)
Definition
experimentalspectrum.cpp:169
pappso::specglob::ExperimentalSpectrum::m_targetMzSum
double m_targetMzSum
Definition
experimentalspectrum.h:139
pappso::specglob::ExperimentalSpectrum::m_qualifiedMassSpectrum
pappso::QualifiedMassSpectrum m_qualifiedMassSpectrum
Definition
experimentalspectrum.h:138
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
pappso::specglob
Definition
experimentalspectrum.cpp:44
pappso::specglob::ExperimentalSpectrumCsp
std::shared_ptr< const ExperimentalSpectrum > ExperimentalSpectrumCsp
Definition
experimentalspectrum.h:59
pappso::specglob::ExperimentalSpectrumDataPointType
ExperimentalSpectrumDataPointType
Definition
types.h:78
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappso::PrecisionPtr
const PrecisionBase * PrecisionPtr
Definition
precision.h:122
types.h
qualifiedmassspectrum.h
pappso::specglob::ExperimentalSpectrumDataPoint
Definition
experimentalspectrum.h:51
pappso::specglob::ExperimentalSpectrumDataPoint::indice
std::size_t indice
Definition
experimentalspectrum.h:54
pappso::specglob::ExperimentalSpectrumDataPoint::peak_mz
double peak_mz
Definition
experimentalspectrum.h:53
pappso::specglob::ExperimentalSpectrumDataPoint::type
ExperimentalSpectrumDataPointType type
Definition
experimentalspectrum.h:52
pappsomspp
core
processing
specglob
experimentalspectrum.h
Generated on
for libpappsomspp by
1.17.0