libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
selfspectrum.cpp
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/processing/specself/selfspectrum.cpp
3
* \date 23/03/2024
4
* \author Olivier Langella
5
* \brief spectrum self operations
6
*/
7
8
/*******************************************************************************
9
* Copyright (c) 2024 Olivier Langella
10
*<Olivier.Langella@universite-paris-saclay.fr>.
11
*
12
* This file is part of PAPPSOms++.
13
*
14
* PAPPSOms++ is free software: you can redistribute it and/or modify
15
* it under the terms of the GNU General Public License as published by
16
* the Free Software Foundation, either version 3 of the License, or
17
* (at your option) any later version.
18
*
19
* PAPPSOms++ is distributed in the hope that it will be useful,
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
* GNU General Public License for more details.
23
*
24
* You should have received a copy of the GNU General Public License
25
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
26
*
27
******************************************************************************/
28
29
#include "
selfspectrum.h
"
30
#include <QDebug>
31
32
namespace
pappso
33
{
34
namespace
specself
35
{
36
37
SelfSpectrum::SelfSpectrum
(
const
pappso::AaStringCodeMassMatching
&codec_mass_matching,
38
const
Trace
&trace)
39
{
40
m_trace
= trace;
41
m_matrix
.resize(
m_trace
.size(),
m_trace
.size());
42
43
qDebug() <<
m_trace
.size();
44
for
(
auto
itmi = ++
m_matrix
.begin1(); itmi !=
m_matrix
.end1(); ++itmi)
45
{
46
qDebug() << itmi.index1();
47
for
(
auto
itmj = ++itmi.begin(); itmj != itmi.end(); itmj++)
48
{
49
// itmj.fillSelfDataPoint(m_trace[itmj.index1()],
50
// m_trace[itmj.index2()]);
51
(*itmj).fillSelfSpectrumDataPoint(
52
codec_mass_matching,
m_trace
[itmj.index1()],
m_trace
[itmj.index2()]);
53
}
54
}
55
56
qDebug();
57
}
58
59
SelfSpectrum::~SelfSpectrum
()
60
{
61
}
62
63
const
SelfSpectrumMatrix
&
64
SelfSpectrum::getMatrix
()
const
65
{
66
return
m_matrix
;
67
}
68
69
70
const
Trace
&
71
SelfSpectrum::getTrace
()
const
72
{
73
return
m_trace
;
74
}
75
76
77
void
78
SelfSpectrum::setPrecursorMass
(
const
pappso::AaStringCodeMassMatching
&codec_mass_matching,
79
double
precursor_mass)
80
{
81
82
for
(
auto
itmi = ++
m_matrix
.begin1(); itmi !=
m_matrix
.end1(); ++itmi)
83
{
84
for
(
auto
itmj = ++itmi.begin(); itmj != itmi.end(); itmj++)
85
{
86
// itmj.fillSelfDataPoint(m_trace[itmj.index1()],
87
// m_trace[itmj.index2()]);
88
(*itmj).fillAntiSpectrumDataPoint(
89
precursor_mass, codec_mass_matching,
m_trace
[itmj.index1()],
m_trace
[itmj.index2()]);
90
}
91
}
92
}
93
94
95
void
96
SelfSpectrum::setVariableModification
(
const
pappso::AaStringCodeMassMatching
&codec_mass_matching,
97
const
Aa
&aa,
98
int
quantifier)
99
{
100
101
for
(
auto
itmi = ++
m_matrix
.begin1(); itmi !=
m_matrix
.end1(); ++itmi)
102
{
103
for
(
auto
itmj = ++itmi.begin(); itmj != itmi.end(); itmj++)
104
{
105
// itmj.fillSelfDataPoint(m_trace[itmj.index1()],
106
// m_trace[itmj.index2()]);
107
(*itmj).setVariableModification(codec_mass_matching, aa, quantifier);
108
}
109
}
110
}
111
112
}
// namespace specself
113
}
// namespace pappso
pappso::AaStringCodeMassMatching
convert a list of mass to amino acid string codes
Definition
aastringcodemassmatching.h:41
pappso::Aa
Definition
aa.h:45
pappso::Trace
A simple container of DataPoint instances.
Definition
trace.h:152
pappso::specself::SelfSpectrum::getMatrix
const SelfSpectrumMatrix & getMatrix() const
Definition
selfspectrum.cpp:64
pappso::specself::SelfSpectrum::setVariableModification
void setVariableModification(const pappso::AaStringCodeMassMatching &codec_mass_matching, const Aa &aa, int quantifier)
Definition
selfspectrum.cpp:96
pappso::specself::SelfSpectrum::~SelfSpectrum
virtual ~SelfSpectrum()
Definition
selfspectrum.cpp:59
pappso::specself::SelfSpectrum::m_matrix
SelfSpectrumMatrix m_matrix
Definition
selfspectrum.h:72
pappso::specself::SelfSpectrum::SelfSpectrum
SelfSpectrum(const pappso::AaStringCodeMassMatching &codec_mass_matching, const Trace &trace)
Definition
selfspectrum.cpp:37
pappso::specself::SelfSpectrum::m_trace
Trace m_trace
Definition
selfspectrum.h:71
pappso::specself::SelfSpectrum::setPrecursorMass
void setPrecursorMass(const pappso::AaStringCodeMassMatching &codec_mass_matching, double precursor_mass)
Definition
selfspectrum.cpp:78
pappso::specself::SelfSpectrum::getTrace
const Trace & getTrace() const
Definition
selfspectrum.cpp:71
pappso::specself
Definition
selfspectrum.cpp:35
pappso::specself::SelfSpectrumMatrix
boost::numeric::ublas::matrix< SelfSpectrumDataPoint > SelfSpectrumMatrix
Definition
selfspectrum.h:40
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
selfspectrum.h
pappsomspp
core
processing
specself
selfspectrum.cpp
Generated on
for libpappsomspp by
1.17.0