libpappsomspp
Library for mass spectrometry
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"
36
39{
41 if(name == "delta_position")
42 {
44 }
45 else if(name == "no_delta_position")
46 {
48 }
49 else if(name == "uncategorized")
50 {
52 }
53 else if(name == "zero_mass_delta")
54 {
56 }
57 else if(name == "zero_mass_delta_mc")
58 {
60 }
61 else if(name == "zero_mass_delta_st")
62 {
64 }
65 else
66 {
67 throw pappso::PappsoException(QObject::tr("DeepProtMatchType unknown :\n%1").arg(name));
68 }
69 return match_type;
70}
71
72
75{
76
78 if(name == "cter_removal")
79 {
81 }
82 else if(name == "delta_position")
83 {
85 }
86 else if(name == "missed_cleavage")
87 {
89 }
90 else if(name == "no_delta_position")
91 {
93 }
94 else if(name == "nter_removal")
95 {
97 }
98 else if(name == "zero_mass_delta")
99 {
101 }
102
103 else
104 {
106 QObject::tr("DeepProtPeptideCandidateStatus unknown :\n%1").arg(name));
107 }
108 return status;
109}
110
111const QString
113{
114
115 QString match_type_str;
116 switch(match_type)
117 {
119 match_type_str = "delta_position";
120 break;
122 match_type_str = "no_delta_position";
123 break;
125 match_type_str = "uncategorized";
126 break;
128 match_type_str = "zero_mass_delta";
129 break;
131 match_type_str = "zero_mass_delta_mc";
132 break;
134 match_type_str = "zero_mass_delta_st";
135 break;
136
137 default:
139 QObject::tr("DeepProtMatchType unknown :\n%1").arg((std::uint8_t)match_type));
140 }
141 return match_type_str;
142}
143
144const QString
146{
147
148 QString status_str;
149 switch(status)
150 {
152 status_str = "cter_removal";
153 break;
155 status_str = "delta_position";
156 break;
158 status_str = "missed_cleavage";
159 break;
161 status_str = "no_delta_position";
162 break;
164 status_str = "nter_removal";
165 break;
167 status_str = "zero_mass_delta";
168 break;
169
170 default:
172 QObject::tr("DeepProtPeptideCandidateStatus unknown :\n%1").arg((std::uint8_t)status));
173 }
174
175 return status_str;
176}
static const QString toString(DeepProtMatchType match_type)
static DeepProtMatchType DeepProtMatchTypeFromString(const QString &name)
static DeepProtPeptideCandidateStatus DeepProtPeptideCandidateStatusFromString(const QString &name)
DeepProtMatchType
definition of different class of PSMs used by DeepProt
@ 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
@ unmodified
precursor mass was not compared