libpappsomspp
Library for mass spectrometry
msrunslice.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/xicextractor/private/msrunslice.h
3  * \date 12/05/2018
4  * \author Olivier Langella
5  * \brief one mz slice (1 dalton) of an MsRun
6  */
7 
8 /*******************************************************************************
9  * Copyright (c) 2018 Olivier Langella <Olivier.Langella@u-psud.fr>.
10  *
11  * This file is part of the PAPPSOms++ library.
12  *
13  * PAPPSOms++ is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation, either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * PAPPSOms++ is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
25  *
26  * Contributors:
27  * Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and
28  *implementation
29  ******************************************************************************/
30 
31 #pragma once
32 
33 #include "../../massspectrum/massspectrum.h"
34 #include <QDataStream>
35 
36 namespace pappso
37 {
38 
39 class MsRunSlice;
40 typedef std::shared_ptr<const MsRunSlice> MsRunSliceSPtr;
41 
43 {
44 
45  public:
46  MsRunSlice();
47  MsRunSlice(const MsRunSlice &other);
48  virtual ~MsRunSlice();
49 
51 
52  void setSliceNumber(unsigned int slice_number);
53  unsigned int getSliceNumber() const;
54 
55  void clear();
56  std::size_t size() const;
57 
58  /** @brief set number of spectrum (mz/intensity) stored in this slice
59  */
60  void setSize(std::size_t size);
61 
62  void appendToStream(QDataStream &stream, std::size_t ipos) const;
63 
64  const MassSpectrum &getSpectrum(std::size_t i) const;
65  MassSpectrum &getSpectrum(std::size_t i);
66 
67  /** @brief set the mass spectrum for a given index (retention time)
68  */
69  void setSpectrum(std::size_t i, const MassSpectrum &spectrum);
70 
71 
72  private:
73  unsigned int m_sliceNumber = 0;
74  std::vector<MassSpectrum> m_spectrumList;
75 };
76 
77 QDataStream &operator>>(QDataStream &instream, MsRunSlice &slice);
78 
79 
80 } // namespace pappso
Class to represent a mass spectrum.
Definition: massspectrum.h:71
const MassSpectrum & getSpectrum(std::size_t i) const
Definition: msrunslice.cpp:128
virtual ~MsRunSlice()
Definition: msrunslice.cpp:52
unsigned int m_sliceNumber
Definition: msrunslice.h:73
MsRunSliceSPtr makeMsRunSliceSp() const
Definition: msrunslice.cpp:57
void setSpectrum(std::size_t i, const MassSpectrum &spectrum)
set the mass spectrum for a given index (retention time)
Definition: msrunslice.cpp:93
void setSliceNumber(unsigned int slice_number)
Definition: msrunslice.cpp:63
void appendToStream(QDataStream &stream, std::size_t ipos) const
Definition: msrunslice.cpp:146
unsigned int getSliceNumber() const
Definition: msrunslice.cpp:69
void setSize(std::size_t size)
set number of spectrum (mz/intensity) stored in this slice
Definition: msrunslice.cpp:81
std::size_t size() const
Definition: msrunslice.cpp:75
std::vector< MassSpectrum > m_spectrumList
Definition: msrunslice.h:74
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
QDataStream & operator>>(QDataStream &instream, MassSpectrum &massSpectrum)
std::shared_ptr< const MsRunSlice > MsRunSliceSPtr
Definition: msrunslice.h:39