libpappsomspp
Library for mass spectrometry
types.h
Go to the documentation of this file.
1/**
2 * \file pappsomspp/types.h
3 * \date 4/3/2015
4 * \author Olivier Langella
5 * \brief This header contains all the type re-definitions and all
6 * the global variables definitions used in the PAPPSOms++ library.
7 */
8
9/*******************************************************************************
10 * Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
11 *
12 * This file is part of the PAPPSOms++ library.
13 *
14 * PAPPSOms++ is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * PAPPSOms++ is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
26 *
27 * Contributors:
28 * Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
29 *implementation
30 ******************************************************************************/
31
32#pragma once
33
34#include <QString>
35
36namespace pappso
37{
38
39/************ Typedefs **************************************************/
40
41/** \var typedef QString PeptideStr
42 \brief A type definition for PeptideStr
43 */
44typedef QString PeptideStr;
45
46/** \var typedef double pappso_double
47 \brief A type definition for doubles
48 */
49typedef double pappso_double;
50
51/** \var typedef float mcq_float
52 \brief A type definition for floats
53 */
54typedef float pappso_float;
55
56typedef unsigned int uint;
57
58/*********** enumerations *********************************/
59
60/** \def PrecisionUnit ppm or dalton
61 *
62 */
63enum class PrecisionUnit
64{
65 none,
66 dalton,
67 ppm,
68 res,
69 mz,
70 last
71};
72
73/** \def AtomIsotopeSurvey list of atoms on which isotopes may occurs
74 *
75 */
76enum class AtomIsotopeSurvey : std::int8_t
77{
78 C,
79 H,
80 O,
81 N,
82 S,
83 last
84};
85
86
87/** \def Isotope list of isotopes taken into account for peptide abundance
88 * calculation
89 *
90 */
91enum class Isotope
92{
93 C13,
94 H2,
95 O17,
96 O18,
97 N15,
98 S33,
99 S34,
100 S36
101};
102
103
104/** \def MzFormat mz data file format types
105 *
106 */
107enum class MzFormat : std::int8_t
108{
109 unknown = 0, ///< unknown format
110 mzML = 1, ///< mzML
111 mzXML = 2, ///< mzXML
112 MGF = 3, ///< Mascot format
113 SQLite3 = 4, ///< SQLite3 format
114 xy = 5, ///< (x,y) format
115 mz5 = 6, //< MZ5 format
116 msn = 7, //< MS_MS2 format
117 abSciexWiff = 8,
118 abSciexT2D = 9,
120 thermoRaw = 11,
121 watersRaw = 12,
122 brukerFid = 13,
123 brukerYep = 14,
124 brukerBaf = 15,
125 brukerTims = 16,
126 last = 17
127};
128
129
130/** \def MzFormat mz data file format types
131 *
132 */
133enum class AminoAcidChar : char
134{
135 alanine = 'A',
136 cysteine = 'C',
137 aspartic_acid = 'D',
138 glutamic_acid = 'E',
139 phenylalanine = 'F',
140 glycine = 'G',
141 histidine = 'H',
142 isoleucine = 'I',
143 lysine = 'K',
144 leucine = 'L',
145 methionine = 'M',
146 asparagine = 'N',
147 proline = 'P',
148 glutamine = 'Q',
149 arginine = 'R',
150 serine = 'S',
151 threonine = 'T',
152 valine = 'V',
153 tryptophan = 'W',
154 tyrosine = 'Y',
155 selenocysteine = 'U',
156 pyrrolysine = 'O',
157};
158
159
160/** \def Data compression types
161 *
162 */
163enum class DataCompression : std::int8_t
164{
165 unset = -1, ///< not net
166 none = 0, ///< no compression
167 zlib = 1, ///< zlib compresssion
168};
169
170
171enum class DataKind : std::int8_t
172{
173 unset = -1, ///< not set
174 rt = 0, ///< Retention time
175 dt = 1, ///< Drift time
176 mz = 2, ///< m/z
177};
178
179
180enum class Axis : std::int8_t
181{
182 unset = 0x000,
183 x = 1 << 0,
184 y = 1 << 1,
185 z = 1 << 2,
186};
187
188
189enum class AxisScale : std::int8_t
190{
191 unset = 0,
192 orig = 1,
193 log10 = 2,
194};
195
196
197/** \def XixExtactMethod method to extract Xic
198 *
199 */
200enum class XicExtractMethod : std::int8_t
201{
202 sum = 1, ///< sum of intensities
203 max = 2 ///< maximum of intensities
204};
205
206
207/*********** Global variables definitions*********************************/
208
209/** \def MHPLUS 1.007276466879
210 \brief The (monoisotopic) mass of the H+ ion
211 https://en.wikipedia.org/wiki/Proton (One Proton alone)
212 1.007276466879
213 */
214const pappso_double MHPLUS(1.007276466879);
215const pappso_double MPROTON(1.007276466879);
216
217/** \def MPROTIUM 1.00782503207
218 \brief The (monoisotopic) mass of the H atom
219 https://en.wikipedia.org/wiki/Isotopes_of_hydrogen (One proton + One electron)
220 1.00782503207
221
222 Note that as of 20191028, that same page says: 1.007825032241
223 */
224const pappso_double MPROTIUM(1.007825032241);
225
226
227/** \def ONEMILLION 1000000
228 \brief One million integer, why not.
229 */
231
232
233/** @file
234 * https://forgemia.inra.fr/pappso/massxpert/-/blob/be60e53480f68d36afa95c809cffd68d4fb46c79/data/polChemDefs/protein-1-letter-libisospec-atomic-data/protein-1-letter-libisospec-atomic-data.xml
235 * abundance of sulfur extracted from 'massXpert' polymer definitions
236 */
237// <name>Sulfur</name>
238// <symbol>S</symbol>
239// <isotope>
240// <mass>31.9720711741</mass>
241// <abund>94.985001199904004920426814351230859756469726562500000000000000</abund>
242// </isotope>
243// <isotope>
244// <mass>32.9714589101</mass>
245// <abund>0.751939844812414937003097747947322204709053039550781250000000</abund>
246// </isotope>
247// <isotope>
248// <mass>33.9678670300</mass>
249// <abund>4.252059835213182203972337447339668869972229003906250000000000</abund>
250// </isotope>
251// <isotope>
252// <mass>35.9670812000</mass>
253// <abund>0.010999120070394368536836893213148869108408689498901367187500</abund>
254// </isotope>
255
256
257const pappso_double MASSOXYGEN(15.99491461956);
260const pappso_double MASSNITROGEN(14.0030740048);
263const pappso_double MASSPHOSPHORUS(30.973761998);
264const pappso_double MASSSULFUR(31.9720711741);
265
266// id: MOD:00696 name: phosphorylated residue H 1 O 3 P 1
269
270// Selenium : warning lot of isotopes
271const pappso_double MASSSELENIUM(79.916520); // 79.916520 //78.971
272
273// CHNOS
274
275/** \def DIFFC12C13 1.0033548378
276 \brief The (monoisotopic) mass difference between C12 (12u) and C13 stable
277 isotope of carbon
278 */
279const pappso_double DIFFC12C13(1.0033548378);
280
281/** \def DIFFS32S33 0.99938776
282 \brief The (monoisotopic) mass difference between S32 (31.97207100u) and S33
283 (32.97145876u) stable isotope of sulfur
284 https://en.wikipedia.org/wiki/Isotopes_of_sulfur
285 */
286const pappso_double DIFFS32S33(32.9714589101 - MASSSULFUR);
287
288/** \def DIFFS32S34 1.9957959
289 \brief The (monoisotopic) mass difference between S32 (31.97207100u) and S34
290 (33.96786690u) stable isotope of sulfur
291 */
292const pappso_double DIFFS32S34(33.9678670300 - MASSSULFUR);
293
294/** \def DIFFS32S36 3.99500976
295 \brief The (monoisotopic) mass difference between S32 (31.97207100u) and S36
296 (35.96708076u) stable isotope of sulfur
297 */
298const pappso_double DIFFS32S36(35.9670812000 - MASSSULFUR);
299
300
301/** \def DIFFH1H2
302 \brief The (monoisotopic) mass difference between H1 and H2 stable isotope of
303 hydrogen
304 */
305const pappso_double DIFFH1H2(2.0141017778 - MPROTIUM);
306
307/** \def DIFFO16O18
308 \brief The (monoisotopic) mass difference between O16 and O18 stable isotope of
309 oxygen
310 */
312
313/** \def DIFFO16O17
314 \brief The (monoisotopic) mass difference between O16 and O17 stable isotope of
315 oxygen
316 */
318
319/** \def DIFFN14N15
320 \brief The (monoisotopic) mass difference between N14 and N15 stable isotope of
321 nitrogen
322 */
323const pappso_double DIFFN14N15(15.0001088982 - MASSNITROGEN);
324
325
326// http://education.expasy.org/student_projects/isotopident/htdocs/motza.html
327/** \def ABUNDANCEH2 0.0156%
328 \brief H2 isotope abundance
329 */
330const pappso_double
331 ABUNDANCEH2(0.00011570983569203332000374651045149221317842602729797363281250);
332
333/** \def ABUNDANCEN15 0.00364
334 \brief N15 isotope abundance
335 */
337 0.00364198543205827118818262988497735932469367980957031250000000);
338
339/** \def ABUNDANCEO17
340 \brief O17 isotope abundance
341 */
343 0.00038099847600609595965615028489992255344986915588378906250000);
344
345/** \def ABUNDANCEO18 0.2%
346 \brief O18 isotope abundance
347 */
349 0.00205139179443282221315669744399201590567827224731445312500000);
350
351/** \def ABUNDANCEC13 1.109%
352 \brief C13 isotope abundance
353 */
355 0.01078805814953308406245469086570665240287780761718750000000000);
356
357/** \def ABUNDANCEC12 98.89%
358 \brief C12 abundance
359 */
361 0.98921194185046687152862432412803173065185546875000000000000000);
362
363
364/** \def ABUNDANCES33 0.00750
365 \brief S33 abundance
366 */
368 0.00751939844812414937003097747947322204709053039550781250000000);
369
370/** \def ABUNDANCES34 0.0429
371 \brief S34 abundance
372 */
374 0.04252059835213182203972337447339668869972229003906250000000000);
375
376/** \def ABUNDANCES36 0.00020
377 \brief S36 abundance
378 */
380 0.00010999120070394368536836893213148869108408689498901367187500);
381
382
383/** \brief PeptideIon enum defines all types of ions (Nter or Cter)
384 */
385enum class PeptideIon : std::int8_t
386{
387 b = 0, ///< Nter acylium ions
388 bstar = 1, ///< Nter acylium ions + NH3 loss
389 bo = 2, ///< Nter acylium ions + H2O loss
390 a = 3, ///< Nter aldimine ions
391 astar = 4, ///< Nter aldimine ions + NH3 loss
392 ao = 5, ///< Nter aldimine ions + H2O loss
393 bp = 6,
394 c = 7, ///< Nter amino ions
395 y = 8, ///< Cter amino ions
396 ystar = 9, ///< Cter amino ions + NH3 loss
397 yo = 10, ///< Cter amino ions + H2O loss
398 z = 11, ///< Cter carbocations
399 yp = 12,
400 x = 13 ///< Cter acylium ions
401};
402
403/** \brief only usefull for inernal usefull
404 * DO not change this value : it is used to define static array size
405 */
406#define PEPTIDE_ION_TYPE_COUNT 14
407} // namespace pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
const pappso_double MPROTON(1.007276466879)
const pappso_double ABUNDANCEC12(0.98921194185046687152862432412803173065185546875000000000000000)
PeptideIon
PeptideIon enum defines all types of ions (Nter or Cter)
Definition: types.h:386
AminoAcidChar
Definition: types.h:134
Axis
Definition: types.h:181
const pappso_double DIFFS32S33(32.9714589101 - MASSSULFUR)
PrecisionUnit
Definition: types.h:64
const pappso_double DIFFS32S34(33.9678670300 - MASSSULFUR)
MzFormat
Definition: types.h:108
@ unknown
unknown format
@ SQLite3
SQLite3 format.
@ MGF
Mascot format.
const pappso_double DIFFO16O17(16.99913150 - MASSOXYGEN)
const pappso_double MASSCARBON(12)
const pappso_double MASSPHOSPHORUS(30.973761998)
const pappso_double MASSSULFUR(31.9720711741)
const pappso_double ABUNDANCES36(0.00010999120070394368536836893213148869108408689498901367187500)
QString PeptideStr
A type definition for PeptideStr.
Definition: types.h:44
DataCompression
Definition: types.h:164
@ zlib
zlib compresssion
const pappso_double MASSCO(MASSCARBON+MASSOXYGEN)
const pappso_double ONEMILLION(1000000)
const pappso_double ABUNDANCEN15(0.00364198543205827118818262988497735932469367980957031250000000)
const pappso_double DIFFS32S36(35.9670812000 - MASSSULFUR)
const pappso_double MASSSELENIUM(79.916520)
const pappso_double MHPLUS(1.007276466879)
AtomIsotopeSurvey
Definition: types.h:77
double pappso_double
A type definition for doubles.
Definition: types.h:49
Isotope
Definition: types.h:92
AxisScale
Definition: types.h:190
const pappso_double ABUNDANCEC13(0.01078805814953308406245469086570665240287780761718750000000000)
const pappso_double MPROTIUM(1.007825032241)
const pappso_double MASSH2O((MPROTIUM *2)+MASSOXYGEN)
const pappso_double ABUNDANCEO17(0.00038099847600609595965615028489992255344986915588378906250000)
const pappso_double ABUNDANCEH2(0.00011570983569203332000374651045149221317842602729797363281250)
DataKind
Definition: types.h:172
@ dt
Drift time.
@ rt
Retention time.
const pappso_double MASSNH3((MPROTIUM *3)+MASSNITROGEN)
unsigned int uint
Definition: types.h:56
const pappso_double ABUNDANCES34(0.04252059835213182203972337447339668869972229003906250000000000)
const pappso_double MASSNITROGEN(14.0030740048)
const pappso_double MASSOXYGEN(15.99491461956)
const pappso_double MASSPHOSPHORYLATEDR(MPROTIUM+(MASSOXYGEN *3)+MASSPHOSPHORUS)
const pappso_double ABUNDANCEO18(0.00205139179443282221315669744399201590567827224731445312500000)
const pappso_double DIFFO16O18(17.9991610 - MASSOXYGEN)
const pappso_double ABUNDANCES33(0.00751939844812414937003097747947322204709053039550781250000000)
const pappso_double DIFFN14N15(15.0001088982 - MASSNITROGEN)
XicExtractMethod
Definition: types.h:201
@ sum
sum of intensities
@ max
maximum of intensities
const pappso_double DIFFC12C13(1.0033548378)
float pappso_float
Definition: types.h:54
const pappso_double DIFFH1H2(2.0141017778 - MPROTIUM)