libpappsomspp
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  QualifiedMassSpectrum &operator=(const QualifiedMassSpectrum &other);
77 
78 
79  QualifiedMassSpectrumSPtr makeQualifiedMassSpectrumSPtr() const;
80  QualifiedMassSpectrumCstSPtr makeQualifiedMassSpectrumCstSPtr() const;
81 
82  void setMassSpectrumId(const MassSpectrumId &iD);
83  const MassSpectrumId &getMassSpectrumId() const;
84 
85  void setMassSpectrumSPtr(MassSpectrumSPtr massSpectrum);
86  MassSpectrumSPtr getMassSpectrumSPtr() const;
87  MassSpectrumCstSPtr getMassSpectrumCstSPtr() const;
88 
89  void setEmptyMassSpectrum(bool is_empty_mass_spectrum);
90  bool isEmptyMassSpectrum() const;
91 
92  void setPrecursorCharge(uint precursor_charge);
93  uint getPrecursorCharge() const;
94 
95  void setPrecursorMz(pappso_double precursor_mz);
96  pappso_double getPrecursorMz() const;
97 
98  void setMsLevel(uint ms_level);
99  uint getMsLevel() const;
100 
101  void setPrecursorSpectrumIndex(std::size_t precursor_scan_num);
102  std::size_t getPrecursorSpectrumIndex() const;
103 
104  void setPrecursorNativeId(const QString &native_id);
105  const QString &getPrecursorNativeId() const;
106 
107  void setRtInSeconds(pappso_double rt);
108  pappso_double getRtInSeconds() const;
109  pappso_double getRtInMinutes() const;
110 
111  void setDtInMilliSeconds(pappso_double rt);
112  pappso_double getDtInMilliSeconds() const;
113 
114  void setPrecursorIntensity(pappso_double intensity);
115  pappso_double getPrecursorIntensity() const;
116 
117  void setParameterValue(QualifiedMassSpectrumParameter parameter,
118  const QVariant &value);
119  const QVariant
120  getParameterValue(QualifiedMassSpectrumParameter parameter) const;
121 
122  std::size_t size() const;
123 
124  QString toString() const;
125 
126  protected:
127  //! Shared pointer to the mass spectrum.
128  MassSpectrumSPtr msp_massSpectrum = nullptr;
129 
130  //! Id of the mass spectrum.
131  MassSpectrumId m_massSpectrumId;
132 
133  bool m_isEmptyMassSpectrum = false;
134 
135  //! Mass spectrometry level of this mass spectrum.
136  unsigned int m_msLevel = 0;
137 
138  //! Retention time (in seconds) at which this mass spectrum was acquired.
139  pappso_double m_rt = -1;
140 
141  //! Drift time (in milliseconds) at which this mass spectrum was acquired.
142  pappso_double m_dt = -1;
143 
144  //! Index of the spectrum of the precusor ion that was fragmented to yield
145  // this mass spectrum.
146  std::size_t m_precursorSpectrumIndex =
147  std::numeric_limits<std::size_t>::max();
148 
149  //! Native XML id of the spectrum relative to the mz data native file
150  QString m_precursorNativeId;
151 
152  //! m/z ratio of the precursor that was fragmented to yield this mass
153  //! spectrum.
154  pappso_double m_precursorMz = std::numeric_limits<double>::max();
155 
156  //! Charge of the precursor that was fragmented to yield this mass spectrum.
157  unsigned int m_precursorCharge = std::numeric_limits<unsigned int>::max();
158 
159  //! Intensity of the precursor that was fragmented to yield this mass
160  //! spectrum.
161  pappso_double m_precursorIntensity = std::numeric_limits<double>::max();
162 
163  //! map containing any parameter value for this spectrum
164  std::map<QualifiedMassSpectrumParameter, QVariant> m_paramsMap;
165 };
166 
167 
168 } // namespace pappso
pappso::QualifiedMassSpectrumSPtr
std::shared_ptr< QualifiedMassSpectrum > QualifiedMassSpectrumSPtr
Definition: qualifiedmassspectrum.h:59
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:69
pappso::MassSpectrumCstSPtr
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
Definition: massspectrum.h:76
pappso::QualifiedMassSpectrumParameter::CollisionEnergy
@ CollisionEnergy
Bruker's Tims tof collision energy.
pappso::QualifiedMassSpectrumParameter::OneOverK0end
@ 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:14
pappso
Definition: aa.cpp:38
pappso::QualifiedMassSpectrumParameter::IsolationMz
@ IsolationMz
isolation window
pappso::QualifiedMassSpectrumParameter::OneOverK0
@ OneOverK0
1/kO of a simple scan
pappso::uint
unsigned int uint
Definition: types.h:76
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition: qualifiedmassspectrum.h:85
pappso::QualifiedMassSpectrumParameter
QualifiedMassSpectrumParameter
Definition: qualifiedmassspectrum.h:65
pappso::QualifiedMassSpectrumParameter::last
@ last
pappso::QualifiedMassSpectrumCstSPtr
std::shared_ptr< const QualifiedMassSpectrum > QualifiedMassSpectrumCstSPtr
Definition: qualifiedmassspectrum.h:63
massspectrumid.h
pappso::QualifiedMassSpectrumParameter::OneOverK0begin
@ OneOverK0begin
pappso::MassSpectrumId
Definition: massspectrumid.h:58
pappso::QualifiedMassSpectrumParameter::IsolationWidth
@ IsolationWidth
isolation window width
pappso::QualifiedMassSpectrumParameter::BrukerPrecursorIndex
@ BrukerPrecursorIndex
Bruker's Tims tof precursor index.
pappso::MassSpectrumSPtr
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
Definition: massspectrum.h:75