libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
mzcborbuildindexreader.h
Go to the documentation of this file.
1/**
2 * \file pappsomspp/core/processing/cbor/mzcbor/mzcborbuildindexreader.h
3 * \date 24/11/2025
4 * \author Olivier Langella
5 * \brief read mzcbor to build an index
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2025 Olivier Langella <Olivier.Langella@universite-paris-saclay.fr>.
10 *
11 * This file is part of PAPPSOms-tools.
12 *
13 * PAPPSOms-tools 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-tools 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-tools. If not, see <http://www.gnu.org/licenses/>.
25 *
26 ******************************************************************************/
27
28
29#pragma once
30
35
36namespace pappso
37{
38namespace cbor
39{
40namespace mzcbor
41{
42/**
43 * @todo write docs
44 */
46{
47 public:
48 /**
49 * Default constructor
50 */
52
53 /**
54 * Destructor
55 */
57 virtual void readCbor(QFile *cborp, pappso::UiMonitorInterface &monitor)override;
58
59 const std::vector<qint64> &getSpectrumIndexPositionInFile() const;
60 const std::map<QString, std::size_t> &getNativeId2SpectrumIndexMap() const;
61
62
63 protected:
64 /** @brief read only the targeted msrun
65 */
66 virtual void readMsrun() override;
67
68
69 /** @brief only the spectrum list of targeted msrun, then stop parsing
70 */
72
73
74 /** @brief read each spectrum in the targeted msrun (msrunId)
75 */
76 void readSpectrum(qint64 position_of_spectrum_in_file, std::size_t index_count);
77
78
79
80
81 private:
84
85 std::vector<qint64> m_spectrumIndexPositionInFile;
86 std::map<QString, std::size_t> m_nativeId2SpectrumIndexMap;
87};
88} // namespace mzcbor
89} // namespace cbor
90} // namespace pappso
91
void readSpectrumListAndLeave()
only the spectrum list of targeted msrun, then stop parsing
std::map< QString, std::size_t > m_nativeId2SpectrumIndexMap
const std::vector< qint64 > & getSpectrumIndexPositionInFile() const
virtual void readMsrun() override
read only the targeted msrun
virtual void readCbor(QFile *cborp, pappso::UiMonitorInterface &monitor) override
read mzCBOR file
const std::map< QString, std::size_t > & getNativeId2SpectrumIndexMap() const
MzcborBuildIndexReader(const MsRunIdCstSPtr &msrun_id)
void readSpectrum(qint64 position_of_spectrum_in_file, std::size_t index_count)
read each spectrum in the targeted msrun (msrunId)
read mzcbor stream or file
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
base interface to read MSrun files