libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
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#include <cstdint>
36
37namespace pappso
38{
39
40/************ Typedefs **************************************************/
41
42/** \var typedef QString PeptideStr
43 \brief A type definition for PeptideStr
44 */
45typedef QString PeptideStr;
46
47/** \var typedef double pappso_double
48 \brief A type definition for doubles
49 */
50typedef double pappso_double;
51
52/** \var typedef float mcq_float
53 \brief A type definition for floats
54 */
55typedef float pappso_float;
56
57typedef unsigned int uint;
58
59/*********** enumerations *********************************/
60
61/** \def TimeUnit (s, min, h)
62 */
63enum class TimeUnit
64{
65 none,
66 s,
67 min,
68 h,
69};
70
71
72/** \def PrecisionUnit ppm or dalton
73 *
74 */
75enum class PrecisionUnit
76{
77 none,
78 dalton,
79 ppm,
80 res,
81 mz,
82 last
83};
84
85/** \def AtomIsotopeSurvey list of atoms on which isotopes may occurs
86 *
87 */
88enum class AtomIsotopeSurvey : std::int8_t
89{
90 C,
91 H,
92 O,
93 N,
94 S,
95 last
96};
97
98
99/** \def Isotope list of isotopes taken into account for peptide abundance
100 * calculation
101 *
102 */
103enum class Isotope
104{
105 C13,
106 H2,
107 O17,
108 O18,
109 N15,
110 S33,
111 S34,
112 S36
113};
114
115
116/** \def MzFormat mz data file format types
117 *
118 */
119enum class MsDataFormat : std::int8_t
120{
121 unknown = 0, ///< unknown format
122 mzML = 1, ///< mzML
123 mzXML = 2, ///< mzXML
124 MGF = 3, ///< Mascot format
125 SQLite3 = 4, ///< SQLite3 format
126 xy = 5, ///< (x,y) format
127 mz5 = 6, //< MZ5 format
128 msn = 7, //< MS_MS2 format
129 abSciexWiff = 8,
130 abSciexT2D = 9,
132 thermoRaw = 11,
133 watersRaw = 12,
134 brukerFid = 13,
135 brukerYep = 14,
136 brukerBaf = 15,
137 brukerTims = 16,
138 brukerBafAscii = 17, // Baf to ascii from Bruker software
139 last = 18
140};
141
142
143/** \def FileReaderType mass data file reader types
144 *
145 */
147{
148 pwiz, ///< using libpwizlite
149 xy,
150 bafascii,
151 tims, ///< TimsMsRunReader : each scan is returned as a mass spectrum
152 tims_frames, ///< TimsFramesMsRunReader : the whole frame is merged in a
153 ///< single spectrum
154 tims_ms2, ///< TimsMsRunReaderMs2 : Spectrum are delivered for each precursor
155 ///< (MS1 or MS2)
156
157 tims_dia, ///< TimsMsRunReaderDia : Spectrum are delivered for DIA window
158 ///< (slice)
159};
160
161
162/** \def AminoAcidChar Amino-acid full name and code correspondence
163 *
164 */
165enum class AminoAcidChar : char
166{
167 alanine = 'A',
168 cysteine = 'C',
169 aspartic_acid = 'D',
170 glutamic_acid = 'E',
171 phenylalanine = 'F',
172 glycine = 'G',
173 histidine = 'H',
174 isoleucine = 'I',
175 lysine = 'K',
176 leucine = 'L',
177 methionine = 'M',
178 asparagine = 'N',
179 proline = 'P',
180 glutamine = 'Q',
181 arginine = 'R',
182 serine = 'S',
183 threonine = 'T',
184 valine = 'V',
185 tryptophan = 'W',
186 tyrosine = 'Y',
187 selenocysteine = 'U',
188 pyrrolysine = 'O',
189};
190
191
192enum class SortType : std::int8_t
193{
194 no_sort = 0,
195 x = 1,
196 y = 2,
197};
198
199
200enum class SortOrder : std::int8_t
201{
202 ascending = 0,
203 descending = 1,
204};
205
206/** \def Data compression types
207 *
208 */
209enum class DataCompression : std::int8_t
210{
211 unset = -1, ///< not net
212 none = 0, ///< no compression
213 zlib = 1, ///< zlib compresssion
214};
215
216
217enum class DataKind : std::int8_t
218{
219 unset = -1, ///< not set
220 rt = 0, ///< Retention time
221 dt = 1, ///< Drift time
222 mz = 2, ///< m/z
223};
224
225
226enum class Axis : std::int8_t
227{
228 unset = 0x000,
229 x = 1 << 0,
230 y = 1 << 1,
231 z = 1 << 2,
232};
233
234
235enum class AxisScale : std::int8_t
236{
237 unset = 0,
238 orig = 1,
239 log10 = 2,
240};
241
242
243/** \def XixExtactMethod method to extract Xic
244 *
245 */
246enum class XicExtractMethod : std::int8_t
247{
248 sum = 1, ///< sum of intensities
249 max = 2 ///< maximum of intensities
250};
251
252
253/*********** Global variables definitions*********************************/
254
255/** \def MHPLUS 1.007276466879
256 \brief The (monoisotopic) mass of the H+ ion
257 https://en.wikipedia.org/wiki/Proton (One Proton alone)
258 1.007276466879
259 */
260const pappso_double MHPLUS(1.007276466879);
261const pappso_double MPROTON(1.007276466879);
262
263/** \def MPROTIUM 1.00782503207
264 \brief The (monoisotopic) mass of the H atom
265 https://en.wikipedia.org/wiki/Isotopes_of_hydrogen (One proton + One electron)
266 1.00782503207
267
268 Note that as of 20191028, that same page says: 1.007825032241
269 */
270const pappso_double MPROTIUM(1.007825032241);
271
272
273/** \def ONEMILLION 1000000
274 \brief One million integer, why not.
275 */
277
278
279/** @file
280 * https://forgemia.inra.fr/pappso/massxpert/-/blob/be60e53480f68d36afa95c809cffd68d4fb46c79/data/polChemDefs/protein-1-letter-libisospec-atomic-data/protein-1-letter-libisospec-atomic-data.xml
281 * abundance of sulfur extracted from 'massXpert' polymer definitions
282 */
283// <name>Sulfur</name>
284// <symbol>S</symbol>
285// <isotope>
286// <mass>31.9720711741</mass>
287// <abund>94.985001199904004920426814351230859756469726562500000000000000</abund>
288// </isotope>
289// <isotope>
290// <mass>32.9714589101</mass>
291// <abund>0.751939844812414937003097747947322204709053039550781250000000</abund>
292// </isotope>
293// <isotope>
294// <mass>33.9678670300</mass>
295// <abund>4.252059835213182203972337447339668869972229003906250000000000</abund>
296// </isotope>
297// <isotope>
298// <mass>35.9670812000</mass>
299// <abund>0.010999120070394368536836893213148869108408689498901367187500</abund>
300// </isotope>
301
302
303const pappso_double MASSOXYGEN(15.99491461956);
306const pappso_double MASSNITROGEN(14.0030740048);
309const pappso_double MASSPHOSPHORUS(30.973761998);
310const pappso_double MASSSULFUR(31.9720711741);
311
312// id: MOD:00696 name: phosphorylated residue H 1 O 3 P 1
315
316// Selenium : warning lot of isotopes
317const pappso_double MASSSELENIUM(79.916520); // 79.916520 //78.971
318
319// CHNOS
320
321/** \def DIFFC12C13 1.0033548378
322 \brief The (monoisotopic) mass difference between C12 (12u) and C13 stable
323 isotope of carbon
324 */
325const pappso_double DIFFC12C13(1.0033548378);
326
327/** \def DIFFS32S33 0.99938776
328 \brief The (monoisotopic) mass difference between S32 (31.97207100u) and S33
329 (32.97145876u) stable isotope of sulfur
330 https://en.wikipedia.org/wiki/Isotopes_of_sulfur
331 */
332const pappso_double DIFFS32S33(32.9714589101 - MASSSULFUR);
333
334/** \def DIFFS32S34 1.9957959
335 \brief The (monoisotopic) mass difference between S32 (31.97207100u) and S34
336 (33.96786690u) stable isotope of sulfur
337 */
338const pappso_double DIFFS32S34(33.9678670300 - MASSSULFUR);
339
340/** \def DIFFS32S36 3.99500976
341 \brief The (monoisotopic) mass difference between S32 (31.97207100u) and S36
342 (35.96708076u) stable isotope of sulfur
343 */
344const pappso_double DIFFS32S36(35.9670812000 - MASSSULFUR);
345
346
347/** \def DIFFH1H2
348 \brief The (monoisotopic) mass difference between H1 and H2 stable isotope of
349 hydrogen
350 */
351const pappso_double DIFFH1H2(2.0141017778 - MPROTIUM);
352
353/** \def DIFFO16O18
354 \brief The (monoisotopic) mass difference between O16 and O18 stable isotope of
355 oxygen
356 */
358
359/** \def DIFFO16O17
360 \brief The (monoisotopic) mass difference between O16 and O17 stable isotope of
361 oxygen
362 */
364
365/** \def DIFFN14N15
366 \brief The (monoisotopic) mass difference between N14 and N15 stable isotope of
367 nitrogen
368 */
369const pappso_double DIFFN14N15(15.0001088982 - MASSNITROGEN);
370
371
372// http://education.expasy.org/student_projects/isotopident/htdocs/motza.html
373/** \def ABUNDANCEH2 0.0156%
374 \brief H2 isotope abundance
375 */
376const pappso_double
377 ABUNDANCEH2(0.00011570983569203332000374651045149221317842602729797363281250);
378
379/** \def ABUNDANCEN15 0.00364
380 \brief N15 isotope abundance
381 */
383 0.00364198543205827118818262988497735932469367980957031250000000);
384
385/** \def ABUNDANCEO17
386 \brief O17 isotope abundance
387 */
389 0.00038099847600609595965615028489992255344986915588378906250000);
390
391/** \def ABUNDANCEO18 0.2%
392 \brief O18 isotope abundance
393 */
395 0.00205139179443282221315669744399201590567827224731445312500000);
396
397/** \def ABUNDANCEC13 1.109%
398 \brief C13 isotope abundance
399 */
401 0.01078805814953308406245469086570665240287780761718750000000000);
402
403/** \def ABUNDANCEC12 98.89%
404 \brief C12 abundance
405 */
407 0.98921194185046687152862432412803173065185546875000000000000000);
408
409
410/** \def ABUNDANCES33 0.00750
411 \brief S33 abundance
412 */
414 0.00751939844812414937003097747947322204709053039550781250000000);
415
416/** \def ABUNDANCES34 0.0429
417 \brief S34 abundance
418 */
420 0.04252059835213182203972337447339668869972229003906250000000000);
421
422/** \def ABUNDANCES36 0.00020
423 \brief S36 abundance
424 */
426 0.00010999120070394368536836893213148869108408689498901367187500);
427
428
429/** \brief PeptideIon enum defines all types of ions (Nter or Cter)
430 */
431enum class PeptideIon : std::int8_t
432{
433 b = 0, ///< Nter acylium ions
434 bstar = 1, ///< Nter acylium ions + NH3 loss
435 bo = 2, ///< Nter acylium ions + H2O loss
436 a = 3, ///< Nter aldimine ions
437 astar = 4, ///< Nter aldimine ions + NH3 loss
438 ao = 5, ///< Nter aldimine ions + H2O loss
439 bp = 6,
440 c = 7, ///< Nter amino ions
441 y = 8, ///< Cter amino ions
442 ystar = 9, ///< Cter amino ions + NH3 loss
443 yo = 10, ///< Cter amino ions + H2O loss
444 z = 11, ///< Cter carbocations
445 yp = 12,
446 x = 13 ///< Cter acylium ions
447};
448
449/** \brief only useful for internal use
450 * DO not change this value : it is used to define static array size
451 */
452#define PEPTIDE_ION_TYPE_COUNT 14
453} // 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:432
AminoAcidChar
Definition types.h:166
MsDataFormat
Definition types.h:120
@ xy
(x,y) format
@ unknown
unknown format
@ SQLite3
SQLite3 format.
@ MGF
Mascot format.
const pappso_double DIFFS32S33(32.9714589101 - MASSSULFUR)
PrecisionUnit
Definition types.h:76
const pappso_double DIFFS32S34(33.9678670300 - MASSSULFUR)
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:45
DataCompression
Definition types.h:210
@ 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:89
double pappso_double
A type definition for doubles.
Definition types.h:50
Isotope
Definition types.h:104
AxisScale
Definition types.h:236
SortType
Definition types.h:193
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:218
@ dt
Drift time.
@ rt
Retention time.
const pappso_double MASSNH3((MPROTIUM *3)+MASSNITROGEN)
unsigned int uint
Definition types.h:57
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)
FileReaderType
Definition types.h:147
@ pwiz
using libpwizlite
@ tims
TimsMsRunReader : each scan is returned as a mass spectrum.
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)
TimeUnit
Definition types.h:64
XicExtractMethod
Definition types.h:247
@ sum
sum of intensities
@ max
maximum of intensities
const pappso_double DIFFC12C13(1.0033548378)
float pappso_float
Definition types.h:55
SortOrder
Definition types.h:201
const pappso_double DIFFH1H2(2.0141017778 - MPROTIUM)