libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
timsmsrunreaderdia.cpp
Go to the documentation of this file.
1/**
2 * \file pappsomspp/msrun/private/timsmsrunreaderdia.cpp
3 * \date 09/07/2024
4 * \author Olivier Langella
5 * \brief MSrun file reader for native Bruker TimsTOF specialized for DIA
6 * purpose
7 */
8
9/*******************************************************************************
10 * Copyright (c) 2024 Olivier Langella
11 *<Olivier.Langella@universite-paris-saclay.fr>.
12 *
13 * This file is part of the PAPPSOms++ library.
14 *
15 * PAPPSOms++ is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PAPPSOms++ is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
27 *
28 ******************************************************************************/
29
30
31#include "timsmsrunreaderdia.h"
34#include <QDebug>
35
36namespace pappso
37{
39 : TimsMsRunReaderBase(msrun_id_csp)
40{
41 // qInfo() << msp_timsData.get();
42 initialize();
43}
44
45
47 const TimsMsRunReaderBase &msrun_reader_base)
48 : TimsMsRunReaderBase(msrun_reader_base)
49{
50 initialize();
51}
52
56
57
58void
60{
61 qDebug();
62
63 if(msp_timsData == nullptr)
64 msp_timsData =
65 std::make_shared<TimsData>(mcsp_msRunId.get()->getFileName());
66
67 if(msp_timsData.get() == nullptr)
68 {
69 throw PappsoException(
70 QObject::tr("ERROR in TimsMsRunReaderDia::initialize "
71 "msp_timsData is null for MsRunId %1")
72 .arg(mcsp_msRunId.get()->toString()));
73 }
74 qDebug();
75 qDebug() << msp_timsData.get();
76 mp_timsDiaSlices = msp_timsData.get()->getTimsDiaSlicesPtr();
77 qDebug();
78}
79
80
83 std::size_t spectrum_index, pappso::PrecisionPtr precision) const
84{
85 throw ExceptionNotImplemented(QObject::tr("Not implemented %1 %2 %3")
86 .arg(__FILE__)
87 .arg(__FUNCTION__)
88 .arg(__LINE__));
89}
90
93 const pappso::QualifiedMassSpectrum &mass_spectrum,
94 pappso::PrecisionPtr precision) const
95{
96 throw ExceptionNotImplemented(QObject::tr("Not implemented %1 %2 %3")
97 .arg(__FILE__)
98 .arg(__FUNCTION__)
99 .arg(__LINE__));
100}
101void
103 SpectrumCollectionHandlerInterface &handler, unsigned int ms_level)
104{
105 throw ExceptionNotImplemented(QObject::tr("Not implemented %1 %2 %3")
106 .arg(__FILE__)
107 .arg(__FUNCTION__)
108 .arg(__LINE__));
109}
110
113 bool want_binary_data) const
114{
115
116 // spectrum index is a global slice index
117 QualifiedMassSpectrum q_dia_spectrum;
119 getMsRunId(), q_dia_spectrum, spectrum_index, want_binary_data);
120 return q_dia_spectrum;
121}
122
123void
126{
127 throw ExceptionNotImplemented(QObject::tr("Not implemented %1 %2 %3")
128 .arg(__FILE__)
129 .arg(__FUNCTION__)
130 .arg(__LINE__));
131}
132
133void
136{
137 throw ExceptionNotImplemented(QObject::tr("Not implemented %1 %2 %3")
138 .arg(__FILE__)
139 .arg(__FUNCTION__)
140 .arg(__LINE__));
141}
142
144TimsMsRunReaderDia::massSpectrumSPtr(std::size_t spectrum_index)
145{
146 throw ExceptionNotImplemented(QObject::tr("Not implemented %1 %2 %3")
147 .arg(__FILE__)
148 .arg(__FUNCTION__)
149 .arg(__LINE__));
150}
153{
154 throw ExceptionNotImplemented(QObject::tr("Not implemented %1 %2 %3")
155 .arg(__FILE__)
156 .arg(__FUNCTION__)
157 .arg(__LINE__));
158}
159
160std::size_t
166
167bool
169{
171 {
172 qDebug() << msp_timsData.get();
173 mp_timsDiaSlices = msp_timsData.get()->getTimsDiaSlicesPtr();
174 return true;
175 }
176 return false;
177 qDebug();
178}
179
180} // namespace pappso
const MsRunIdCstSPtr & getMsRunId() const
Class representing a fully specified mass spectrum.
interface to collect spectrums from the MsRunReader class
void getMs2QualifiedSpectrumByGlobalSliceIndex(const MsRunIdCstSPtr &msrun_id, QualifiedMassSpectrum &mass_spectrum, std::size_t global_slice_index, bool want_binary_data) const
std::size_t getTotalSlicesCount() const
get the number of DIA MS2 slices analyzed by PASEF
virtual bool acquireDevice() override
acquire data back end device
virtual void readSpectrumCollection(SpectrumCollectionHandlerInterface &handler) override
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
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
virtual MassSpectrumSPtr massSpectrumSPtr(std::size_t spectrum_index) override
get a MassSpectrumSPtr class given its spectrum index
virtual XicCoordSPtr newXicCoordSPtrFromSpectrumIndex(std::size_t spectrum_index, PrecisionPtr precision) const override
get a xic coordinate object from a given spectrum index
virtual void initialize() override
virtual XicCoordSPtr newXicCoordSPtrFromQualifiedMassSpectrum(const QualifiedMassSpectrum &mass_spectrum, PrecisionPtr precision) const override
get a xic coordinate object from a given spectrum
TimsMsRunReaderDia(MsRunIdCstSPtr &msrun_id_csp)
virtual QualifiedMassSpectrum qualifiedMassSpectrum(std::size_t spectrum_index, bool want_binary_data=true) const override
get a QualifiedMassSpectrum class given its scan number
virtual MassSpectrumCstSPtr massSpectrumCstSPtr(std::size_t spectrum_index) override
virtual std::size_t spectrumListSize() const override
get the totat number of spectrum conained in the MSrun data file
virtual bool acquireDevice() override
acquire data back end device
virtual void readSpectrumCollection2(const MsRunReadConfig &config, SpectrumCollectionHandlerInterface &handler) override
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:46
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
std::shared_ptr< XicCoord > XicCoordSPtr
Definition xiccoord.h:43
MSrun file reader for native Bruker TimsTOF specialized for DIA purpose.