libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
spectrum.h
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/core/processing/cbor/mzcbor/spectrum.h
3
* \date 24/11/2025
4
* \author Olivier Langella
5
* \brief PSI spectrum object for mzML/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
#include <QString>
31
#include <qdebug.h>
32
#include "
pappsomspp/core/msrun/msrunid.h
"
33
#include "
pappsomspp/core/trace/trace.h
"
34
#include "
pappsomspp/core/processing/cbor/cborstreamreader.h
"
35
#include "
pappsomspp/core/processing/cbor/mzcbor/cvparammap.h
"
36
#include "
pappsomspp/core/processing/cbor/mzcbor/scan.h
"
37
#include "
pappsomspp/core/processing/cbor/mzcbor/precursor.h
"
38
#include "
pappsomspp/core/processing/cbor/mzcbor/binarydataarray.h
"
39
#include "
pappsomspp/export-import-config.h
"
40
41
namespace
pappso
42
{
43
namespace
cbor
44
{
45
namespace
mzcbor
46
{
47
/**
48
* @todo write docs
49
*/
50
struct
PMSPP_LIB_DECL
Spectrum
51
{
52
/** @brief fill the structure reading data from a CBOR stream
53
* @param reader CBOR stream
54
* @param want_binary_data if true, stores also binary data array list
55
*/
56
void
fromCbor
(
CborStreamReader
&reader,
bool
want_binary_data);
57
58
/** @brief write the structure to a JSON object
59
* This is a simplified representation for easy JSON data handling
60
* binary arrays are decoded in simple traces
61
* @result QJsonObject
62
*/
63
QJsonObject
toJsonObject
()
const
;
64
65
66
/** @brief write spectrum in MGF text format
67
*/
68
void
toMgf
(QTextStream &output,
MsRunIdCstSPtr
msrun_id_csptr)
const
;
69
70
71
static
std::map<QString, pappso::cbor::mzcbor::CvParam>
72
readScanCvParams
(
CborStreamReader
&reader);
73
74
void
decodeTrace
(
pappso::Trace
&trace)
const
;
75
76
uint
getMsLevel
()
const
;
77
double
getRtInSeconds
()
const
;
78
qint64
getTotalIonCount
()
const
;
79
80
QString
id
;
81
std::size_t
index
;
82
std::size_t
defaultArrayLength
;
83
84
CvParamMap
cvParamMap
;
85
CvParamMap
scanListCvParamMap
;
86
CvParamMap
precursorListCvParamMap
;
87
// QCborMap cborScanList;
88
std::vector<Scan>
scanList
;
89
std::vector<Precursor>
precursorList
;
90
std::vector<BinaryDataArray>
binaryDataArrayList
;
91
// QCborMap cborBinaryDataArray;
92
};
93
}
// namespace mzcbor
94
}
// namespace cbor
95
}
// namespace pappso
binarydataarray.h
PSI BinaryDataArray object for mzML/mzCBOR.
cborstreamreader.h
pappso::Trace
A simple container of DataPoint instances.
Definition
trace.h:152
pappso::cbor::CborStreamReader
simple override of the raw QCborStreamReader This adds convenient functions to put CBOR data into C++...
Definition
cborstreamreader.h:47
cvparammap.h
cvParam map
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
msrunid.h
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
pappso::MsRunIdCstSPtr
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition
msrunid.h:46
pappso::uint
unsigned int uint
Definition
types.h:67
precursor.h
PSI precursor object for mzML/mzCBOR.
scan.h
PSI scan object for mzML/mzCBOR.
pappso::cbor::mzcbor::CvParamMap
Definition
cvparammap.h:46
pappso::cbor::mzcbor::Spectrum
Definition
spectrum.h:51
pappso::cbor::mzcbor::Spectrum::cvParamMap
CvParamMap cvParamMap
Definition
spectrum.h:84
pappso::cbor::mzcbor::Spectrum::readScanCvParams
static std::map< QString, pappso::cbor::mzcbor::CvParam > readScanCvParams(CborStreamReader &reader)
Definition
spectrum.cpp:278
pappso::cbor::mzcbor::Spectrum::toMgf
void toMgf(QTextStream &output, MsRunIdCstSPtr msrun_id_csptr) const
write spectrum in MGF text format
Definition
spectrum.cpp:389
pappso::cbor::mzcbor::Spectrum::getMsLevel
uint getMsLevel() const
Definition
spectrum.cpp:328
pappso::cbor::mzcbor::Spectrum::precursorList
std::vector< Precursor > precursorList
Definition
spectrum.h:89
pappso::cbor::mzcbor::Spectrum::scanList
std::vector< Scan > scanList
Definition
spectrum.h:88
pappso::cbor::mzcbor::Spectrum::index
std::size_t index
Definition
spectrum.h:81
pappso::cbor::mzcbor::Spectrum::precursorListCvParamMap
CvParamMap precursorListCvParamMap
Definition
spectrum.h:86
pappso::cbor::mzcbor::Spectrum::toJsonObject
QJsonObject toJsonObject() const
write the structure to a JSON object This is a simplified representation for easy JSON data handling ...
Definition
spectrum.cpp:231
pappso::cbor::mzcbor::Spectrum::id
QString id
Definition
spectrum.h:80
pappso::cbor::mzcbor::Spectrum::fromCbor
void fromCbor(CborStreamReader &reader, bool want_binary_data)
fill the structure reading data from a CBOR stream
Definition
spectrum.cpp:43
pappso::cbor::mzcbor::Spectrum::getRtInSeconds
double getRtInSeconds() const
Definition
spectrum.cpp:342
pappso::cbor::mzcbor::Spectrum::scanListCvParamMap
CvParamMap scanListCvParamMap
Definition
spectrum.h:85
pappso::cbor::mzcbor::Spectrum::decodeTrace
void decodeTrace(pappso::Trace &trace) const
Definition
spectrum.cpp:356
pappso::cbor::mzcbor::Spectrum::getTotalIonCount
qint64 getTotalIonCount() const
Definition
spectrum.cpp:313
pappso::cbor::mzcbor::Spectrum::binaryDataArrayList
std::vector< BinaryDataArray > binaryDataArrayList
Definition
spectrum.h:90
pappso::cbor::mzcbor::Spectrum::defaultArrayLength
std::size_t defaultArrayLength
Definition
spectrum.h:82
trace.h
pappsomspp
core
processing
cbor
mzcbor
spectrum.h
Generated on
for libpappsomspp by
1.17.0