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