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
34#include <QDebug>
35
36namespace pappso
37{
39 : TimsMsRunReaderBase(msrun_id_csp)
40{
41 // qInfo() << msp_timsData.get();
42 initialize();
43}
44
45
47 : TimsMsRunReaderBase(msrun_reader_base)
48{
49 initialize();
50}
51
55
56
57void
59{
60 qDebug();
61
62 if(msp_timsData == nullptr)
63 msp_timsData = std::make_shared<TimsData>(mcsp_msRunId.get()->getFileName());
64
65 if(msp_timsData.get() == nullptr)
66 {
67 throw PappsoException(QObject::tr("ERROR in TimsMsRunReaderDia::initialize "
68 "msp_timsData is null for MsRunId %1")
69 .arg(mcsp_msRunId.get()->toString()));
70 }
71 qDebug();
72 qDebug() << msp_timsData.get();
73 mp_timsDiaSlices = msp_timsData.get()->getTimsDiaSlicesPtr();
74 qDebug();
75}
76
77
79TimsMsRunReaderDia::newXicCoordSPtrFromSpectrumIndex(std::size_t spectrum_index [[maybe_unused]],
80 pappso::PrecisionPtr precision
81 [[maybe_unused]]) const
82{
84 QObject::tr("Not implemented %1 %2 %3").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__));
85}
86
89 const pappso::QualifiedMassSpectrum &mass_spectrum [[maybe_unused]],
90 pappso::PrecisionPtr precision [[maybe_unused]]) const
91{
93 QObject::tr("Not implemented %1 %2 %3").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__));
94}
95void
97 [[maybe_unused]],
98 unsigned int ms_level [[maybe_unused]])
99{
101 QObject::tr("Not implemented %1 %2 %3").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__));
102}
103
105TimsMsRunReaderDia::qualifiedMassSpectrum(std::size_t spectrum_index, bool want_binary_data) const
106{
107
108 // spectrum index is a global slice index
109 QualifiedMassSpectrum q_dia_spectrum;
110 mp_timsDiaSlices->getMs2QualifiedSpectrumByGlobalSliceIndex(
111 getMsRunId(), q_dia_spectrum, spectrum_index, want_binary_data);
112 return q_dia_spectrum;
113}
114
115void
117 [[maybe_unused]])
118{
120 QObject::tr("Not implemented %1 %2 %3").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__));
121}
122
123void
126 [[maybe_unused]])
127{
129 QObject::tr("Not implemented %1 %2 %3").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__));
130}
131
133TimsMsRunReaderDia::massSpectrumSPtr(std::size_t spectrum_index [[maybe_unused]])
134{
136 QObject::tr("Not implemented %1 %2 %3").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__));
137}
139TimsMsRunReaderDia::massSpectrumCstSPtr(std::size_t spectrum_index [[maybe_unused]])
140{
142 QObject::tr("Not implemented %1 %2 %3").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__));
143}
144
145std::size_t
147{
148
149 return mp_timsDiaSlices->getTotalSlicesCount();
150}
151
152bool
154{
156 {
157 qDebug() << msp_timsData.get();
158 mp_timsDiaSlices = msp_timsData.get()->getTimsDiaSlicesPtr();
159 return true;
160 }
161 return false;
162 qDebug();
163}
164
165std::size_t
167 [[maybe_unused]])
168{
170 QObject::tr("%1 %2 %3 not implemented").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__));
171}
172} // namespace pappso
MsRunIdCstSPtr mcsp_msRunId
const MsRunIdCstSPtr & getMsRunId() const
Class representing a fully specified mass spectrum.
interface to collect spectrums from the MsRunReader class
TimsMsRunReaderBase(MsRunIdCstSPtr &msrun_id_csp)
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 std::size_t spectrumStringIdentifier2SpectrumIndex(const QString &spectrum_identifier) override
if possible, get the spectrum index given a string identifier throw a not found exception if spectrum...
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
const PrecisionBase * PrecisionPtr
Definition precision.h:122
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
std::shared_ptr< XicCoord > XicCoordSPtr
Definition xiccoord.h:44