libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
utils.cpp
Go to the documentation of this file.
1
2
/**
3
* \file mcql/utils.cpp
4
* \date 03/01/2025
5
* \author Olivier Langella
6
* \brief MassChroQ Lite utilities
7
*/
8
9
/*******************************************************************************
10
* Copyright (c) 2025 Olivier Langella
11
*<Olivier.Langella@universite-paris-saclay.fr>.
12
*
13
* This file is part of MassChroQ.
14
*
15
* MassChroQ is free software: you can redistribute it and/or modify
16
* it under the terms of the GNU General Public License as published by
17
* the Free Software Foundation, either version 3 of the License, or
18
* (at your option) any later version.
19
*
20
* MassChroQ is distributed in the hope that it will be useful,
21
* but WITHOUT ANY WARRANTY; without even the implied warranty of
22
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
* GNU General Public License for more details.
24
*
25
* You should have received a copy of the GNU General Public License
26
* along with MassChroQ. If not, see <http://www.gnu.org/licenses/>.
27
*
28
******************************************************************************/
29
30
#include "
utils.h
"
31
#include <QObject>
32
#include "
pappsomspp/core/pappsoexception.h
"
33
#include "
pappsomspp/config.h
"
34
35
36
QString
37
pappso::masschroq::Utils::getVersion
()
38
{
39
QString version(
MASSCHROQ_VERSION
);
40
return
version;
41
}
42
43
QString
44
pappso::masschroq::Utils::enumToString
(
PeakQualityCategory
peak_category)
45
{
46
47
switch
(peak_category)
48
{
49
case
PeakQualityCategory::a
:
50
return
"a"
;
51
break
;
52
case
PeakQualityCategory::aa
:
53
return
"aa"
;
54
break
;
55
case
PeakQualityCategory::ab
:
56
return
"ab"
;
57
break
;
58
case
PeakQualityCategory::za
:
59
return
"za"
;
60
break
;
61
case
PeakQualityCategory::zaa
:
62
return
"zaa"
;
63
break
;
64
case
PeakQualityCategory::zab
:
65
return
"zab"
;
66
break
;
67
case
PeakQualityCategory::b
:
68
return
"b"
;
69
break
;
70
case
PeakQualityCategory::c
:
71
return
"c"
;
72
break
;
73
case
PeakQualityCategory::d
:
74
return
"d"
;
75
break
;
76
case
PeakQualityCategory::missed
:
77
return
"missed"
;
78
break
;
79
case
PeakQualityCategory::nomatch
:
80
return
"nomatch"
;
81
break
;
82
case
PeakQualityCategory::post_matching
:
83
return
"pm"
;
84
break
;
85
case
PeakQualityCategory::last
:
86
throw
pappso::PappsoException
(QObject::tr(
"no QString for PeakQualityCategory::last"
));
87
break
;
88
}
89
90
return
""
;
91
}
92
93
94
QString
95
pappso::masschroq::Utils::enumToString
(
Enums::XicExtractMethod
extract_method)
96
{
97
98
switch
(extract_method)
99
{
100
case
Enums::XicExtractMethod::sum
:
101
return
"sum"
;
102
break
;
103
case
Enums::XicExtractMethod::max
:
104
return
"max"
;
105
break
;
106
default
:
107
break
;
108
}
109
return
""
;
110
}
111
112
QString
113
pappso::masschroq::Utils::enumToString
(
Enums::PrecisionUnit
precision_unit)
114
{
115
switch
(precision_unit)
116
{
117
case
Enums::PrecisionUnit::ppm
:
118
return
"ppm"
;
119
break
;
120
case
Enums::PrecisionUnit::dalton
:
121
return
"dalton"
;
122
break
;
123
default
:
124
break
;
125
}
126
return
""
;
127
}
pappso::PappsoException
Definition
pappsoexception.h:42
pappso::masschroq::Utils::getVersion
static QString getVersion()
Definition
utils.cpp:37
pappso::masschroq::Utils::enumToString
static QString enumToString(PeakQualityCategory peak_category)
Convenience function to return a string describing the specglob alingment type.
Definition
utils.cpp:44
config.h
MASSCHROQ_VERSION
#define MASSCHROQ_VERSION
Definition
config.h:7
utils.h
pappso::Enums::XicExtractMethod
XicExtractMethod
Definition
types.h:278
pappso::Enums::XicExtractMethod::sum
@ sum
sum of intensities
Definition
types.h:279
pappso::Enums::XicExtractMethod::max
@ max
maximum of intensities
Definition
types.h:280
pappso::Enums::PrecisionUnit
PrecisionUnit
Definition
types.h:98
pappso::Enums::PrecisionUnit::ppm
@ ppm
Definition
types.h:101
pappso::Enums::PrecisionUnit::dalton
@ dalton
Definition
types.h:100
pappso::masschroq::PeakQualityCategory
PeakQualityCategory
Definition
types.h:42
pappso::masschroq::PeakQualityCategory::a
@ a
peak detected using a single direct MS2 observation
Definition
types.h:46
pappso::masschroq::PeakQualityCategory::ab
@ ab
Definition
types.h:47
pappso::masschroq::PeakQualityCategory::missed
@ missed
no peak found at all
Definition
types.h:60
pappso::masschroq::PeakQualityCategory::aa
@ aa
best possible : more than one direct MS2 fragmentation in same MSRUN
Definition
types.h:45
pappso::masschroq::PeakQualityCategory::zab
@ zab
Definition
types.h:51
pappso::masschroq::PeakQualityCategory::c
@ c
Definition
types.h:54
pappso::masschroq::PeakQualityCategory::nomatch
@ nomatch
Definition
types.h:43
pappso::masschroq::PeakQualityCategory::d
@ d
Definition
types.h:56
pappso::masschroq::PeakQualityCategory::b
@ b
Definition
types.h:52
pappso::masschroq::PeakQualityCategory::za
@ za
Definition
types.h:50
pappso::masschroq::PeakQualityCategory::last
@ last
Definition
types.h:61
pappso::masschroq::PeakQualityCategory::zaa
@ zaa
Definition
types.h:49
pappso::masschroq::PeakQualityCategory::post_matching
@ post_matching
Definition
types.h:58
pappsoexception.h
pappsomspp
core
masschroq
utils.cpp
Generated on Tue Sep 23 2025 09:36:36 for libpappsomspp by
1.13.2