libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
deepprotenum.cpp
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/psm/deepprot/deepprotenum.cpp
3
* \date 22/1/2021
4
* \author Olivier Langella <olivier.langella@universite-paris-saclay.fr>
5
* \brief base type definition to use in DeepProt
6
*
7
* DeepProt is the C++ implementation of the SpecOMS algorithm
8
*
9
*/
10
11
/*******************************************************************************
12
* Copyright (c) 2021 Olivier Langella
13
*<olivier.langella@universite-paris-saclay.fr>.
14
*
15
* This file is part of the PAPPSOms++ library.
16
*
17
* PAPPSOms++ is free software: you can redistribute it and/or modify
18
* it under the terms of the GNU General Public License as published by
19
* the Free Software Foundation, either version 3 of the License, or
20
* (at your option) any later version.
21
*
22
* PAPPSOms++ is distributed in the hope that it will be useful,
23
* but WITHOUT ANY WARRANTY; without even the implied warranty of
24
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
* GNU General Public License for more details.
26
*
27
* You should have received a copy of the GNU General Public License
28
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
29
*
30
******************************************************************************/
31
32
#include <QObject>
33
34
#include "
deepprotenum.h
"
35
#include "
pappsomspp/core/pappsoexception.h
"
36
37
pappso::DeepProtMatchType
38
pappso::DeepProtEnumStr::DeepProtMatchTypeFromString
(
const
QString &name)
39
{
40
DeepProtMatchType
match_type =
DeepProtMatchType::uncategorized
;
41
if
(name ==
"delta_position"
)
42
{
43
match_type =
DeepProtMatchType::DeltaPosition
;
44
}
45
else
if
(name ==
"no_delta_position"
)
46
{
47
match_type =
DeepProtMatchType::NoDeltaPosition
;
48
}
49
else
if
(name ==
"uncategorized"
)
50
{
51
match_type =
DeepProtMatchType::uncategorized
;
52
}
53
else
if
(name ==
"zero_mass_delta"
)
54
{
55
match_type =
DeepProtMatchType::ZeroMassDelta
;
56
}
57
else
if
(name ==
"zero_mass_delta_mc"
)
58
{
59
match_type =
DeepProtMatchType::ZeroMassDeltaMissedCleavage
;
60
}
61
else
if
(name ==
"zero_mass_delta_st"
)
62
{
63
match_type =
DeepProtMatchType::ZeroMassDeltaSemiTryptic
;
64
}
65
else
66
{
67
throw
pappso::PappsoException
(QObject::tr(
"DeepProtMatchType unknown :\n%1"
).arg(name));
68
}
69
return
match_type;
70
}
71
72
73
pappso::DeepProtPeptideCandidateStatus
74
pappso::DeepProtEnumStr::DeepProtPeptideCandidateStatusFromString
(
const
QString &name)
75
{
76
77
DeepProtPeptideCandidateStatus
status =
DeepProtPeptideCandidateStatus::unmodified
;
78
if
(name ==
"cter_removal"
)
79
{
80
status =
DeepProtPeptideCandidateStatus::CterRemoval
;
81
}
82
else
if
(name ==
"delta_position"
)
83
{
84
status =
DeepProtPeptideCandidateStatus::DeltaPosition
;
85
}
86
else
if
(name ==
"missed_cleavage"
)
87
{
88
status =
DeepProtPeptideCandidateStatus::MissedCleavage
;
89
}
90
else
if
(name ==
"no_delta_position"
)
91
{
92
status =
DeepProtPeptideCandidateStatus::NoDeltaPosition
;
93
}
94
else
if
(name ==
"nter_removal"
)
95
{
96
status =
DeepProtPeptideCandidateStatus::NterRemoval
;
97
}
98
else
if
(name ==
"zero_mass_delta"
)
99
{
100
status =
DeepProtPeptideCandidateStatus::ZeroMassDelta
;
101
}
102
103
else
104
{
105
throw
pappso::PappsoException
(
106
QObject::tr(
"DeepProtPeptideCandidateStatus unknown :\n%1"
).arg(name));
107
}
108
return
status;
109
}
110
111
const
QString
112
pappso::DeepProtEnumStr::toString
(
pappso::DeepProtMatchType
match_type)
113
{
114
115
QString match_type_str;
116
switch
(match_type)
117
{
118
case
DeepProtMatchType::DeltaPosition
:
119
match_type_str =
"delta_position"
;
120
break
;
121
case
DeepProtMatchType::NoDeltaPosition
:
122
match_type_str =
"no_delta_position"
;
123
break
;
124
case
DeepProtMatchType::uncategorized
:
125
match_type_str =
"uncategorized"
;
126
break
;
127
case
DeepProtMatchType::ZeroMassDelta
:
128
match_type_str =
"zero_mass_delta"
;
129
break
;
130
case
DeepProtMatchType::ZeroMassDeltaMissedCleavage
:
131
match_type_str =
"zero_mass_delta_mc"
;
132
break
;
133
case
DeepProtMatchType::ZeroMassDeltaSemiTryptic
:
134
match_type_str =
"zero_mass_delta_st"
;
135
break
;
136
137
default
:
138
throw
pappso::PappsoException
(
139
QObject::tr(
"DeepProtMatchType unknown :\n%1"
).arg((std::uint8_t)match_type));
140
}
141
return
match_type_str;
142
}
143
144
const
QString
145
pappso::DeepProtEnumStr::toString
(
pappso::DeepProtPeptideCandidateStatus
status)
146
{
147
148
QString status_str;
149
switch
(status)
150
{
151
case
DeepProtPeptideCandidateStatus::CterRemoval
:
152
status_str =
"cter_removal"
;
153
break
;
154
case
DeepProtPeptideCandidateStatus::DeltaPosition
:
155
status_str =
"delta_position"
;
156
break
;
157
case
DeepProtPeptideCandidateStatus::MissedCleavage
:
158
status_str =
"missed_cleavage"
;
159
break
;
160
case
DeepProtPeptideCandidateStatus::NoDeltaPosition
:
161
status_str =
"no_delta_position"
;
162
break
;
163
case
DeepProtPeptideCandidateStatus::NterRemoval
:
164
status_str =
"nter_removal"
;
165
break
;
166
case
DeepProtPeptideCandidateStatus::ZeroMassDelta
:
167
status_str =
"zero_mass_delta"
;
168
break
;
169
170
default
:
171
throw
pappso::PappsoException
(
172
QObject::tr(
"DeepProtPeptideCandidateStatus unknown :\n%1"
).arg((std::uint8_t)status));
173
}
174
175
return
status_str;
176
}
pappso::DeepProtEnumStr::toString
static const QString toString(DeepProtMatchType match_type)
Definition
deepprotenum.cpp:112
pappso::DeepProtEnumStr::DeepProtMatchTypeFromString
static DeepProtMatchType DeepProtMatchTypeFromString(const QString &name)
Definition
deepprotenum.cpp:38
pappso::DeepProtEnumStr::DeepProtPeptideCandidateStatusFromString
static DeepProtPeptideCandidateStatus DeepProtPeptideCandidateStatusFromString(const QString &name)
Definition
deepprotenum.cpp:74
pappso::PappsoException
Definition
pappsoexception.h:41
deepprotenum.h
pappso::DeepProtMatchType
DeepProtMatchType
definition of different class of PSMs used by DeepProt
Definition
deepprotenum.h:42
pappso::DeepProtMatchType::ZeroMassDeltaMissedCleavage
@ ZeroMassDeltaMissedCleavage
peptide candidate with missed cleavage is in precursor mz range
Definition
deepprotenum.h:45
pappso::DeepProtMatchType::uncategorized
@ uncategorized
precursor mass was not compared
Definition
deepprotenum.h:43
pappso::DeepProtMatchType::NoDeltaPosition
@ NoDeltaPosition
Definition
deepprotenum.h:51
pappso::DeepProtMatchType::DeltaPosition
@ DeltaPosition
Definition
deepprotenum.h:49
pappso::DeepProtMatchType::ZeroMassDelta
@ ZeroMassDelta
peptide candidate is in precursor mz range
Definition
deepprotenum.h:44
pappso::DeepProtMatchType::ZeroMassDeltaSemiTryptic
@ ZeroMassDeltaSemiTryptic
semi tryptic peptide candidate is in precursor mz range
Definition
deepprotenum.h:47
pappso::DeepProtPeptideCandidateStatus
DeepProtPeptideCandidateStatus
definition of different status for potential peptide candidates on the same spectrum
Definition
deepprotenum.h:61
pappso::DeepProtPeptideCandidateStatus::CterRemoval
@ CterRemoval
Definition
deepprotenum.h:64
pappso::DeepProtPeptideCandidateStatus::unmodified
@ unmodified
precursor mass was not compared
Definition
deepprotenum.h:62
pappso::DeepProtPeptideCandidateStatus::NoDeltaPosition
@ NoDeltaPosition
Definition
deepprotenum.h:68
pappso::DeepProtPeptideCandidateStatus::MissedCleavage
@ MissedCleavage
Definition
deepprotenum.h:66
pappso::DeepProtPeptideCandidateStatus::DeltaPosition
@ DeltaPosition
Definition
deepprotenum.h:67
pappso::DeepProtPeptideCandidateStatus::ZeroMassDelta
@ ZeroMassDelta
Definition
deepprotenum.h:63
pappso::DeepProtPeptideCandidateStatus::NterRemoval
@ NterRemoval
Definition
deepprotenum.h:65
pappsoexception.h
pappsomspp
core
psm
deepprot
deepprotenum.cpp
Generated on
for libpappsomspp by
1.17.0