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 
36 namespace pappso
37 {
38 /************ Typedefs **************************************************/
39 
40 /** \var typedef QString PeptideStr
41  \brief A type definition for PeptideStr
42  */
43 typedef QString PeptideStr;
44 
45 /** \var typedef double pappso_double
46  \brief A type definition for doubles
47  */
48 typedef double pappso_double;
49 
50 /** \var typedef float mcq_float
51  \brief A type definition for floats
52  */
53 typedef float pappso_float;
54 
55 typedef unsigned int uint;
56 
57 /*********** enumerations *********************************/
58 
59 /** \def PrecisionUnit ppm or dalton
60  *
61  */
62 enum class PrecisionUnit
63 {
65  dalton,
66  ppm,
67  res,
68  mz,
70 };
71 
72 /** \def AtomIsotopeSurvey list of atoms on which isotopes may occurs
73  *
74  */
75 enum class AtomIsotopeSurvey : std::int8_t
76 {
77  C,
78  H,
79  O,
80  N,
81  S,
82  last
83 };
84 
85 
86 /** \def Isotope list of isotopes taken into account for peptide abundance
87  * calculation
88  *
89  */
90 enum class Isotope
91 {
92  C13,
93  H2,
94  O17,
95  O18,
96  N15,
97  S33,
98  S34,
99  S36
100 };
101 
102 
103 /** \def MzFormat mz data file format types
104  *
105  */
106 enum class MzFormat : std::int8_t
107 {
108  unknown = 0, ///< unknown format
109  mzML = 1, ///< mzML
110  mzXML = 2, ///< mzXML
111  MGF = 3, ///< Mascot format
112  SQLite3 = 4, ///< SQLite3 format
113  xy = 5, ///< (x,y) format
114  mz5 = 6, //< MZ5 format
115  msn = 7, //< MS_MS2 format
116  abSciexWiff = 8,
117  abSciexT2D = 9,
118  agilentMassHunter = 10,
119  thermoRaw = 11,
120  watersRaw = 12,
121  brukerFid = 13,
122  brukerYep = 14,
123  brukerBaf = 15,
124  brukerTims = 16,
125  last = 17
126 };
127 
128 
129 /** \def MzFormat mz data file format types
130  *
131  */
132 enum class AminoAcidChar : char
133 {
134  alanine = 'A',
135  cysteine = 'C',
136  aspartic_acid = 'D',
137  glutamic_acid = 'E',
138  phenylalanine = 'F',
139  glycine = 'G',
140  histidine = 'H',
141  isoleucine = 'I',
142  lysine = 'K',
143  leucine = 'L',
144  methionine = 'M',
145  asparagine = 'N',
146  proline = 'P',
147  glutamine = 'Q',
148  arginine = 'R',
149  serine = 'S',
150  threonine = 'T',
151  valine = 'V',
152  tryptophan = 'W',
153  tyrosine = 'Y',
154  selenocysteine = 'U',
155  pyrrolysine = 'O',
156 };
157 
158 
159 /** \def Data compression types
160  *
161  */
162 enum class DataCompression : std::int8_t
163 {
164  unset = -1, ///< not net
165  none = 0, ///< no compression
166  zlib = 1, ///< zlib compresssion
167 };
168 
169 
170 enum class DataKind : std::int8_t
171 {
172  unset = -1, ///< not set
173  rt = 0, ///< Retention time
174  dt = 1, ///< Drift time
175  mz = 2, ///< m/z
176 };
177 
178 
179 enum class Axis : std::int8_t
180 {
181  unset = 0,
182  x = 1,
183  y = 2,
184  z = 3,
185 };
186 
187 
188 enum class AxisScale : std::int8_t
189 {
190  unset = 0,
191  orig = 1,
192  log10 = 2,
193 };
194 
195 
196 /** \def XixExtactMethod method to extract Xic
197  *
198  */
199 enum class XicExtractMethod : std::int8_t
200 {
201  sum = 1, ///< sum of intensities
202  max = 2 ///< maximum of intensities
203 };
204 
205 
206 /*********** Global variables definitions*********************************/
207 
208 /** \def MHPLUS 1.007276466879
209  \brief The (monoisotopic) mass of the H+ ion
210  https://en.wikipedia.org/wiki/Proton (One Proton alone)
211  1.007276466879
212  */
213 const pappso_double MHPLUS(1.007276466879);
214 const pappso_double MPROTON(1.007276466879);
215 
216 /** \def MPROTIUM 1.00782503207
217  \brief The (monoisotopic) mass of the H atom
218  https://en.wikipedia.org/wiki/Isotopes_of_hydrogen (One proton + One electron)
219  1.00782503207
220 
221  Note that as of 20191028, that same page says: 1.007825032241
222  */
223 const pappso_double MPROTIUM(1.007825032241);
224 
225 
226 /** \def ONEMILLION 1000000
227  \brief One million integer, why not.
228  */
229 const pappso_double ONEMILLION(1000000);
230 
231 
232 const pappso_double MASSOXYGEN(15.99491461956);
233 const pappso_double MASSCARBON(12);
235 const pappso_double MASSNITROGEN(14.0030740048);
238 const pappso_double MASSPHOSPHORUS(30.973761998);
239 const pappso_double MASSSULFUR(31.97207100);
240 
241 // id: MOD:00696 name: phosphorylated residue H 1 O 3 P 1
244 
245 // Selenium : warning lot of isotopes
246 const pappso_double MASSSELENIUM(79.916520); // 79.916520 //78.971
247 
248 // CHNOS
249 
250 /** \def DIFFC12C13 1.0033548378
251  \brief The (monoisotopic) mass difference between C12 (12u) and C13 stable
252  isotope of carbon
253  */
254 const pappso_double DIFFC12C13(1.0033548378);
255 
256 /** \def DIFFS32S33 0.99938776
257  \brief The (monoisotopic) mass difference between S32 (31.97207100u) and S33
258  (32.97145876u) stable isotope of sulfur
259  https://en.wikipedia.org/wiki/Isotopes_of_sulfur
260  */
261 const pappso_double DIFFS32S33(32.97145876 - MASSSULFUR);
262 
263 /** \def DIFFS32S34 1.9957959
264  \brief The (monoisotopic) mass difference between S32 (31.97207100u) and S34
265  (33.96786690u) stable isotope of sulfur
266  */
267 const pappso_double DIFFS32S34(33.96786690 - MASSSULFUR);
268 
269 /** \def DIFFS32S36 3.99500976
270  \brief The (monoisotopic) mass difference between S32 (31.97207100u) and S36
271  (35.96708076u) stable isotope of sulfur
272  */
273 const pappso_double DIFFS32S36(35.96708076 - MASSSULFUR);
274 
275 
276 /** \def DIFFH1H2
277  \brief The (monoisotopic) mass difference between H1 and H2 stable isotope of
278  hydrogen
279  */
280 const pappso_double DIFFH1H2(2.0141017778 - MPROTIUM);
281 
282 /** \def DIFFO16O18
283  \brief The (monoisotopic) mass difference between O16 and O18 stable isotope of
284  oxygen
285  */
286 const pappso_double DIFFO16O18(17.9991610 - MASSOXYGEN);
287 
288 /** \def DIFFO16O17
289  \brief The (monoisotopic) mass difference between O16 and O17 stable isotope of
290  oxygen
291  */
292 const pappso_double DIFFO16O17(16.99913150 - MASSOXYGEN);
293 
294 /** \def DIFFN14N15
295  \brief The (monoisotopic) mass difference between N14 and N15 stable isotope of
296  nitrogen
297  */
298 const pappso_double DIFFN14N15(15.0001088982 - MASSNITROGEN);
299 
300 
301 // http://education.expasy.org/student_projects/isotopident/htdocs/motza.html
302 /** \def ABUNDANCEH2 0.0156%
303  \brief H2 isotope abundance
304  */
305 const pappso_double ABUNDANCEH2(0.00015574);
306 
307 /** \def ABUNDANCEN15 0.00364
308  \brief N15 isotope abundance
309  */
310 const pappso_double ABUNDANCEN15(0.003663);
311 
312 /** \def ABUNDANCEO17
313  \brief O17 isotope abundance
314  */
315 const pappso_double ABUNDANCEO17(0.000372);
316 
317 /** \def ABUNDANCEO18 0.2%
318  \brief O18 isotope abundance
319  */
320 const pappso_double ABUNDANCEO18(0.0020004);
321 
322 /** \def ABUNDANCEC13 1.109%
323  \brief C13 isotope abundance
324  */
325 const pappso_double ABUNDANCEC13(0.011078);
326 
327 /** \def ABUNDANCEC12 98.89%
328  \brief C12 abundance
329  */
330 const pappso_double ABUNDANCEC12(0.988922);
331 
332 /** \def ABUNDANCES33 0.00750
333  \brief S33 abundance
334  */
335 const pappso_double ABUNDANCES33(0.00750);
336 
337 /** \def ABUNDANCES34 0.0429
338  \brief S34 abundance
339  */
340 const pappso_double ABUNDANCES34(0.04215);
341 
342 /** \def ABUNDANCES36 0.00020
343  \brief S36 abundance
344  */
345 const pappso_double ABUNDANCES36(0.00020);
346 
347 
348 /** \brief PeptideIon enum defines all types of ions (Nter or Cter)
349  */
350 enum class PeptideIon : std::int8_t
351 {
352  b = 0, ///< Nter acylium ions
353  bstar = 1, ///< Nter acylium ions + NH3 loss
354  bo = 2, ///< Nter acylium ions + H2O loss
355  a = 3, ///< Nter aldimine ions
356  astar = 4, ///< Nter aldimine ions + NH3 loss
357  ao = 5, ///< Nter aldimine ions + H2O loss
358  bp = 6,
359  c = 7, ///< Nter amino ions
360  y = 8, ///< Cter amino ions
361  ystar = 9, ///< Cter amino ions + NH3 loss
362  yo = 10, ///< Cter amino ions + H2O loss
363  z = 11, ///< Cter carbocations
364  yp = 12,
365  x = 13 ///< Cter acylium ions
366 };
367 
368 /** \brief only usefull for inernal usefull
369  * DO not change this value : it is used to define static array size
370  */
371 #define PEPTIDE_ION_TYPE_COUNT 14
372 } // namespace pappso
pappso::AminoAcidChar::glycine
@ glycine
pappso::PeptideIon::b
@ b
Nter acylium ions.
pappso::DataCompression::zlib
@ zlib
zlib compresssion
pappso::AtomIsotopeSurvey::S
@ S
pappso::MzFormat::agilentMassHunter
@ agilentMassHunter
pappso::PeptideIon::a
@ a
Nter aldimine ions.
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:69
pappso::MzFormat::last
@ last
pappso::MzFormat::brukerTims
@ brukerTims
pappso::Isotope::H2
@ H2
pappso::MHPLUS
const pappso_double MHPLUS(1.007276466879)
pappso::MASSSELENIUM
const pappso_double MASSSELENIUM(79.916520)
pappso::ABUNDANCEC12
const pappso_double ABUNDANCEC12(0.988922)
pappso::MzFormat::thermoRaw
@ thermoRaw
pappso::PrecisionUnit::last
@ last
pappso::AminoAcidChar::glutamine
@ glutamine
pappso::ABUNDANCEO17
const pappso_double ABUNDANCEO17(0.000372)
pappso::AminoAcidChar::alanine
@ alanine
pappso::ABUNDANCES36
const pappso_double ABUNDANCES36(0.00020)
pappso::Isotope::S36
@ S36
pappso::AminoAcidChar::lysine
@ lysine
pappso::ABUNDANCES33
const pappso_double ABUNDANCES33(0.00750)
pappso::PeptideIon::yo
@ yo
Cter amino ions + H2O loss.
pappso::PeptideIon::astar
@ astar
Nter aldimine ions + NH3 loss.
pappso::PrecisionUnit::dalton
@ dalton
pappso::AminoAcidChar::proline
@ proline
pappso::ABUNDANCEH2
const pappso_double ABUNDANCEH2(0.00015574)
pappso::MASSCARBON
const pappso_double MASSCARBON(12)
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
pappso::DataKind
DataKind
Definition: types.h:192
pappso::AxisScale::unset
@ unset
pappso::DIFFN14N15
const pappso_double DIFFN14N15(15.0001088982 - MASSNITROGEN)
pappso::Isotope
Isotope
Definition: types.h:112
pappso::pappso_float
float pappso_float
Definition: types.h:74
pappso::DIFFH1H2
const pappso_double DIFFH1H2(2.0141017778 - MPROTIUM)
pappso::PeptideStr
QString PeptideStr
A type definition for PeptideStr.
Definition: types.h:64
pappso::ONEMILLION
const pappso_double ONEMILLION(1000000)
pappso::DataKind::mz
@ mz
m/z
pappso::ABUNDANCEN15
const pappso_double ABUNDANCEN15(0.003663)
pappso::MzFormat::brukerYep
@ brukerYep
pappso::Isotope::N15
@ N15
pappso::PeptideIon::x
@ x
Cter acylium ions.
pappso::AminoAcidChar::aspartic_acid
@ aspartic_acid
pappso::DataKind::rt
@ rt
Retention time.
pappso::AxisScale
AxisScale
Definition: types.h:210
pappso::MzFormat::SQLite3
@ SQLite3
SQLite3 format.
pappso::PeptideIon::bstar
@ bstar
Nter acylium ions + NH3 loss.
pappso::AminoAcidChar::glutamic_acid
@ glutamic_acid
pappso::MzFormat::abSciexT2D
@ abSciexT2D
pappso::DIFFS32S33
const pappso_double DIFFS32S33(32.97145876 - MASSSULFUR)
pappso::AminoAcidChar::selenocysteine
@ selenocysteine
pappso::PeptideIon
PeptideIon
PeptideIon enum defines all types of ions (Nter or Cter)
Definition: types.h:372
pappso::AminoAcidChar
AminoAcidChar
Definition: types.h:154
pappso::PrecisionUnit::none
@ none
pappso::Axis::z
@ z
pappso::MASSNH3
const pappso_double MASSNH3((MPROTIUM *3)+MASSNITROGEN)
pappso::MPROTON
const pappso_double MPROTON(1.007276466879)
pappso::MzFormat::unknown
@ unknown
unknown format
pappso::Axis
Axis
Definition: types.h:201
pappso::MASSPHOSPHORUS
const pappso_double MASSPHOSPHORUS(30.973761998)
pappso::AminoAcidChar::serine
@ serine
pappso::AminoAcidChar::isoleucine
@ isoleucine
pappso::MzFormat::mzXML
@ mzXML
mzXML
pappso::PrecisionUnit::res
@ res
pappso::Isotope::O17
@ O17
pappso::AminoAcidChar::methionine
@ methionine
pappso::AtomIsotopeSurvey::H
@ H
pappso::AminoAcidChar::threonine
@ threonine
pappso::uint
unsigned int uint
Definition: types.h:76
pappso::DataCompression::unset
@ unset
not net
pappso::XicExtractMethod
XicExtractMethod
Definition: types.h:221
pappso::MASSPHOSPHORYLATEDR
const pappso_double MASSPHOSPHORYLATEDR(MPROTIUM+(MASSOXYGEN *3)+MASSPHOSPHORUS)
pappso::DIFFS32S34
const pappso_double DIFFS32S34(33.96786690 - MASSSULFUR)
pappso::PrecisionUnit::ppm
@ ppm
pappso::AminoAcidChar::leucine
@ leucine
pappso::DataCompression::none
@ none
no compression
pappso::AminoAcidChar::asparagine
@ asparagine
pappso::MASSCO
const pappso_double MASSCO(MASSCARBON+MASSOXYGEN)
pappso::MzFormat::xy
@ xy
(x,y) format
pappso::MzFormat::mz5
@ mz5
pappso::MzFormat::msn
@ msn
pappso::Isotope::S34
@ S34
pappso::DIFFC12C13
const pappso_double DIFFC12C13(1.0033548378)
pappso::Axis::y
@ y
pappso::AminoAcidChar::phenylalanine
@ phenylalanine
pappso::AminoAcidChar::histidine
@ histidine
pappso::PeptideIon::bo
@ bo
Nter acylium ions + H2O loss.
pappso::MzFormat::abSciexWiff
@ abSciexWiff
pappso::PeptideIon::bp
@ bp
pappso::AxisScale::orig
@ orig
pappso::AminoAcidChar::pyrrolysine
@ pyrrolysine
pappso::MzFormat::brukerFid
@ brukerFid
pappso::XicExtractMethod::max
@ max
maximum of intensities
pappso::DIFFS32S36
const pappso_double DIFFS32S36(35.96708076 - MASSSULFUR)
pappso::AminoAcidChar::tyrosine
@ tyrosine
pappso::Axis::x
@ x
pappso::PrecisionUnit
PrecisionUnit
Definition: types.h:84
pappso::PeptideIon::z
@ z
Cter carbocations.
pappso::PeptideIon::ao
@ ao
Nter aldimine ions + H2O loss.
pappso::ABUNDANCES34
const pappso_double ABUNDANCES34(0.04215)
pappso::ABUNDANCEC13
const pappso_double ABUNDANCEC13(0.011078)
pappso::AtomIsotopeSurvey::last
@ last
pappso::AminoAcidChar::arginine
@ arginine
pappso::XicExtractMethod::sum
@ sum
sum of intensities
pappso::MASSSULFUR
const pappso_double MASSSULFUR(31.97207100)
pappso::AtomIsotopeSurvey::C
@ C
pappso::Isotope::C13
@ C13
pappso::AtomIsotopeSurvey::N
@ N
pappso::AminoAcidChar::valine
@ valine
pappso::DataKind::unset
@ unset
not set
pappso::PeptideIon::c
@ c
Nter amino ions.
pappso::PeptideIon::yp
@ yp
pappso::PrecisionUnit::mz
@ mz
pappso::AxisScale::log10
@ log10
pappso::MzFormat::brukerBaf
@ brukerBaf
pappso::DataKind::dt
@ dt
Drift time.
pappso::AminoAcidChar::cysteine
@ cysteine
pappso::Axis::unset
@ unset
pappso::MASSH2O
const pappso_double MASSH2O((MPROTIUM *2)+MASSOXYGEN)
pappso::MASSOXYGEN
const pappso_double MASSOXYGEN(15.99491461956)
pappso::Isotope::O18
@ O18
pappso::PeptideIon::y
@ y
Cter amino ions.
pappso::MzFormat::mzML
@ mzML
mzML
pappso::MPROTIUM
const pappso_double MPROTIUM(1.007825032241)
pappso::MASSNITROGEN
const pappso_double MASSNITROGEN(14.0030740048)
pappso::DIFFO16O17
const pappso_double DIFFO16O17(16.99913150 - MASSOXYGEN)
pappso::MzFormat
MzFormat
Definition: types.h:128
pappso::PeptideIon::ystar
@ ystar
Cter amino ions + NH3 loss.
pappso::ABUNDANCEO18
const pappso_double ABUNDANCEO18(0.0020004)
pappso::MzFormat::watersRaw
@ watersRaw
pappso::DIFFO16O18
const pappso_double DIFFO16O18(17.9991610 - MASSOXYGEN)
pappso::AtomIsotopeSurvey
AtomIsotopeSurvey
Definition: types.h:97
pappso::MzFormat::MGF
@ MGF
Mascot format.
pappso::AminoAcidChar::tryptophan
@ tryptophan
pappso::AtomIsotopeSurvey::O
@ O
pappso::Isotope::S33
@ S33
pappso::DataCompression
DataCompression
Definition: types.h:184