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  /** @brief clone the mass spectrum contained in Qualified Mass Spectrum
90  */
91  const QualifiedMassSpectrum &cloneMassSpectrumSPtr();
92 
93  void setEmptyMassSpectrum(bool is_empty_mass_spectrum);
94  bool isEmptyMassSpectrum() const;
95 
96  void setPrecursorCharge(uint precursor_charge);
97  uint getPrecursorCharge() const;
98 
99  void setPrecursorMz(pappso_double precursor_mz);
100  pappso_double getPrecursorMz() const;
101 
102  void setMsLevel(uint ms_level);
103  uint getMsLevel() const;
104 
105  void setPrecursorSpectrumIndex(std::size_t precursor_scan_num);
106  std::size_t getPrecursorSpectrumIndex() const;
107 
108  void setPrecursorNativeId(const QString &native_id);
109  const QString &getPrecursorNativeId() const;
110 
111  void setRtInSeconds(pappso_double rt);
112  pappso_double getRtInSeconds() const;
113  pappso_double getRtInMinutes() const;
114 
115  void setDtInMilliSeconds(pappso_double rt);
116  pappso_double getDtInMilliSeconds() const;
117 
118  void setPrecursorIntensity(pappso_double intensity);
119  pappso_double getPrecursorIntensity() const;
120 
121  void setParameterValue(QualifiedMassSpectrumParameter parameter,
122  const QVariant &value);
123  const QVariant
124  getParameterValue(QualifiedMassSpectrumParameter parameter) const;
125 
126  std::size_t size() const;
127 
128  QString toString() const;
129 
130  protected:
131  //! Shared pointer to the mass spectrum.
132  MassSpectrumSPtr msp_massSpectrum = nullptr;
133 
134  //! Id of the mass spectrum.
136 
137  bool m_isEmptyMassSpectrum = false;
138 
139  //! Mass spectrometry level of this mass spectrum.
140  unsigned int m_msLevel = 0;
141 
142  //! Retention time (in seconds) at which this mass spectrum was acquired.
143  pappso_double m_rt = -1;
144 
145  //! Drift time (in milliseconds) at which this mass spectrum was acquired.
146  pappso_double m_dt = -1;
147 
148  //! Index of the spectrum of the precusor ion that was fragmented to yield
149  // this mass spectrum.
150  std::size_t m_precursorSpectrumIndex =
151  std::numeric_limits<std::size_t>::max();
152 
153  //! Native XML id of the spectrum relative to the mz data native file
155 
156  //! m/z ratio of the precursor that was fragmented to yield this mass
157  //! spectrum.
158  pappso_double m_precursorMz = std::numeric_limits<double>::max();
159 
160  //! Charge of the precursor that was fragmented to yield this mass spectrum.
161  unsigned int m_precursorCharge = std::numeric_limits<unsigned int>::max();
162 
163  //! Intensity of the precursor that was fragmented to yield this mass
164  //! spectrum.
165  pappso_double m_precursorIntensity = std::numeric_limits<double>::max();
166 
167  //! map containing any parameter value for this spectrum
168  std::map<QualifiedMassSpectrumParameter, QVariant> m_paramsMap;
169 };
170 
171 
172 } // namespace pappso
pappso::QualifiedMassSpectrumSPtr
std::shared_ptr< QualifiedMassSpectrum > QualifiedMassSpectrumSPtr
Definition: qualifiedmassspectrum.h:41
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:48
pappso::MassSpectrumCstSPtr
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
Definition: massspectrum.h:55
massspectrum.h
basic mass spectrum
pappso::QualifiedMassSpectrum::m_paramsMap
std::map< QualifiedMassSpectrumParameter, QVariant > m_paramsMap
map containing any parameter value for this spectrum
Definition: qualifiedmassspectrum.h:168
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition: exportinmportconfig.h:14
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks
Definition: aa.cpp:39
pappso::uint
unsigned int uint
Definition: types.h:55
pappso::QualifiedMassSpectrum::m_massSpectrumId
MassSpectrumId m_massSpectrumId
Id of the mass spectrum.
Definition: qualifiedmassspectrum.h:135
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition: qualifiedmassspectrum.h:68
pappso::QualifiedMassSpectrumParameter
QualifiedMassSpectrumParameter
Definition: qualifiedmassspectrum.h:48
pappso::QualifiedMassSpectrumParameter::last
@ last
pappso::QualifiedMassSpectrumCstSPtr
std::shared_ptr< const QualifiedMassSpectrum > QualifiedMassSpectrumCstSPtr
Definition: qualifiedmassspectrum.h:45
pappso::QualifiedMassSpectrum::m_precursorNativeId
QString m_precursorNativeId
Native XML id of the spectrum relative to the mz data native file.
Definition: qualifiedmassspectrum.h:154
massspectrumid.h
pappso::MassSpectrumId
Definition: massspectrumid.h:38
pappso::MassSpectrumSPtr
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
Definition: massspectrum.h:54