libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
mzmlconvert.h
Go to the documentation of this file.
1/**
2 * \file pappsomspp/processing/cbor/mzcbor/mzmlconvert.h
3 * \date 19/11/2025
4 * \author Olivier Langella
5 * \brief convert mzML to mzcbor
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
34
35
37
38namespace pappso
39{
40namespace cbor
41{
42namespace mzcbor
43{
44/**
45 * @todo write docs
46 */
48{
49 public:
50 /**
51 * Default constructor
52 */
54
55 /**
56 * Destructor
57 */
58 virtual ~MzmlConvert();
59
60
62
63 const std::vector<QString> &getRunIdList() const;
64 const std::vector<std::vector<qint64>> &getRunAndSpectrumOffsetList() const;
65 const std::vector<std::vector<QString>> &getRunAndSpectrumIdList() const;
66
67
68 protected:
69 virtual void readStream() override;
70
71 private:
72 void attributeListToCbor(const QXmlStreamAttributes &xml_attributes);
73 void attributeValueToCbor(const QStringView &value_str);
74 void insideElement(QString &last_element, bool &array_started);
75
78 QString readBinaryDataArray(QVector<double> &double_array);
79
80 private:
83
84 std::vector<QString> m_elementStash;
86
87 std::size_t m_currentSpectrumSize = 0;
88
89 QVector<double> m_doubleArray;
90
91 std::vector<QString> m_runIdList;
92 std::vector<std::vector<qint64>> m_runAndSpectrumOffsetList;
93 std::vector<std::vector<QString>> m_runAndSpectrumIdList;
94 std::vector<std::vector<qint64>> m_runAndSpectrumTotalIonCountList;
95 std::vector<std::vector<std::uint8_t>> m_runAndSpectrumMsLevelList;
96 std::vector<std::vector<double>> m_runAndSpectrumRtList;
97 QString m_uuid;
98};
99} // namespace mzcbor
100} // namespace cbor
101} // namespace pappso
overrides QCborStreamWriter base class to provide convenient functions
virtual void readStream() override
std::vector< QString > m_elementStash
Definition mzmlconvert.h:84
QString readBinaryDataArray(QVector< double > &double_array)
std::vector< std::vector< QString > > m_runAndSpectrumIdList
Definition mzmlconvert.h:93
std::vector< std::vector< qint64 > > m_runAndSpectrumTotalIonCountList
Definition mzmlconvert.h:94
void writeMzcborIndex(pappso::cbor::CborStreamWriter *writer) const
std::vector< std::vector< std::uint8_t > > m_runAndSpectrumMsLevelList
Definition mzmlconvert.h:95
const std::vector< std::vector< qint64 > > & getRunAndSpectrumOffsetList() const
void insideElement(QString &last_element, bool &array_started)
const std::vector< QString > & getRunIdList() const
std::vector< std::vector< double > > m_runAndSpectrumRtList
Definition mzmlconvert.h:96
void attributeListToCbor(const QXmlStreamAttributes &xml_attributes)
const std::vector< std::vector< QString > > & getRunAndSpectrumIdList() const
std::vector< QString > m_runIdList
Definition mzmlconvert.h:91
pappso::UiMonitorInterface * mp_monitor
Definition mzmlconvert.h:81
void attributeValueToCbor(const QStringView &value_str)
MzmlConvert(pappso::UiMonitorInterface *p_monitor, pappso::cbor::CborStreamWriter *p_output)
std::vector< std::vector< qint64 > > m_runAndSpectrumOffsetList
Definition mzmlconvert.h:92
pappso::cbor::CborStreamWriter * mp_cborWriter
Definition mzmlconvert.h:82
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39