libpappsomspp
Library for mass spectrometry
timsframesmsrunreader.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 "../../vendors/tims/timsdata.h"
33 
34 namespace pappso
35 {
36 
37 // This class is aimed at processing the frames in a Bruker timsTOF data set. In
38 // this processing of the data, we skip the ion mobility scans altogether. One
39 // main aim of this processing is to compute the TIC chromatogram from the
40 // binary data file and not using the TIC chromatogram that is stored in the DB
41 // file.
42 
44 {
45  friend class MsFileAccessor;
46  /**
47  * @todo write docs
48  */
49  public:
51  virtual ~TimsFramesMsRunReader();
52 
53  virtual MassSpectrumSPtr
54  massSpectrumSPtr(std::size_t spectrum_index) override;
55  virtual MassSpectrumCstSPtr
56  massSpectrumCstSPtr(std::size_t spectrum_index) override;
57 
58  virtual QualifiedMassSpectrum
59  qualifiedMassSpectrum(std::size_t spectrum_index,
60  bool want_binary_data = true) const override;
61 
62  virtual void
64 
65  virtual void
67  unsigned int ms_level) override;
68 
69 
71  std::size_t spectrum_index, pappso::PrecisionPtr precision) const override;
72 
74  const pappso::QualifiedMassSpectrum &mass_spectrum,
75  pappso::PrecisionPtr precision) const override;
76 
77 
78  virtual std::size_t spectrumListSize() const override;
79 
80  virtual bool hasScanNumbers() const override;
81 
82  virtual bool releaseDevice() override;
83 
84  virtual bool acquireDevice() override;
85 
86 
87  /** @brief give an access to the underlying raw data pointer
88  */
89  virtual TimsDataSp getTimsDataSPtr();
90 
91  virtual Trace getTicChromatogram() override;
92  virtual Trace computeTicChromatogram();
93 
94 
95  protected:
96  virtual void initialize() override;
97  virtual bool accept(const QString &file_name) const override;
98 
99  private:
101 };
102 
103 } // namespace pappso
base class to read MSrun the only way to build a MsRunReader object is to use the MsRunReaderFactory
Definition: msrunreader.h:192
Class representing a fully specified mass spectrum.
interface to collect spectrums from the MsRunReader class
Definition: msrunreader.h:56
virtual std::size_t spectrumListSize() const override
get the totat number of spectrum conained in the MSrun data file
virtual void readSpectrumCollection(SpectrumCollectionHandlerInterface &handler) override
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
virtual MassSpectrumCstSPtr massSpectrumCstSPtr(std::size_t spectrum_index) override
virtual pappso::XicCoordSPtr newXicCoordSPtrFromQualifiedMassSpectrum(const pappso::QualifiedMassSpectrum &mass_spectrum, pappso::PrecisionPtr precision) const override
get a xic coordinate object from a given spectrum
virtual QualifiedMassSpectrum qualifiedMassSpectrum(std::size_t spectrum_index, bool want_binary_data=true) const override
get a QualifiedMassSpectrum class given its scan number
virtual MassSpectrumSPtr massSpectrumSPtr(std::size_t spectrum_index) override
get a MassSpectrumSPtr class given its spectrum index
virtual Trace getTicChromatogram() override
get a TIC chromatogram
virtual bool releaseDevice() override
release data back end device if a the data back end is released, the developper has to use acquireDev...
virtual void initialize() override
virtual TimsDataSp getTimsDataSPtr()
give an access to the underlying raw data pointer
virtual bool hasScanNumbers() const override
tells if spectra can be accessed using scan numbers by default, it returns false. Only overrided func...
virtual bool acquireDevice() override
acquire data back end device
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,...
TimsFramesMsRunReader(MsRunIdCstSPtr &msrun_id_csp)
virtual pappso::XicCoordSPtr newXicCoordSPtrFromSpectrumIndex(std::size_t spectrum_index, pappso::PrecisionPtr precision) const override
get a xic coordinate object from a given spectrum index
virtual void readSpectrumCollectionByMsLevel(SpectrumCollectionHandlerInterface &handler, unsigned int ms_level) override
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler by Ms Levels
A simple container of DataPoint instances.
Definition: trace.h:148
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition: msrunid.h:44
std::shared_ptr< TimsData > TimsDataSp
shared pointer on a TimsData object
Definition: timsdata.h:46
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
Definition: massspectrum.h:55
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
Definition: massspectrum.h:54
std::shared_ptr< XicCoord > XicCoordSPtr
Definition: xiccoord.h:41