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 <QObject>
33 
34 #include "deepprotenum.h"
35 #include "../../pappsoexception.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  {
68  QObject::tr("DeepProtMatchType unknown :\n%1").arg(name));
69  }
70  return match_type;
71 }
72 
73 
76  const QString &name)
77 {
78 
81  if(name == "cter_removal")
82  {
84  }
85  else if(name == "delta_position")
86  {
88  }
89  else if(name == "missed_cleavage")
90  {
92  }
93  else if(name == "no_delta_position")
94  {
96  }
97  else if(name == "nter_removal")
98  {
100  }
101  else if(name == "zero_mass_delta")
102  {
104  }
105 
106  else
107  {
109  QObject::tr("DeepProtPeptideCandidateStatus unknown :\n%1").arg(name));
110  }
111  return status;
112 }
113 
114 const QString
116 {
117 
118  QString match_type_str;
119  switch(match_type)
120  {
122  match_type_str = "delta_position";
123  break;
125  match_type_str = "no_delta_position";
126  break;
128  match_type_str = "uncategorized";
129  break;
131  match_type_str = "zero_mass_delta";
132  break;
134  match_type_str = "zero_mass_delta_mc";
135  break;
137  match_type_str = "zero_mass_delta_st";
138  break;
139 
140  default:
142  QObject::tr("DeepProtMatchType unknown :\n%1")
143  .arg((std::uint8_t)match_type));
144  }
145  return match_type_str;
146 }
147 
148 const QString
150 {
151 
152  QString status_str;
153  switch(status)
154  {
156  status_str = "cter_removal";
157  break;
159  status_str = "delta_position";
160  break;
162  status_str = "missed_cleavage";
163  break;
165  status_str = "no_delta_position";
166  break;
168  status_str = "nter_removal";
169  break;
171  status_str = "zero_mass_delta";
172  break;
173 
174  default:
176  QObject::tr("DeepProtPeptideCandidateStatus unknown :\n%1")
177  .arg((std::uint8_t)status));
178  }
179 
180  return status_str;
181 }
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