libpappsomspp
Library for mass spectrometry
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>
40
41namespace pappso
42{
43namespace cbor
44{
45namespace mzcbor
46{
47/**
48 * @todo write docs
49 */
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>
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
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
PSI BinaryDataArray object for mzML/mzCBOR.
A simple container of DataPoint instances.
Definition trace.h:152
simple override of the raw QCborStreamReader This adds convenient functions to put CBOR data into C++...
cvParam map
#define PMSPP_LIB_DECL
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
unsigned int uint
Definition types.h:67
PSI precursor object for mzML/mzCBOR.
PSI scan object for mzML/mzCBOR.
static std::map< QString, pappso::cbor::mzcbor::CvParam > readScanCvParams(CborStreamReader &reader)
Definition spectrum.cpp:278
void toMgf(QTextStream &output, MsRunIdCstSPtr msrun_id_csptr) const
write spectrum in MGF text format
Definition spectrum.cpp:389
std::vector< Precursor > precursorList
Definition spectrum.h:89
std::vector< Scan > scanList
Definition spectrum.h:88
QJsonObject toJsonObject() const
write the structure to a JSON object This is a simplified representation for easy JSON data handling ...
Definition spectrum.cpp:231
void fromCbor(CborStreamReader &reader, bool want_binary_data)
fill the structure reading data from a CBOR stream
Definition spectrum.cpp:43
void decodeTrace(pappso::Trace &trace) const
Definition spectrum.cpp:356
std::vector< BinaryDataArray > binaryDataArrayList
Definition spectrum.h:90