libpappsomspp
Library for mass spectrometry
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
32namespace pappso
33{
34namespace specself
35{
36
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
62
65{
66 return m_matrix;
67}
68
69
70const Trace &
72{
73 return m_trace;
74}
75
76
77void
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
95void
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
convert a list of mass to amino acid string codes
A simple container of DataPoint instances.
Definition trace.h:152
const SelfSpectrumMatrix & getMatrix() const
void setVariableModification(const pappso::AaStringCodeMassMatching &codec_mass_matching, const Aa &aa, int quantifier)
SelfSpectrumMatrix m_matrix
SelfSpectrum(const pappso::AaStringCodeMassMatching &codec_mass_matching, const Trace &trace)
void setPrecursorMass(const pappso::AaStringCodeMassMatching &codec_mass_matching, double precursor_mass)
const Trace & getTrace() const
boost::numeric::ublas::matrix< SelfSpectrumDataPoint > SelfSpectrumMatrix
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39