libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
peakionisotopematch.cpp
Go to the documentation of this file.
1
/*
2
* *******************************************************************************
3
* * Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
4
* *
5
* * This file is part of MassChroqPRM.
6
* *
7
* * MassChroqPRM is free software: you can redistribute it and/or modify
8
* * it under the terms of the GNU General Public License as published by
9
* * the Free Software Foundation, either version 3 of the License, or
10
* * (at your option) any later version.
11
* *
12
* * MassChroqPRM is distributed in the hope that it will be useful,
13
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* * GNU General Public License for more details.
16
* *
17
* * You should have received a copy of the GNU General Public License
18
* * along with MassChroqPRM. If not, see <http://www.gnu.org/licenses/>.
19
* *
20
* * Contributors:
21
* * Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
22
* implementation
23
* ******************************************************************************/
24
25
#include "
peakionisotopematch.h
"
26
27
namespace
pappso
28
{
29
std::vector<PeakIonIsotopeMatch>::iterator
30
findComplementIonType
(std::vector<PeakIonIsotopeMatch>::iterator begin,
31
std::vector<PeakIonIsotopeMatch>::iterator end,
32
const
PeakIonIsotopeMatch
&peak_ion,
33
std::size_t peptide_size)
34
{
35
36
return
std::find_if(begin, end, [peak_ion, peptide_size](
const
PeakIonIsotopeMatch
&to_compare) {
37
if
(to_compare.
getCharge
() == peak_ion.
getCharge
())
38
{
39
if
((to_compare.
getPeptideFragmentIonSp
().get()->
size
() +
40
peak_ion.
getPeptideFragmentIonSp
().get()->
size
()) == peptide_size)
41
{
42
if
(
peptideIonTypeIsComplement
(to_compare.
getPeptideIonType
(),
43
peak_ion.
getPeptideIonType
()))
44
{
45
if
(to_compare.
getPeptideNaturalIsotopeAverageSp
().get()->
getIsotopeNumber
() ==
46
peak_ion.
getPeptideNaturalIsotopeAverageSp
().get()->
getIsotopeNumber
())
47
{
48
return
true
;
49
}
50
}
51
}
52
}
53
54
return
false
;
55
});
56
}
57
58
59
PeakIonIsotopeMatch::PeakIonIsotopeMatch
(
60
const
DataPoint
&peak,
61
const
PeptideNaturalIsotopeAverageSp
&naturalIsotopeAverageSp,
62
const
PeptideFragmentIonSp
&ion_sp)
63
:
PeakIonMatch
(peak, ion_sp, naturalIsotopeAverageSp.get()->
getCharge
()),
64
_naturalIsotopeAverageSp
(naturalIsotopeAverageSp)
65
{
66
qDebug();
67
}
68
69
PeakIonIsotopeMatch::PeakIonIsotopeMatch
(
const
PeakIonIsotopeMatch
&other) :
PeakIonMatch
(other)
70
{
71
_naturalIsotopeAverageSp
= other.
_naturalIsotopeAverageSp
;
72
}
73
74
75
PeakIonIsotopeMatch::PeakIonIsotopeMatch
(
PeakIonIsotopeMatch
&&other)
76
:
PeakIonMatch
(std::move(other))
77
{
78
_naturalIsotopeAverageSp
= other._naturalIsotopeAverageSp;
79
}
80
81
PeakIonIsotopeMatch::~PeakIonIsotopeMatch
()
82
{
83
}
84
const
PeptideNaturalIsotopeAverageSp
&
85
PeakIonIsotopeMatch::getPeptideNaturalIsotopeAverageSp
()
const
86
{
87
return
_naturalIsotopeAverageSp
;
88
}
89
90
91
PeakIonIsotopeMatch
&
92
PeakIonIsotopeMatch::operator=
(
const
PeakIonIsotopeMatch
&other)
93
{
94
PeakIonMatch::operator=
(other);
95
_naturalIsotopeAverageSp
= other.
_naturalIsotopeAverageSp
;
96
97
return
*
this
;
98
}
99
100
101
QString
102
PeakIonIsotopeMatch::toString
()
const
103
{
104
return
QString(
"%1isotope%2r%3mz%4"
)
105
.arg(
PeakIonMatch::toString
())
106
.arg(
_naturalIsotopeAverageSp
.get()->getIsotopeNumber())
107
.arg(
_naturalIsotopeAverageSp
.get()->getIsotopeRank())
108
.arg(
getPeak
().
x
);
109
}
110
111
}
// namespace pappso
pappso::PeakIonIsotopeMatch
Definition
peakionisotopematch.h:47
pappso::PeakIonIsotopeMatch::PeakIonIsotopeMatch
PeakIonIsotopeMatch(const DataPoint &peak, const PeptideNaturalIsotopeAverageSp &naturalIsotopeAverageSp, const PeptideFragmentIonSp &ion_sp)
Definition
peakionisotopematch.cpp:59
pappso::PeakIonIsotopeMatch::toString
virtual QString toString() const
Definition
peakionisotopematch.cpp:102
pappso::PeakIonIsotopeMatch::operator=
PeakIonIsotopeMatch & operator=(const PeakIonIsotopeMatch &other)
Definition
peakionisotopematch.cpp:92
pappso::PeakIonIsotopeMatch::_naturalIsotopeAverageSp
PeptideNaturalIsotopeAverageSp _naturalIsotopeAverageSp
Definition
peakionisotopematch.h:65
pappso::PeakIonIsotopeMatch::getPeptideNaturalIsotopeAverageSp
virtual const PeptideNaturalIsotopeAverageSp & getPeptideNaturalIsotopeAverageSp() const
Definition
peakionisotopematch.cpp:85
pappso::PeakIonIsotopeMatch::~PeakIonIsotopeMatch
virtual ~PeakIonIsotopeMatch()
Definition
peakionisotopematch.cpp:81
pappso::PeakIonMatch::getPeak
const DataPoint & getPeak() const
Definition
peakionmatch.cpp:74
pappso::PeakIonMatch::getPeptideFragmentIonSp
virtual const PeptideFragmentIonSp & getPeptideFragmentIonSp() const
Definition
peakionmatch.cpp:68
pappso::PeakIonMatch::toString
virtual QString toString() const
Definition
peakionmatch.cpp:98
pappso::PeakIonMatch::getPeptideIonType
Enums::PeptideIon getPeptideIonType() const
Definition
peakionmatch.cpp:86
pappso::PeakIonMatch::operator=
PeakIonMatch & operator=(const PeakIonMatch &other)
Definition
peakionmatch.cpp:58
pappso::PeakIonMatch::PeakIonMatch
PeakIonMatch(const DataPoint &peak, const PeptideFragmentIonSp &ion_sp, unsigned int charge)
Definition
peakionmatch.cpp:35
pappso::PeakIonMatch::getCharge
unsigned int getCharge() const
Definition
peakionmatch.cpp:80
pappso::PeptideFragmentIon::size
virtual unsigned int size() const override
Definition
peptidefragmention.cpp:538
pappso::PeptideNaturalIsotopeAverage::getIsotopeNumber
unsigned int getIsotopeNumber() const
Definition
peptidenaturalisotopeaverage.cpp:210
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappso::peptideIonTypeIsComplement
bool peptideIonTypeIsComplement(Enums::PeptideIon ion_type_ref, Enums::PeptideIon ion_type)
tells if an ion type is the complement ion of the other
Definition
peptide.cpp:70
pappso::PeptideFragmentIonSp
std::shared_ptr< const PeptideFragmentIon > PeptideFragmentIonSp
Definition
peptidefragmention.h:46
pappso::PeptideIonCter::x
@ x
Definition
peptide.h:92
pappso::PeptideNaturalIsotopeAverageSp
std::shared_ptr< const PeptideNaturalIsotopeAverage > PeptideNaturalIsotopeAverageSp
Definition
peptidenaturalisotopeaverage.h:40
pappso::findComplementIonType
std::vector< PeakIonIsotopeMatch >::iterator findComplementIonType(std::vector< PeakIonIsotopeMatch >::iterator begin, std::vector< PeakIonIsotopeMatch >::iterator end, const PeakIonIsotopeMatch &peak_ion, std::size_t peptide_size)
find the first element containing the complementary ion complementary ion of y1 is b(n-1) for instanc...
Definition
peakionisotopematch.cpp:30
peakionisotopematch.h
pappso::DataPoint
Definition
datapoint.h:22
pappsomspp
core
psm
peakionisotopematch.cpp
Generated on
for libpappsomspp by
1.17.0