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 {
64  none,
65  dalton,
66  ppm,
67  res,
68  mz,
69  last
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 /** \def XixExtactMethod method to extract Xic
180  *
181  */
182 enum class XicExtractMethod : std::int8_t
183 {
184  sum = 1, ///< sum of intensities
185  max = 2 ///< maximum of intensities
186 };
187 
188 
189 /*********** Global variables definitions*********************************/
190 
191 /** \def MHPLUS 1.007276466879
192  \brief The (monoisotopic) mass of the H+ ion
193  https://en.wikipedia.org/wiki/Proton (One Proton alone)
194  1.007276466879
195  */
196 const pappso_double MHPLUS(1.007276466879);
197 const pappso_double MPROTON(1.007276466879);
198 
199 /** \def MPROTIUM 1.00782503207
200  \brief The (monoisotopic) mass of the H atom
201  https://en.wikipedia.org/wiki/Isotopes_of_hydrogen (One proton + One electron)
202  1.00782503207
203 
204  Note that as of 20191028, that same page says: 1.007825032241
205  */
206 const pappso_double MPROTIUM(1.007825032241);
207 
208 
209 /** \def ONEMILLION 1000000
210  \brief One million integer, why not.
211  */
212 const pappso_double ONEMILLION(1000000);
213 
214 
215 const pappso_double MASSOXYGEN(15.99491461956);
218 const pappso_double MASSNITROGEN(14.0030740048);
221 const pappso_double MASSPHOSPHORUS(30.973761998);
222 const pappso_double MASSSULFUR(31.97207100);
223 
224 // id: MOD:00696 name: phosphorylated residue H 1 O 3 P 1
227 
228 // Selenium : warning lot of isotopes
229 const pappso_double MASSSELENIUM(79.916520); // 79.916520 //78.971
230 
231 // CHNOS
232 
233 /** \def DIFFC12C13 1.0033548378
234  \brief The (monoisotopic) mass difference between C12 (12u) and C13 stable
235  isotope of carbon
236  */
237 const pappso_double DIFFC12C13(1.0033548378);
238 
239 /** \def DIFFS32S33 0.99938776
240  \brief The (monoisotopic) mass difference between S32 (31.97207100u) and S33
241  (32.97145876u) stable isotope of sulfur
242  https://en.wikipedia.org/wiki/Isotopes_of_sulfur
243  */
244 const pappso_double DIFFS32S33(32.97145876 - MASSSULFUR);
245 
246 /** \def DIFFS32S34 1.9957959
247  \brief The (monoisotopic) mass difference between S32 (31.97207100u) and S34
248  (33.96786690u) stable isotope of sulfur
249  */
250 const pappso_double DIFFS32S34(33.96786690 - MASSSULFUR);
251 
252 /** \def DIFFS32S36 3.99500976
253  \brief The (monoisotopic) mass difference between S32 (31.97207100u) and S36
254  (35.96708076u) stable isotope of sulfur
255  */
256 const pappso_double DIFFS32S36(35.96708076 - MASSSULFUR);
257 
258 
259 /** \def DIFFH1H2
260  \brief The (monoisotopic) mass difference between H1 and H2 stable isotope of
261  hydrogen
262  */
263 const pappso_double DIFFH1H2(2.0141017778 - MPROTIUM);
264 
265 /** \def DIFFO16O18
266  \brief The (monoisotopic) mass difference between O16 and O18 stable isotope of
267  oxygen
268  */
269 const pappso_double DIFFO16O18(17.9991610 - MASSOXYGEN);
270 
271 /** \def DIFFO16O17
272  \brief The (monoisotopic) mass difference between O16 and O17 stable isotope of
273  oxygen
274  */
275 const pappso_double DIFFO16O17(16.99913150 - MASSOXYGEN);
276 
277 /** \def DIFFN14N15
278  \brief The (monoisotopic) mass difference between N14 and N15 stable isotope of
279  nitrogen
280  */
281 const pappso_double DIFFN14N15(15.0001088982 - MASSNITROGEN);
282 
283 
284 // http://education.expasy.org/student_projects/isotopident/htdocs/motza.html
285 /** \def ABUNDANCEH2 0.0156%
286  \brief H2 isotope abundance
287  */
288 const pappso_double ABUNDANCEH2(0.00015574);
289 
290 /** \def ABUNDANCEN15 0.00364
291  \brief N15 isotope abundance
292  */
293 const pappso_double ABUNDANCEN15(0.003663);
294 
295 /** \def ABUNDANCEO17
296  \brief O17 isotope abundance
297  */
298 const pappso_double ABUNDANCEO17(0.000372);
299 
300 /** \def ABUNDANCEO18 0.2%
301  \brief O18 isotope abundance
302  */
303 const pappso_double ABUNDANCEO18(0.0020004);
304 
305 /** \def ABUNDANCEC13 1.109%
306  \brief C13 isotope abundance
307  */
308 const pappso_double ABUNDANCEC13(0.011078);
309 
310 /** \def ABUNDANCEC12 98.89%
311  \brief C12 abundance
312  */
313 const pappso_double ABUNDANCEC12(0.988922);
314 
315 /** \def ABUNDANCES33 0.00750
316  \brief S33 abundance
317  */
319 
320 /** \def ABUNDANCES34 0.0429
321  \brief S34 abundance
322  */
324 
325 /** \def ABUNDANCES36 0.00020
326  \brief S36 abundance
327  */
329 
330 
331 /** \brief PeptideIon enum defines all types of ions (Nter or Cter)
332  */
333 enum class PeptideIon : std::int8_t
334 {
335  b = 0, ///< Nter acylium ions
336  bstar = 1, ///< Nter acylium ions + NH3 loss
337  bo = 2, ///< Nter acylium ions + H2O loss
338  a = 3, ///< Nter aldimine ions
339  astar = 4, ///< Nter aldimine ions + NH3 loss
340  ao = 5, ///< Nter aldimine ions + H2O loss
341  bp = 6,
342  c = 7, ///< Nter amino ions
343  y = 8, ///< Cter amino ions
344  ystar = 9, ///< Cter amino ions + NH3 loss
345  yo = 10, ///< Cter amino ions + H2O loss
346  z = 11, ///< Cter carbocations
347  yp = 12,
348  x = 13 ///< Cter acylium ions
349 };
350 
351 /** \brief only usefull for inernal usefull
352  * DO not change this value : it is used to define static array size
353  */
354 #define PEPTIDE_ION_TYPE_COUNT 14
355 } // namespace pappso
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:48
pappso::MzFormat::last
@ last
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::PrecisionUnit::last
@ last
pappso::ABUNDANCEO17
const pappso_double ABUNDANCEO17(0.000372)
pappso::AminoAcidChar::alanine
@ alanine
pappso::ABUNDANCES36
const pappso_double ABUNDANCES36(0.00020)
pappso::ABUNDANCES33
const pappso_double ABUNDANCES33(0.00750)
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
Definition: aa.cpp:39
pappso::DataKind
DataKind
Definition: types.h:171
pappso::DIFFN14N15
const pappso_double DIFFN14N15(15.0001088982 - MASSNITROGEN)
pappso::Isotope
Isotope
Definition: types.h:91
pappso::pappso_float
float pappso_float
Definition: types.h:53
pappso::DIFFH1H2
const pappso_double DIFFH1H2(2.0141017778 - MPROTIUM)
pappso::PeptideStr
QString PeptideStr
A type definition for PeptideStr.
Definition: types.h:43
pappso::ONEMILLION
const pappso_double ONEMILLION(1000000)
pappso::DataKind::mz
@ mz
m/z
pappso::ABUNDANCEN15
const pappso_double ABUNDANCEN15(0.003663)
pappso::PeptideIon::x
@ x
Cter acylium ions.
pappso::DataKind::rt
@ rt
Retention time.
pappso::DIFFS32S33
const pappso_double DIFFS32S33(32.97145876 - MASSSULFUR)
pappso::PeptideIon
PeptideIon
PeptideIon enum defines all types of ions (Nter or Cter)
Definition: types.h:334
pappso::AminoAcidChar
AminoAcidChar
Definition: types.h:133
pappso::MASSNH3
const pappso_double MASSNH3((MPROTIUM *3)+MASSNITROGEN)
pappso::MPROTON
const pappso_double MPROTON(1.007276466879)
pappso::MASSPHOSPHORUS
const pappso_double MASSPHOSPHORUS(30.973761998)
pappso::uint
unsigned int uint
Definition: types.h:55
pappso::DataCompression::unset
@ unset
not net
pappso::XicExtractMethod
XicExtractMethod
Definition: types.h:183
pappso::MASSPHOSPHORYLATEDR
const pappso_double MASSPHOSPHORYLATEDR(MPROTIUM+(MASSOXYGEN *3)+MASSPHOSPHORUS)
pappso::DIFFS32S34
const pappso_double DIFFS32S34(33.96786690 - MASSSULFUR)
pappso::MASSCO
const pappso_double MASSCO(MASSCARBON+MASSOXYGEN)
pappso::AtomIsotope::C
@ C
pappso::DIFFC12C13
const pappso_double DIFFC12C13(1.0033548378)
pappso::DIFFS32S36
const pappso_double DIFFS32S36(35.96708076 - MASSSULFUR)
pappso::PrecisionUnit
PrecisionUnit
Definition: types.h:63
pappso::ABUNDANCES34
const pappso_double ABUNDANCES34(0.04215)
pappso::ABUNDANCEC13
const pappso_double ABUNDANCEC13(0.011078)
pappso::AtomIsotopeSurvey::last
@ last
pappso::XicExtractMethod::sum
@ sum
sum of intensities
pappso::MASSSULFUR
const pappso_double MASSSULFUR(31.97207100)
pappso::Isotope::C13
@ C13
pappso::PeptideIonNter::b
@ b
pappso::PrecisionUnit::mz
@ mz
pappso::MASSH2O
const pappso_double MASSH2O((MPROTIUM *2)+MASSOXYGEN)
pappso::MASSOXYGEN
const pappso_double MASSOXYGEN(15.99491461956)
pappso::PeptideIon::y
@ y
Cter amino ions.
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:107
pappso::ABUNDANCEO18
const pappso_double ABUNDANCEO18(0.0020004)
pappso::DIFFO16O18
const pappso_double DIFFO16O18(17.9991610 - MASSOXYGEN)
pappso::AtomIsotopeSurvey
AtomIsotopeSurvey
Definition: types.h:76
pappso::DataCompression
DataCompression
Definition: types.h:163