Loading...
Searching...
No Matches
spectrum.h
Go to the documentation of this file.
/**
* \file pappsomspp/core/processing/cbor/mzcbor/spectrum.h
* \date 24/11/2025
* \author Olivier Langella
* \brief PSI spectrum object for mzML/mzCBOR
*/
/*******************************************************************************
* Copyright (c) 2025 Olivier Langella <Olivier.Langella@universite-paris-saclay.fr>.
*
* This file is part of PAPPSOms-tools.
*
* PAPPSOms-tools is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PAPPSOms-tools is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PAPPSOms-tools. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include <QString>
#include <qdebug.h>
#include "pappsomspp/core/msrun/msrunid.h"
#include "pappsomspp/core/trace/trace.h"
#include "pappsomspp/core/processing/cbor/cborstreamreader.h"
#include "pappsomspp/core/processing/cbor/mzcbor/cvparammap.h"
#include "pappsomspp/core/processing/cbor/mzcbor/scan.h"
#include "pappsomspp/core/processing/cbor/mzcbor/precursor.h"
#include "pappsomspp/core/processing/cbor/mzcbor/binarydataarray.h"
#include "pappsomspp/export-import-config.h"
namespace pappso
{
namespace cbor
{
namespace mzcbor
{
/**
* @todo write docs
*/
struct PMSPP_LIB_DECL Spectrum
{
/** @brief fill the structure reading data from a CBOR stream
* @param reader CBOR stream
* @param want_binary_data if true, stores also binary data array list
*/
void fromCbor(CborStreamReader &reader, bool want_binary_data);
/** @brief write the structure to a JSON object
* This is a simplified representation for easy JSON data handling
* binary arrays are decoded in simple traces
* @result QJsonObject
*/
QJsonObject toJsonObject() const;
/** @brief write spectrum in MGF text format
*/
void toMgf(QTextStream &output, MsRunIdCstSPtr msrun_id_csptr) const;
static std::map<QString, pappso::cbor::mzcbor::CvParam>
readScanCvParams(CborStreamReader &reader);
void decodeTrace(pappso::Trace &trace) const;
uint getMsLevel() const;
double getRtInSeconds() const;
qint64 getTotalIonCount() const;
QString id;
std::size_t index;
std::size_t defaultArrayLength;
CvParamMap cvParamMap;
CvParamMap scanListCvParamMap;
CvParamMap precursorListCvParamMap;
// QCborMap cborScanList;
std::vector<Scan> scanList;
std::vector<Precursor> precursorList;
std::vector<BinaryDataArray> binaryDataArrayList;
// QCborMap cborBinaryDataArray;
};
} // namespace mzcbor
} // namespace cbor
} // 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:46
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