libpappsomspp
Library for mass spectrometry
timsmsrunreaderms2.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/msrun/private/timsmsrunreaderms2.h
3  * \date 10/09/2019
4  * \author Olivier Langella
5  * \brief MSrun file reader for native Bruker TimsTOF specialized for MS2
6  * purpose
7  */
8 
9 /*******************************************************************************
10  * Copyright (c) 2019 Olivier Langella <Olivier.Langella@u-psud.fr>.
11  *
12  * This file is part of the PAPPSOms++ library.
13  *
14  * PAPPSOms++ is free software: you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation, either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * PAPPSOms++ is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
26  *
27  ******************************************************************************/
28 
29 
30 #pragma once
31 
32 #include "../../types.h"
33 #include "../../msfile/msfileaccessor.h"
34 #include "../../msfile/msfilereader.h"
35 #include "../../vendors/tims/timsdata.h"
36 
37 namespace pappso
38 {
39 
40 class PMSPP_LIB_DECL TimsMsRunReaderMs2 : public MsRunReader
41 {
42  friend class MsFileAccessor;
43  /**
44  * @todo write docs
45  */
46  public:
47  TimsMsRunReaderMs2(MsRunIdCstSPtr &msrun_id_csp);
48  virtual ~TimsMsRunReaderMs2();
49 
50  virtual MassSpectrumSPtr
51  massSpectrumSPtr(std::size_t spectrum_index) override;
52  virtual MassSpectrumCstSPtr
53  massSpectrumCstSPtr(std::size_t spectrum_index) override;
54 
55  virtual QualifiedMassSpectrum
56  qualifiedMassSpectrum(std::size_t spectrum_index,
57  bool want_binary_data = true) const override;
58 
59  virtual void
60  readSpectrumCollection(SpectrumCollectionHandlerInterface &handler) override;
61 
62  virtual std::size_t spectrumListSize() const override;
63 
64  virtual bool hasScanNumbers() const override;
65 
66  void setMs2FilterCstSPtr(pappso::FilterInterfaceCstSPtr filter);
67  void setMs1FilterCstSPtr(pappso::FilterInterfaceCstSPtr filter);
68 
69  /** @brief enable or disable simple centroid filter on raw tims data for MS2
70  */
71  void setMs2BuiltinCentroid(bool centroid);
72 
73  /** @brief Get all the precursors id which match the values
74  * @return list of precursors Ids
75  */
76  virtual std::vector<std::size_t>
77  getPrecursorsIDFromMzRt(int charge, double mz_val, double rt_sec, double k0);
78 
79 
80  virtual bool releaseDevice() override;
81 
82  virtual bool acquireDevice() override;
83 
84  /** @brief give an access to the underlying raw data pointer
85  */
86  virtual TimsDataSp getTimsDataSPtr();
87 
88  protected:
89  virtual void initialize() override;
90  virtual bool accept(const QString &file_name) const override;
91 
92  private:
93  TimsDataSp msp_timsData = nullptr;
94 
95  pappso::FilterInterfaceCstSPtr msp_ms1Filter;
96  pappso::FilterInterfaceCstSPtr msp_ms2Filter;
97  /** @brief enable builtin centroid on raw tims integers by default
98  */
99  bool m_builtinMs2Centroid = true;
100 };
101 
102 
103 } // namespace pappso
pappso::MassSpectrumCstSPtr
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
Definition: massspectrum.h:76
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 and changes multichar...
Definition: aa.cpp:39
pappso::FilterInterfaceCstSPtr
std::shared_ptr< const FilterInterface > FilterInterfaceCstSPtr
Definition: filterinterface.h:64
pappso::MsRunIdCstSPtr
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition: msrunid.h:65
pappso::TimsDataSp
std::shared_ptr< TimsData > TimsDataSp
shared pointer on a TimsData object
Definition: timsdata.h:78
pappso::MsRunReader
class PMSPP_LIB_DECL MsRunReader
Definition: msrunreader.h:171
pappso::SpectrumCollectionHandlerInterface
interface to collect spectrums from the MsRunReader class
Definition: msrunreader.h:80
pappso::MassSpectrumSPtr
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
Definition: massspectrum.h:75