libpappsomspp
Library for mass spectrometry
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 "deepprotenum.h"
33#include "../../pappsoexception.h"
34
37{
39 if(name == "delta_position")
40 {
42 }
43 else if(name == "no_delta_position")
44 {
46 }
47 else if(name == "uncategorized")
48 {
50 }
51 else if(name == "zero_mass_delta")
52 {
54 }
55 else if(name == "zero_mass_delta_mc")
56 {
58 }
59 else if(name == "zero_mass_delta_st")
60 {
62 }
63 else
64 {
66 QObject::tr("DeepProtMatchType unknown :\n%1").arg(name));
67 }
68 return match_type;
69}
70
71
74 const QString &name)
75{
76
79 if(name == "cter_removal")
80 {
82 }
83 else if(name == "delta_position")
84 {
86 }
87 else if(name == "missed_cleavage")
88 {
90 }
91 else if(name == "no_delta_position")
92 {
94 }
95 else if(name == "nter_removal")
96 {
98 }
99 else if(name == "zero_mass_delta")
100 {
102 }
103
104 else
105 {
107 QObject::tr("DeepProtPeptideCandidateStatus unknown :\n%1").arg(name));
108 }
109 return status;
110}
111
112const QString
114{
115
116 QString match_type_str;
117 switch(match_type)
118 {
120 match_type_str = "delta_position";
121 break;
123 match_type_str = "no_delta_position";
124 break;
126 match_type_str = "uncategorized";
127 break;
129 match_type_str = "zero_mass_delta";
130 break;
132 match_type_str = "zero_mass_delta_mc";
133 break;
135 match_type_str = "zero_mass_delta_st";
136 break;
137
138 default:
140 QObject::tr("DeepProtMatchType unknown :\n%1")
141 .arg((std::uint8_t)match_type));
142 }
143 return match_type_str;
144}
145
146const QString
148{
149
150 QString status_str;
151 switch(status)
152 {
154 status_str = "cter_removal";
155 break;
157 status_str = "delta_position";
158 break;
160 status_str = "missed_cleavage";
161 break;
163 status_str = "no_delta_position";
164 break;
166 status_str = "nter_removal";
167 break;
169 status_str = "zero_mass_delta";
170 break;
171
172 default:
174 QObject::tr("DeepProtPeptideCandidateStatus unknown :\n%1")
175 .arg((std::uint8_t)status));
176 }
177
178 return status_str;
179}
static const QString toString(DeepProtMatchType match_type)
static DeepProtMatchType DeepProtMatchTypeFromString(const QString &name)
static DeepProtPeptideCandidateStatus DeepProtPeptideCandidateStatusFromString(const QString &name)
base type definition to use in DeepProt
DeepProtMatchType
definition of different class of PSMs used by DeepProt
Definition: deepprotenum.h:42
@ ZeroMassDeltaMissedCleavage
peptide candidate with missed cleavage is in precursor mz range
@ uncategorized
precursor mass was not compared
@ ZeroMassDelta
peptide candidate is in precursor mz range
@ ZeroMassDeltaSemiTryptic
semi tryptic peptide candidate is in precursor mz range
DeepProtPeptideCandidateStatus
definition of different status for potential peptide candidates on the same spectrum
Definition: deepprotenum.h:61
@ unmodified
precursor mass was not compared