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