pappsomspp
Library for mass spectrometry
qualifiedmassspectrum.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2015 Olivier Langella <olivier.langella@u-psud.fr>.
3  *
4  * This file is part of the PAPPSOms++ library.
5  *
6  * PAPPSOms++ is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * PAPPSOms++ is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
18  *
19  ******************************************************************************/
20 
21 #pragma once
22 
23 /////////////////////// StdLib includes
24 #include <memory>
25 
26 
27 /////////////////////// Qt includes
28 
29 
30 /////////////////////// Local includes
31 #include "../exportinmportconfig.h"
32 #include "../types.h"
33 #include "massspectrum.h"
34 #include "massspectrumid.h"
35 
36 
37 namespace pappso
38 {
39 
40 // Forward declaration.
41 class QualifiedMassSpectrum;
42 
43 typedef std::shared_ptr<QualifiedMassSpectrum> QualifiedMassSpectrumSPtr;
44 typedef std::shared_ptr<const QualifiedMassSpectrum>
46 
48 {
49 
50  OneOverK0, ///< 1/kO of a simple scan
51  OneOverK0begin, ///< 1/kO of first acquisition for composite pasef MS/MS
52  ///< spectrum
53  OneOverK0end, ///< 1/k0 of last acquisition for composite pasef MS/MS spectrum
54  IsolationMz, ///< isolation window
55  IsolationWidth, ///< isolation window width
56  CollisionEnergy, ///< Bruker's Tims tof collision energy
57  BrukerPrecursorIndex, ///< Bruker's Tims tof precursor index
58  last
59 };
60 
61 //! Class representing a fully specified mass spectrum.
62 /*!
63  * The member data that qualify the MassSpectrum \c msp_massSpectrum member
64  * allow to unambiguously characterize the mass spectrum.
65  * \sa MassSpectrum
66  */
68 {
69  public:
72  QualifiedMassSpectrum(MassSpectrumSPtr mass_spectrum_SPtr);
75 
76 
77  QualifiedMassSpectrumSPtr makeQualifiedMassSpectrumSPtr() const;
78  QualifiedMassSpectrumCstSPtr makeQualifiedMassSpectrumCstSPtr() const;
79 
80  void setMassSpectrumId(const MassSpectrumId &iD);
81  const MassSpectrumId &getMassSpectrumId() const;
82 
83  void setMassSpectrumSPtr(MassSpectrumSPtr massSpectrum);
84  MassSpectrumSPtr getMassSpectrumSPtr() const;
85  MassSpectrumCstSPtr getMassSpectrumCstSPtr() const;
86 
87  void setEmptyMassSpectrum(bool is_empty_mass_spectrum);
88  bool isEmptyMassSpectrum() const;
89 
90  void setPrecursorCharge(uint precursor_charge);
91  uint getPrecursorCharge() const;
92 
93  void setPrecursorMz(pappso_double precursor_mz);
94  pappso_double getPrecursorMz() const;
95 
96  void setMsLevel(uint ms_level);
97  uint getMsLevel() const;
98 
99  void setPrecursorSpectrumIndex(std::size_t precursor_scan_num);
100  std::size_t getPrecursorSpectrumIndex() const;
101 
102  void setPrecursorNativeId(const QString &native_id);
103  const QString &getPrecursorNativeId() const;
104 
105  void setRtInSeconds(pappso_double rt);
106  pappso_double getRtInSeconds() const;
107  pappso_double getRtInMinutes() const;
108 
109  void setDtInMilliSeconds(pappso_double rt);
110  pappso_double getDtInMilliSeconds() const;
111 
112  void setPrecursorIntensity(pappso_double intensity);
113  pappso_double getPrecursorIntensity() const;
114 
115  void setParameterValue(QualifiedMassSpectrumParameter parameter,
116  const QVariant &value);
117  const QVariant
118  getParameterValue(QualifiedMassSpectrumParameter parameter) const;
119 
120  std::size_t size() const;
121 
122  QString toString() const;
123 
124  protected:
125  //! Shared pointer to the mass spectrum.
126  MassSpectrumSPtr msp_massSpectrum = nullptr;
127 
128  //! Id of the mass spectrum.
129  MassSpectrumId m_massSpectrumId;
130 
131  bool m_isEmptyMassSpectrum = false;
132 
133  //! Mass spectrometry level of this mass spectrum.
134  unsigned int m_msLevel = 0;
135 
136  //! Retention time (in seconds) at which this mass spectrum was acquired.
137  pappso_double m_rt = -1;
138 
139  //! Drift time (in milliseconds) at which this mass spectrum was acquired.
140  pappso_double m_dt = -1;
141 
142  //! Index of the spectrum of the precusor ion that was fragmented to yield
143  // this mass spectrum.
144  std::size_t m_precursorSpectrumIndex =
145  std::numeric_limits<std::size_t>::max();
146 
147  //! Native XML id of the spectrum relative to the mz data native file
148  QString m_precursorNativeId;
149 
150  //! m/z ratio of the precursor that was fragmented to yield this mass
151  //! spectrum.
152  pappso_double m_precursorMz = std::numeric_limits<double>::max();
153 
154  //! Charge of the precursor that was fragmented to yield this mass spectrum.
155  unsigned int m_precursorCharge = std::numeric_limits<unsigned int>::max();
156 
157  //! Intensity of the precursor that was fragmented to yield this mass
158  //! spectrum.
159  pappso_double m_precursorIntensity = std::numeric_limits<double>::max();
160 
161  //! map containing any parameter value for this spectrum
162  std::map<QualifiedMassSpectrumParameter, QVariant> m_params;
163 };
164 
165 
166 } // namespace pappso
pappso::QualifiedMassSpectrumSPtr
std::shared_ptr< QualifiedMassSpectrum > QualifiedMassSpectrumSPtr
Definition: qualifiedmassspectrum.h:57
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:67
pappso::MassSpectrumCstSPtr
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
Definition: massspectrum.h:74
pappso::QualifiedMassSpectrumParameter::CollisionEnergy
Bruker's Tims tof collision energy.
pappso::QualifiedMassSpectrumParameter::OneOverK0end
1/k0 of last acquisition for composite pasef MS/MS spectrum
massspectrum.h
basic mass spectrum
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition: exportinmportconfig.h:12
pappso
Definition: aa.cpp:38
pappso::QualifiedMassSpectrumParameter::IsolationMz
isolation window
pappso::QualifiedMassSpectrumParameter::OneOverK0
1/kO of a simple scan
pappso::DataKind::rt
Retention time.
pappso::uint
unsigned int uint
Definition: types.h:74
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition: qualifiedmassspectrum.h:83
pappso::QualifiedMassSpectrumParameter
QualifiedMassSpectrumParameter
Definition: qualifiedmassspectrum.h:63
pappso::QualifiedMassSpectrumParameter::last
pappso::QualifiedMassSpectrumCstSPtr
std::shared_ptr< const QualifiedMassSpectrum > QualifiedMassSpectrumCstSPtr
Definition: qualifiedmassspectrum.h:61
massspectrumid.h
pappso::QualifiedMassSpectrumParameter::OneOverK0begin
pappso::MassSpectrumId
Definition: massspectrumid.h:56
pappso::QualifiedMassSpectrumParameter::IsolationWidth
isolation window width
pappso::QualifiedMassSpectrumParameter::BrukerPrecursorIndex
Bruker's Tims tof precursor index.
pappso::MassSpectrumSPtr
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
Definition: massspectrum.h:73