libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
timsmsrunreaderbase.cpp
Go to the documentation of this file.
1/**
2 * \file pappsomspp/msrun/private/timsmsrunreaderbase.cpp
3 * \date 15/07/2024
4 * \author Olivier Langella
5 * \brief Base class for all tims ms run reader objects
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2024 Olivier Langella
10 *<Olivier.Langella@universite-paris-saclay.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#include "timsmsrunreaderbase.h"
32#include <QDebug>
33
34namespace pappso
35{
37 : MsRunReader(msrun_id_csp)
38{
39 initialize();
40}
41
43 const TimsMsRunReaderBase &msrun_reader_base)
44 : MsRunReader(msrun_reader_base.getMsRunId()),
45 msp_timsData(msrun_reader_base.msp_timsData)
46{
47 initialize();
48}
49
50
56
57void
59{
60 if(msp_timsData == nullptr)
62 std::make_shared<TimsData>(mcsp_msRunId.get()->getFileName());
63
64 if(msp_timsData.get() == nullptr)
65 {
66 throw PappsoException(
67 QObject::tr("ERROR in TimsMsRunReaderBase::initialize "
68 "msp_timsData is null for MsRunId %1")
69 .arg(mcsp_msRunId.get()->toString()));
70 }
71}
72
73
74bool
75TimsMsRunReaderBase::accept(const QString &file_name) const
76{
77 qDebug() << file_name;
78 return true;
79}
80
81bool
83{
84 return false;
85}
86
87
88bool
90{
91 msp_timsData = nullptr;
92 return true;
93}
94
95bool
97{
98 if(msp_timsData == nullptr)
99 {
100 initialize();
101 }
102 return true;
103}
104
111
112
113Trace
115{
116 // Use the Sqlite database to fetch the total ion current chromatogram (TIC
117 // chromatogram).
118
120
121 // The time unit here is seconds, not minutes!!!
122 return msp_timsData->getTicChromatogram();
123}
124
125
126std::vector<double>
128{
129 return msp_timsData.get()->getRetentionTimeLineInSeconds();
130}
131
132
135 std::size_t spectrum_index [[maybe_unused]],
136 pappso::PrecisionPtr precision [[maybe_unused]]) const
137{
138 throw ExceptionNotImplemented(QObject::tr("Not implemented %1 %2 %3")
139 .arg(__FILE__)
140 .arg(__FUNCTION__)
141 .arg(__LINE__));
142}
143
146 const pappso::QualifiedMassSpectrum &mass_spectrum [[maybe_unused]],
147 pappso::PrecisionPtr precision [[maybe_unused]]) const
148{
149 throw ExceptionNotImplemented(QObject::tr("Not implemented %1 %2 %3")
150 .arg(__FILE__)
151 .arg(__FUNCTION__)
152 .arg(__LINE__));
153}
154
155
156} // namespace pappso
base class to read MSrun the only way to build a MsRunReader object is to use the MsRunReaderFactory
Definition msrunreader.h:63
MsRunIdCstSPtr mcsp_msRunId
Class representing a fully specified mass spectrum.
TimsMsRunReaderBase(MsRunIdCstSPtr &msrun_id_csp)
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 pappso::XicCoordSPtr newXicCoordSPtrFromSpectrumIndex(std::size_t spectrum_index, pappso::PrecisionPtr precision) const override
get a xic coordinate object from a given spectrum index
virtual std::vector< double > getRetentionTimeLine() override
retention timeline get retention times along the MSrun in seconds
virtual bool hasScanNumbers() const override
tells if spectra can be accessed using scan numbers by default, it returns false. Only overrided func...
virtual pappso::XicCoordSPtr newXicCoordSPtrFromQualifiedMassSpectrum(const pappso::QualifiedMassSpectrum &mass_spectrum, pappso::PrecisionPtr precision) const override
get a xic coordinate object from a given spectrum
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,...
virtual TimsDataSp getTimsDataSPtr()
give an access to the underlying raw data pointer
A simple container of DataPoint instances.
Definition trace.h:148
process interrupted exception
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< TimsData > TimsDataSp
shared pointer on a TimsData object
Definition timsdata.h:52
std::shared_ptr< XicCoord > XicCoordSPtr
Definition xiccoord.h:43
Base class for all tims ms run reader objects.