libpappsomspp
Library for mass spectrometry
timsmsrunreader.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/msrun/private/timsmsrunreader.h
3  * \date 05/09/2019
4  * \author Olivier Langella
5  * \brief MSrun file reader for native Bruker TimsTOF raw data
6  */
7 
8 /*******************************************************************************
9  * Copyright (c) 2019 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  ******************************************************************************/
27 
28 
29 #pragma once
30 
31 #include "../../msfile/msfileaccessor.h"
32 #include "../../msfile/msfilereader.h"
33 #include "../../vendors/tims/timsdata.h"
34 
35 namespace pappso
36 {
37 
38 class TimsMsRunReader : public MsRunReader
39 {
40  friend class MsFileAccessor;
41  /**
42  * @todo write docs
43  */
44  public:
45  TimsMsRunReader(MsRunIdCstSPtr &msrun_id_csp);
46  virtual ~TimsMsRunReader();
47 
48  virtual MassSpectrumSPtr
49  massSpectrumSPtr(std::size_t spectrum_index) override;
50  virtual MassSpectrumCstSPtr
51  massSpectrumCstSPtr(std::size_t spectrum_index) override;
52 
53  virtual QualifiedMassSpectrum
54  qualifiedMassSpectrum(std::size_t spectrum_index,
55  bool want_binary_data = true) const override;
56 
57  virtual void
59 
60  virtual std::size_t spectrumListSize() const override;
61 
62  virtual bool hasScanNumbers() const override;
63 
64  protected:
65  virtual void initialize() override;
66  virtual bool accept(const QString &file_name) const override;
67 
68  private:
69  TimsData *mpa_timsData = nullptr;
70 };
71 
72 } // namespace pappso
pappso::TimsMsRunReader::TimsMsRunReader
TimsMsRunReader(MsRunIdCstSPtr &msrun_id_csp)
Definition: timsmsrunreader.cpp:34
pappso::MassSpectrumCstSPtr
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
Definition: massspectrum.h:76
pappso::TimsMsRunReader::MsFileAccessor
friend class MsFileAccessor
Definition: timsmsrunreader.h:76
pappso::TimsMsRunReader::massSpectrumSPtr
virtual MassSpectrumSPtr massSpectrumSPtr(std::size_t spectrum_index) override
get a MassSpectrumSPtr class given its spectrum index
Definition: timsmsrunreader.cpp:65
pappso
Definition: aa.cpp:38
pappso::MsRunIdCstSPtr
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition: msrunid.h:65
pappso::TimsMsRunReader::~TimsMsRunReader
virtual ~TimsMsRunReader()
Definition: timsmsrunreader.cpp:40
pappso::TimsMsRunReader::hasScanNumbers
virtual bool hasScanNumbers() const override
tells if spectra can be accessed using scan numbers by default, it returns false. Only overrided func...
Definition: timsmsrunreader.cpp:167
pappso::TimsMsRunReader::massSpectrumCstSPtr
virtual MassSpectrumCstSPtr massSpectrumCstSPtr(std::size_t spectrum_index) override
Definition: timsmsrunreader.cpp:74
pappso::TimsData
Definition: timsdata.h:82
pappso::TimsMsRunReader::initialize
virtual void initialize() override
Definition: timsmsrunreader.cpp:49
pappso::TimsMsRunReader::readSpectrumCollection
virtual void readSpectrumCollection(SpectrumCollectionHandlerInterface &handler) override
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
Definition: timsmsrunreader.cpp:102
pappso::MsRunReader
class PMSPP_LIB_DECL MsRunReader
Definition: msrunreader.h:171
pappso::TimsMsRunReader::accept
virtual bool accept(const QString &file_name) const override
tells if the reader is able to handle this file must be implemented by private MS run reader,...
Definition: timsmsrunreader.cpp:56
pappso::TimsMsRunReader::spectrumListSize
virtual std::size_t spectrumListSize() const override
get the totat number of spectrum conained in the MSrun data file
Definition: timsmsrunreader.cpp:160
pappso::TimsMsRunReader::qualifiedMassSpectrum
virtual QualifiedMassSpectrum qualifiedMassSpectrum(std::size_t spectrum_index, bool want_binary_data=true) const override
get a QualifiedMassSpectrum class given its scan number
Definition: timsmsrunreader.cpp:81
pappso::TimsMsRunReader::mpa_timsData
TimsData * mpa_timsData
Definition: timsmsrunreader.h:105
pappso::SpectrumCollectionHandlerInterface
interface to collect spectrums from the MsRunReader class
Definition: msrunreader.h:79
pappso::MassSpectrumSPtr
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
Definition: massspectrum.h:75