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 pappso::AaStringCodeMassMatching &codec_mass_matching,
39 const Trace &trace)
40{
41 m_trace = trace;
42 m_matrix.resize(m_trace.size(), m_trace.size());
43
44 qDebug() << m_trace.size();
45 for(auto itmi = ++m_matrix.begin1(); itmi != m_matrix.end1(); ++itmi)
46 {
47 qDebug() << itmi.index1();
48 for(auto itmj = ++itmi.begin(); itmj != itmi.end(); itmj++)
49 {
50 // itmj.fillSelfDataPoint(m_trace[itmj.index1()],
51 // m_trace[itmj.index2()]);
52 (*itmj).fillSelfSpectrumDataPoint(codec_mass_matching,
53 m_trace[itmj.index1()],
54 m_trace[itmj.index2()]);
55 }
56 }
57
58 qDebug();
59}
60
64
67{
68 return m_matrix;
69}
70
71
72const Trace &
74{
75 return m_trace;
76}
77
78
79void
81 const pappso::AaStringCodeMassMatching &codec_mass_matching,
82 double precursor_mass)
83{
84
85 for(auto itmi = ++m_matrix.begin1(); itmi != m_matrix.end1(); ++itmi)
86 {
87 for(auto itmj = ++itmi.begin(); itmj != itmi.end(); itmj++)
88 {
89 // itmj.fillSelfDataPoint(m_trace[itmj.index1()],
90 // m_trace[itmj.index2()]);
91 (*itmj).fillAntiSpectrumDataPoint(precursor_mass,
92 codec_mass_matching,
93 m_trace[itmj.index1()],
94 m_trace[itmj.index2()]);
95 }
96 }
97}
98
99
100void
102 const pappso::AaStringCodeMassMatching &codec_mass_matching,
103 const Aa &aa,
104 int quantifier)
105{
106
107 for(auto itmi = ++m_matrix.begin1(); itmi != m_matrix.end1(); ++itmi)
108 {
109 for(auto itmj = ++itmi.begin(); itmj != itmi.end(); itmj++)
110 {
111 // itmj.fillSelfDataPoint(m_trace[itmj.index1()],
112 // m_trace[itmj.index2()]);
113 (*itmj).setVariableModification(codec_mass_matching, aa, quantifier);
114 }
115 }
116}
117
118} // namespace specself
119} // namespace pappso
convert a list of mass to amino acid string codes
A simple container of DataPoint instances.
Definition trace.h:148
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
spectrum self operations