libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
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
31
#include "
pappsomspp/core/processing/uimonitor/uimonitorinterface.h
"
32
#include "
pappsomspp/core/processing/cbor/cborstreamwriter.h
"
33
#include "
pappsomspp/core/processing/xml/xmlstreamreaderinterface.h
"
34
35
36
#include "
pappsomspp/export-import-config.h
"
37
38
namespace
pappso
39
{
40
namespace
cbor
41
{
42
namespace
mzcbor
43
{
44
/**
45
* @todo write docs
46
*/
47
class
PMSPP_LIB_DECL
MzmlConvert
:
public
XmlStreamReaderInterface
48
{
49
public
:
50
/**
51
* Default constructor
52
*/
53
MzmlConvert
(
pappso::UiMonitorInterface
*p_monitor,
pappso::cbor::CborStreamWriter
*p_output);
54
55
/**
56
* Destructor
57
*/
58
virtual
~MzmlConvert
();
59
60
61
void
writeMzcborIndex
(
pappso::cbor::CborStreamWriter
*writer)
const
;
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
76
void
getCurrentSpectrumSize
();
77
void
readBinaryDataArrayList
();
78
QString
readBinaryDataArray
(QVector<double> &double_array);
79
80
private
:
81
pappso::UiMonitorInterface
*
mp_monitor
;
82
pappso::cbor::CborStreamWriter
*
mp_cborWriter
;
83
84
std::vector<QString>
m_elementStash
;
85
QStringList
m_elementToStoreInArray
;
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
cborstreamwriter.h
pappso::UiMonitorInterface
Definition
uimonitorinterface.h:50
pappso::XmlStreamReaderInterface::XmlStreamReaderInterface
XmlStreamReaderInterface()
Definition
xmlstreamreaderinterface.cpp:37
pappso::cbor::CborStreamWriter
overrides QCborStreamWriter base class to provide convenient functions
Definition
cborstreamwriter.h:46
pappso::cbor::mzcbor::MzmlConvert::readStream
virtual void readStream() override
Definition
mzmlconvert.cpp:169
pappso::cbor::mzcbor::MzmlConvert::m_elementStash
std::vector< QString > m_elementStash
Definition
mzmlconvert.h:84
pappso::cbor::mzcbor::MzmlConvert::readBinaryDataArray
QString readBinaryDataArray(QVector< double > &double_array)
pappso::cbor::mzcbor::MzmlConvert::m_runAndSpectrumIdList
std::vector< std::vector< QString > > m_runAndSpectrumIdList
Definition
mzmlconvert.h:93
pappso::cbor::mzcbor::MzmlConvert::getCurrentSpectrumSize
void getCurrentSpectrumSize()
Definition
mzmlconvert.cpp:224
pappso::cbor::mzcbor::MzmlConvert::m_elementToStoreInArray
QStringList m_elementToStoreInArray
Definition
mzmlconvert.h:85
pappso::cbor::mzcbor::MzmlConvert::m_runAndSpectrumTotalIonCountList
std::vector< std::vector< qint64 > > m_runAndSpectrumTotalIonCountList
Definition
mzmlconvert.h:94
pappso::cbor::mzcbor::MzmlConvert::writeMzcborIndex
void writeMzcborIndex(pappso::cbor::CborStreamWriter *writer) const
Definition
mzmlconvert.cpp:65
pappso::cbor::mzcbor::MzmlConvert::m_runAndSpectrumMsLevelList
std::vector< std::vector< std::uint8_t > > m_runAndSpectrumMsLevelList
Definition
mzmlconvert.h:95
pappso::cbor::mzcbor::MzmlConvert::getRunAndSpectrumOffsetList
const std::vector< std::vector< qint64 > > & getRunAndSpectrumOffsetList() const
Definition
mzmlconvert.cpp:489
pappso::cbor::mzcbor::MzmlConvert::insideElement
void insideElement(QString &last_element, bool &array_started)
Definition
mzmlconvert.cpp:265
pappso::cbor::mzcbor::MzmlConvert::getRunIdList
const std::vector< QString > & getRunIdList() const
Definition
mzmlconvert.cpp:482
pappso::cbor::mzcbor::MzmlConvert::m_runAndSpectrumRtList
std::vector< std::vector< double > > m_runAndSpectrumRtList
Definition
mzmlconvert.h:96
pappso::cbor::mzcbor::MzmlConvert::m_uuid
QString m_uuid
Definition
mzmlconvert.h:97
pappso::cbor::mzcbor::MzmlConvert::attributeListToCbor
void attributeListToCbor(const QXmlStreamAttributes &xml_attributes)
Definition
mzmlconvert.cpp:460
pappso::cbor::mzcbor::MzmlConvert::getRunAndSpectrumIdList
const std::vector< std::vector< QString > > & getRunAndSpectrumIdList() const
Definition
mzmlconvert.cpp:495
pappso::cbor::mzcbor::MzmlConvert::m_runIdList
std::vector< QString > m_runIdList
Definition
mzmlconvert.h:91
pappso::cbor::mzcbor::MzmlConvert::mp_monitor
pappso::UiMonitorInterface * mp_monitor
Definition
mzmlconvert.h:81
pappso::cbor::mzcbor::MzmlConvert::attributeValueToCbor
void attributeValueToCbor(const QStringView &value_str)
Definition
mzmlconvert.cpp:433
pappso::cbor::mzcbor::MzmlConvert::readBinaryDataArrayList
void readBinaryDataArrayList()
Definition
mzmlconvert.cpp:233
pappso::cbor::mzcbor::MzmlConvert::MzmlConvert
MzmlConvert(pappso::UiMonitorInterface *p_monitor, pappso::cbor::CborStreamWriter *p_output)
Definition
mzmlconvert.cpp:39
pappso::cbor::mzcbor::MzmlConvert::m_doubleArray
QVector< double > m_doubleArray
Definition
mzmlconvert.h:89
pappso::cbor::mzcbor::MzmlConvert::m_runAndSpectrumOffsetList
std::vector< std::vector< qint64 > > m_runAndSpectrumOffsetList
Definition
mzmlconvert.h:92
pappso::cbor::mzcbor::MzmlConvert::m_currentSpectrumSize
std::size_t m_currentSpectrumSize
Definition
mzmlconvert.h:87
pappso::cbor::mzcbor::MzmlConvert::mp_cborWriter
pappso::cbor::CborStreamWriter * mp_cborWriter
Definition
mzmlconvert.h:82
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
pappso::cbor::mzcbor
Definition
binarydataarray.h:41
pappso::cbor
Definition
cborstreamreader.cpp:35
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
uimonitorinterface.h
xmlstreamreaderinterface.h
pappsomspp
core
processing
cbor
mzcbor
mzmlconvert.h
Generated on
for libpappsomspp by
1.17.0