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>
33#include "pappsomspp/config.h"
34
35
36QString
38{
39 QString version(MASSCHROQ_VERSION);
40 return version;
41}
42
43QString
45{
46
47 switch(peak_category)
48 {
50 return "a";
51 break;
53 return "aa";
54 break;
56 return "ab";
57 break;
59 return "za";
60 break;
62 return "zaa";
63 break;
65 return "zab";
66 break;
68 return "b";
69 break;
71 return "c";
72 break;
74 return "d";
75 break;
77 return "missed";
78 break;
80 return "nomatch";
81 break;
83 return "pm";
84 break;
86 throw pappso::PappsoException(QObject::tr("no QString for PeakQualityCategory::last"));
87 break;
88 }
89
90 return "";
91}
92
93
94QString
96{
97
98 switch(extract_method)
99 {
101 return "sum";
102 break;
104 return "max";
105 break;
106 default:
107 break;
108 }
109 return "";
110}
111
112QString
114{
115 switch(precision_unit)
116 {
118 return "ppm";
119 break;
121 return "dalton";
122 break;
123 default:
124 break;
125 }
126 return "";
127}
static QString getVersion()
Definition utils.cpp:37
static QString enumToString(PeakQualityCategory peak_category)
Convenience function to return a string describing the specglob alingment type.
Definition utils.cpp:44
#define MASSCHROQ_VERSION
Definition config.h:7
@ sum
sum of intensities
Definition types.h:279
@ max
maximum of intensities
Definition types.h:280
@ a
peak detected using a single direct MS2 observation
Definition types.h:46
@ missed
no peak found at all
Definition types.h:60
@ aa
best possible : more than one direct MS2 fragmentation in same MSRUN
Definition types.h:45