Loading...
Searching...
No Matches
cboroutputstream.h
Go to the documentation of this file.
/**
* \file pappsomspp/masschroq/output/cboroutputstream.h
* \date 02/01/2025
* \author Olivier Langella
* \brief quantification result cbor writer for MassChroqLight
*/
/*******************************************************************************
* Copyright (c) 2025 Olivier Langella
*<Olivier.Langella@universite-paris-saclay.fr>.
*
* This file is part of MassChroQ.
*
* MassChroQ 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.
*
* MassChroQ 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 MassChroQ. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include <QStringList>
#include "pappsomspp/core/processing/cbor/cborstreamwriter.h"
#include <QJsonObject>
#include "../msrun.h"
#include "../msrunpeptidelist.h"
#include "../peptidemeasurements.h"
#include "../mbrpeptidemeasurements.h"
#include "pappsomspp/core/msrun/alignment/msrunretentiontime.h"
#include "pappsomspp/core/processing/project/projectparameters.h"
#include "pappsomspp/export-import-config.h"
namespace pappso::masschroq
{
/**
* @todo write docs
*/
class PMSPP_LIB_DECL CborOutputStream
{
public:
/**
* Default constructor
*/
CborOutputStream(QIODevice *device);
/**
* Destructor
*/
virtual ~CborOutputStream();
/** @brief set trace output flag
* */
void setIsTraceOutput(bool is_trace_output);
/** @brief set peak shape output flag
* */
void setIsPeakShapeOutput(bool is_shape_output, double margin_in_seconds);
void writeJsonObject(const QString &name, const QJsonObject &json_object);
void writeProjectParameters(const pappso::ProjectParameters &project_parameters);
void writeActionBegin(const QString &operation);
void close();
QCborStreamWriter &getCborStreamWriter();
void writeQrDataBlock(pappso::UiMonitorInterface &m_uiMonitor,
const MsRunPeptideList &msrun_peptide_list,
bool is_mbr);
void writeMsRunRetentionTime(const pappso::Trace &report_common_ms2,
const pappso::MsRunRetentionTime<QString> &msrun_retention_time);
private:
void
writeMbrPeptideMeasurements(const MbrPeptideMeasurements &peptide_measurements,
const pappso::MsRunRetentionTime<QString> *msrun_retention_time_p);
void writeMeasurement(const PeptideMeasurements::Measurement &measurement,
const pappso::MsRunRetentionTime<QString> *msrun_retention_time_p);
void writeTrace(const pappso::Trace &trace);
void writeVectorDouble(const std::vector<double> &vector);
void writeTracePeak(const pappso::TracePeak &peak,
const pappso::MsRunRetentionTime<QString> *msrun_retention_time_p);
void writeActionEnd();
void writeMsRun(const MsRun &msrun);
void writePeptideMeasurements(const PeptideMeasurements &peptide_measurements,
const pappso::MsRunRetentionTime<QString> *msrun_retention_time_p);
private:
pappso::cbor::CborStreamWriter *mpa_writer = nullptr;
bool m_isTraceOutput = false;
bool m_isPeakShapeOutput = false;
bool m_isXicCoordOutput = true;
double m_peakShapeMarginInSeconds = 20;
};
} // namespace pappso::masschroq
cborstreamwriter.h
pappso::MsRunRetentionTime
Definition msrunretentiontime.h:43
pappso::ProjectParameters
Definition projectparameters.h:66
pappso::TracePeak
Definition tracepeak.h:40
pappso::Trace
A simple container of DataPoint instances.
Definition trace.h:152
pappso::UiMonitorInterface
Definition uimonitorinterface.h:50
pappso::cbor::CborStreamWriter
overrides QCborStreamWriter base class to provide convenient functions
Definition cborstreamwriter.h:45
pappso::masschroq::CborOutputStream::m_peakShapeMarginInSeconds
double m_peakShapeMarginInSeconds
Definition cboroutputstream.h:118
pappso::masschroq::CborOutputStream::close
void close()
Definition cboroutputstream.cpp:83
pappso::masschroq::CborOutputStream::setIsTraceOutput
void setIsTraceOutput(bool is_trace_output)
set trace output flag
Definition cboroutputstream.cpp:60
pappso::masschroq::CborOutputStream::writeMbrPeptideMeasurements
void writeMbrPeptideMeasurements(const MbrPeptideMeasurements &peptide_measurements, const pappso::MsRunRetentionTime< QString > *msrun_retention_time_p)
Definition cboroutputstream.cpp:300
pappso::masschroq::CborOutputStream::setIsPeakShapeOutput
void setIsPeakShapeOutput(bool is_shape_output, double margin_in_seconds)
set peak shape output flag
Definition cboroutputstream.cpp:53
pappso::masschroq::CborOutputStream::m_isPeakShapeOutput
bool m_isPeakShapeOutput
Definition cboroutputstream.h:115
pappso::masschroq::CborOutputStream::mpa_writer
pappso::cbor::CborStreamWriter * mpa_writer
Definition cboroutputstream.h:113
pappso::masschroq::CborOutputStream::writeJsonObject
void writeJsonObject(const QString &name, const QJsonObject &json_object)
Definition cboroutputstream.cpp:92
pappso::masschroq::CborOutputStream::writeTrace
void writeTrace(const pappso::Trace &trace)
Definition cboroutputstream.cpp:242
pappso::masschroq::CborOutputStream::m_isTraceOutput
bool m_isTraceOutput
Definition cboroutputstream.h:114
pappso::masschroq::CborOutputStream::writeMeasurement
void writeMeasurement(const PeptideMeasurements::Measurement &measurement, const pappso::MsRunRetentionTime< QString > *msrun_retention_time_p)
Definition cboroutputstream.cpp:163
pappso::masschroq::CborOutputStream::writeProjectParameters
void writeProjectParameters(const pappso::ProjectParameters &project_parameters)
Definition cboroutputstream.cpp:424
pappso::masschroq::CborOutputStream::writeActionEnd
void writeActionEnd()
Definition cboroutputstream.cpp:74
pappso::masschroq::CborOutputStream::getCborStreamWriter
QCborStreamWriter & getCborStreamWriter()
Definition cboroutputstream.cpp:101
pappso::masschroq::CborOutputStream::writeMsRunRetentionTime
void writeMsRunRetentionTime(const pappso::Trace &report_common_ms2, const pappso::MsRunRetentionTime< QString > &msrun_retention_time)
Definition cboroutputstream.cpp:430
pappso::masschroq::CborOutputStream::writeMsRun
void writeMsRun(const MsRun &msrun)
Definition cboroutputstream.cpp:108
pappso::masschroq::CborOutputStream::m_isXicCoordOutput
bool m_isXicCoordOutput
Definition cboroutputstream.h:116
pappso::masschroq::CborOutputStream::writeVectorDouble
void writeVectorDouble(const std::vector< double > &vector)
Definition cboroutputstream.cpp:413
pappso::masschroq::CborOutputStream::writeActionBegin
void writeActionBegin(const QString &operation)
Definition cboroutputstream.cpp:66
pappso::masschroq::CborOutputStream::CborOutputStream
CborOutputStream(QIODevice *device)
Definition cboroutputstream.cpp:42
pappso::masschroq::CborOutputStream::writeTracePeak
void writeTracePeak(const pappso::TracePeak &peak, const pappso::MsRunRetentionTime< QString > *msrun_retention_time_p)
Definition cboroutputstream.cpp:265
pappso::masschroq::CborOutputStream::writeQrDataBlock
void writeQrDataBlock(pappso::UiMonitorInterface &m_uiMonitor, const MsRunPeptideList &msrun_peptide_list, bool is_mbr)
Definition cboroutputstream.cpp:338
pappso::masschroq::CborOutputStream::writePeptideMeasurements
void writePeptideMeasurements(const PeptideMeasurements &peptide_measurements, const pappso::MsRunRetentionTime< QString > *msrun_retention_time_p)
Definition cboroutputstream.cpp:123
pappso::masschroq::MbrPeptideMeasurements
Definition mbrpeptidemeasurements.h:49
pappso::masschroq::MsRunPeptideList
Definition msrunpeptidelist.h:54
pappso::masschroq::MsRun
Definition msrun.h:50
pappso::masschroq::PeptideMeasurements
Definition peptidemeasurements.h:58
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
mbrpeptidemeasurements.h
msrun.h
msrunpeptidelist.h
msrunretentiontime.h
pappso::masschroq
Definition alignmentmethod.h:38
peptidemeasurements.h
projectparameters.h
pappso::masschroq::PeptideMeasurementsBase::Measurement
Definition peptidemeasurementsbase.h:74