Loading...
Searching...
No Matches
pappso::masschroq::CborOutputStream Class Reference

`#include <cboroutputstream.h>`

## Public Member Functions

| CborOutputStream (QIODevice *device)
virtual | ~CborOutputStream ()
void | setIsTraceOutput (bool is_trace_output)
| set trace output flag
void | setIsPeakShapeOutput (bool is_shape_output, double margin_in_seconds)
| set peak shape output flag
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 Member Functions

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 Attributes

pappso::cbor::CborStreamWriter * | mpa_writer = nullptr
bool | m_isTraceOutput = false
bool | m_isPeakShapeOutput = false
bool | m_isXicCoordOutput = true
double | m_peakShapeMarginInSeconds = 20

## Detailed Description

Todo
  write docs

Definition at line 50 of file cboroutputstream.h.

## Constructor & Destructor Documentation

## CborOutputStream()

pappso::masschroq::CborOutputStream::CborOutputStream | ( | QIODevice * | device | ) |

Default constructor

Definition at line 42 of file cboroutputstream.cpp.

{
mpa_writer = new cbor::CborStreamWriter(device);
mpa_writer->startMap();
}
pappso::masschroq::CborOutputStream::mpa_writer
pappso::cbor::CborStreamWriter * mpa_writer
Definition cboroutputstream.h:113

References mpa_writer.

## ~CborOutputStream()

pappso::masschroq::CborOutputStream::~CborOutputStream | ( |  | ) |

virtual

Destructor

Definition at line 48 of file cboroutputstream.cpp.

{
}

## Member Function Documentation

## close()

void pappso::masschroq::CborOutputStream::close | ( |  | ) |

Definition at line 83 of file cboroutputstream.cpp.

{
writeActionEnd();
mpa_writer->endMap();
delete mpa_writer;
}
pappso::masschroq::CborOutputStream::writeActionEnd
void writeActionEnd()
Definition cboroutputstream.cpp:74

References mpa_writer, and writeActionEnd().

## getCborStreamWriter()

QCborStreamWriter & pappso::masschroq::CborOutputStream::getCborStreamWriter | ( |  | ) |

Definition at line 101 of file cboroutputstream.cpp.

{
return (*mpa_writer);
}

References mpa_writer.

Referenced by pappso::masschroq::JsonInput::action(), pappso::masschroq::MsRunGroup::align(), pappso::masschroq::MsRunGroup::alignRetentionTimeBetweenMsRuns(), pappso::masschroq::MsRunGroup::quantify(), and pappso::masschroq::JsonInput::readAction().

## setIsPeakShapeOutput()

void pappso::masschroq::CborOutputStream::setIsPeakShapeOutput | ( | bool | is_shape_output,
|  | double | margin_in_seconds )

set peak shape output flag

Definition at line 53 of file cboroutputstream.cpp.

{
m_isPeakShapeOutput = is_shape_output;
m_peakShapeMarginInSeconds = margin_in_seconds;
}
pappso::masschroq::CborOutputStream::m_peakShapeMarginInSeconds
double m_peakShapeMarginInSeconds
Definition cboroutputstream.h:118
pappso::masschroq::CborOutputStream::m_isPeakShapeOutput
bool m_isPeakShapeOutput
Definition cboroutputstream.h:115

References m_isPeakShapeOutput, and m_peakShapeMarginInSeconds.

## setIsTraceOutput()

void pappso::masschroq::CborOutputStream::setIsTraceOutput | ( | bool | is_trace_output | ) |

set trace output flag

Definition at line 60 of file cboroutputstream.cpp.

{
m_isTraceOutput = is_trace_output;
}
pappso::masschroq::CborOutputStream::m_isTraceOutput
bool m_isTraceOutput
Definition cboroutputstream.h:114

References m_isTraceOutput.

## writeActionBegin()

void pappso::masschroq::CborOutputStream::writeActionBegin | ( | const QString & | operation | ) |

Definition at line 66 of file cboroutputstream.cpp.

{
mpa_writer->writeInformations(
"masschroq", masschroq::Utils::getVersion(), "quantification", operation);
}
pappso::masschroq::Utils::getVersion
static QString getVersion()
Definition utils.cpp:37

References pappso::masschroq::Utils::getVersion(), and mpa_writer.

Referenced by pappso::masschroq::JsonInput::action().

## writeActionEnd()

void pappso::masschroq::CborOutputStream::writeActionEnd | ( |  | ) |

private

Definition at line 74 of file cboroutputstream.cpp.

{
mpa_writer->append(QLatin1String("end"));
mpa_writer->startMap();
mpa_writer->append(QLatin1String("timestamp"));
mpa_writer->append(QDateTime::currentDateTime().toString(Qt::ISODate));
mpa_writer->endMap();
}

References mpa_writer.

Referenced by close().

## writeJsonObject()

void pappso::masschroq::CborOutputStream::writeJsonObject | ( | const QString & | name,
|  | const QJsonObject & | json_object )

Definition at line 92 of file cboroutputstream.cpp.

{
mpa_writer->append(name);
QCborMap map;
map = map.fromJsonObject(json_object);
map.toCborValue().toCbor(*mpa_writer);
}

References mpa_writer.

Referenced by pappso::masschroq::JsonInput::action().

## writeMbrPeptideMeasurements()

void pappso::masschroq::CborOutputStream::writeMbrPeptideMeasurements | ( | const MbrPeptideMeasurements & | peptide_measurements,
|  | const pappso::MsRunRetentionTime< QString > * | msrun_retention_time_p )

private

Definition at line 300 of file cboroutputstream.cpp.

{
masschroq::PeptideSp peptide_sp = mbr_peptide_measurements.getPeptideSp();
mpa_writer->append(peptide_sp.get()->getId());
mpa_writer->startMap();
mpa_writer->append(QLatin1String("proforma"));
mpa_writer->append(peptide_sp.get()->getPappsoPeptideSp().get()->toProForma());
mpa_writer->append(QLatin1String("mods"));
mpa_writer->append(peptide_sp.get()->getMods());
std::size_t size_measurement = mbr_peptide_measurements.getMeasurementList().size();
if(size_measurement > 0)
{
mpa_writer->append(QLatin1String("rt_target"));
mpa_writer->append(
mbr_peptide_measurements.getMeasurementList().at(0).msp_xicCoord.get()->rtTarget);
}
mpa_writer->append(QLatin1String("xics"));
mpa_writer->startArray(mbr_peptide_measurements.getMeasurementList().size());
for(const masschroq::PeptideMeasurements::Measurement &measure :
mbr_peptide_measurements.getMeasurementList())
{
// write(peptide_sp, measure, msrun_retention_time_p);
writeMeasurement(measure, msrun_retention_time_p);
}
mpa_writer->endArray();
mpa_writer->endMap();
}
pappso::masschroq::CborOutputStream::writeMeasurement
void writeMeasurement(const PeptideMeasurements::Measurement &measurement, const pappso::MsRunRetentionTime< QString > *msrun_retention_time_p)
Definition cboroutputstream.cpp:163
pappso::masschroq::PeptideSp
std::shared_ptr< Peptide > PeptideSp
Definition peptide.h:46

References pappso::masschroq::Peptide::getId(), pappso::masschroq::PeptideMeasurementsBase::getMeasurementList(), pappso::masschroq::Peptide::getMods(), pappso::masschroq::PeptideBase::getPappsoPeptideSp(), pappso::masschroq::MbrPeptideMeasurements::getPeptideSp(), mpa_writer, and writeMeasurement().

Referenced by writeQrDataBlock().

## writeMeasurement()

void pappso::masschroq::CborOutputStream::writeMeasurement | ( | const PeptideMeasurements::Measurement & | measurement,
|  | const pappso::MsRunRetentionTime< QString > * | msrun_retention_time_p )

private

Definition at line 163 of file cboroutputstream.cpp.

{
mpa_writer->startMap();
mpa_writer->append(QLatin1String("charge"));
mpa_writer->append(measurement.m_charge);
mpa_writer->append(QLatin1String("mz"));
mpa_writer->append(measurement.msp_xicCoord.get()->mzRange.getMz());
if(m_isXicCoordOutput)
{
measurement.msp_xicCoord.get()->writeCborStream(*mpa_writer);
}
if(measurement.m_peptideNaturalIsotopeAverageSp.get() != nullptr)
{
mpa_writer->append(QLatin1String("isotope"));
mpa_writer->append(measurement.m_peptideNaturalIsotopeAverageSp.get()->getIsotopeNumber());
mpa_writer->append(QLatin1String("rank"));
mpa_writer->append(measurement.m_peptideNaturalIsotopeAverageSp.get()->getIsotopeRank());
mpa_writer->append(QLatin1String("th_ratio"));
mpa_writer->append(measurement.m_peptideNaturalIsotopeAverageSp.get()->getIntensityRatio());
}
mpa_writer->append(QLatin1String("quality"));
mpa_writer->append(masschroq::Utils::enumToString(measurement.m_peakQualityCategory));
// label
if(measurement.mp_peptideLabel != nullptr)
{
mpa_writer->append(QLatin1String("label"));
mpa_writer->append(measurement.mp_peptideLabel->getLabel());
}
if(m_isTraceOutput && (measurement.msp_xicCoord.get()->xicSptr.get() != nullptr))
{
mpa_writer->append(QLatin1String("trace"));
writeTrace(*(measurement.msp_xicCoord.get()->xicSptr.get()));
}
if(measurement.m_tracePeakSp.get() != nullptr)
{
if(m_isPeakShapeOutput && (measurement.msp_xicCoord.get()->xicSptr.get() != nullptr))
{
mpa_writer->append(QLatin1String("peak_shape"));
mpa_writer->startMap();
mpa_writer->append(QLatin1String("trace"));
TraceSPtr trace_sp;
FilterResampleKeepXRange cut_xic(
measurement.m_tracePeakSp.get()->getLeftBoundary().x - m_peakShapeMarginInSeconds,
measurement.m_tracePeakSp.get()->getRightBoundary().x + m_peakShapeMarginInSeconds);
trace_sp = measurement.msp_xicCoord.get()->xicSptr;
trace_sp.get()->filter(cut_xic);
writeTrace(*(trace_sp.get()));
mpa_writer->endMap();
}
mpa_writer->append(QLatin1String("peak"));
writeTracePeak(*(measurement.m_tracePeakSp.get()), msrun_retention_time_p);
}
mpa_writer->endMap();
}
pappso::masschroq::CborOutputStream::writeTrace
void writeTrace(const pappso::Trace &trace)
Definition cboroutputstream.cpp:242
pappso::masschroq::CborOutputStream::m_isXicCoordOutput
bool m_isXicCoordOutput
Definition cboroutputstream.h:116
pappso::masschroq::CborOutputStream::writeTracePeak
void writeTracePeak(const pappso::TracePeak &peak, const pappso::MsRunRetentionTime< QString > *msrun_retention_time_p)
Definition cboroutputstream.cpp:265
pappso::masschroq::Utils::enumToString
static QString enumToString(PeakQualityCategory peak_category)
Convenience function to return a string describing the specglob alingment type.
Definition utils.cpp:44
pappso::TraceSPtr
std::shared_ptr< Trace > TraceSPtr
Definition trace.h:139

References pappso::masschroq::Utils::enumToString(), pappso::masschroq::PeptideLabel::getLabel(), pappso::masschroq::PeptideMeasurementsBase::Measurement::m_charge, m_isPeakShapeOutput, m_isTraceOutput, m_isXicCoordOutput, pappso::masschroq::PeptideMeasurementsBase::Measurement::m_peakQualityCategory, m_peakShapeMarginInSeconds, pappso::masschroq::PeptideMeasurementsBase::Measurement::m_peptideNaturalIsotopeAverageSp, pappso::masschroq::PeptideMeasurementsBase::Measurement::m_tracePeakSp, pappso::masschroq::PeptideMeasurementsBase::Measurement::mp_peptideLabel, mpa_writer, pappso::masschroq::PeptideMeasurementsBase::Measurement::msp_xicCoord, writeTrace(), and writeTracePeak().

Referenced by writeMbrPeptideMeasurements(), and writePeptideMeasurements().

## writeMsRun()

void pappso::masschroq::CborOutputStream::writeMsRun | ( | const MsRun & | msrun | ) |

private

Definition at line 108 of file cboroutputstream.cpp.

{
mpa_writer->append(QLatin1String("msrun"));
mpa_writer->startMap(3);
mpa_writer->append(QLatin1String("id"));
mpa_writer->append(msrun.getMsRunReaderSPtr().get()->getMsRunId().get()->getXmlId());
mpa_writer->append(QLatin1String("filename"));
mpa_writer->append(msrun.getMsRunReaderSPtr().get()->getMsRunId().get()->getFileName());
mpa_writer->append(QLatin1String("sample"));
mpa_writer->append(msrun.getMsRunReaderSPtr().get()->getMsRunId().get()->getSampleName());
mpa_writer->endMap();
}

References pappso::masschroq::MsRun::getMsRunReaderSPtr(), and mpa_writer.

Referenced by writeQrDataBlock().

## writeMsRunRetentionTime()

void pappso::masschroq::CborOutputStream::writeMsRunRetentionTime | ( | const pappso::Trace & | report_common_ms2,
|  | const pappso::MsRunRetentionTime< QString > & | msrun_retention_time )

Definition at line 430 of file cboroutputstream.cpp.

{
mpa_writer->startMap(5);
mpa_writer->append(QLatin1String("original"));
writeVectorDouble(msrun_retention_time.getMs1RetentionTimeVector());
mpa_writer->append(QLatin1String("aligned"));
writeVectorDouble(msrun_retention_time.getAlignedRetentionTimeVector());
mpa_writer->append(QLatin1String("ms2_delta_rt"));
writeTrace(report_common_ms2);
Trace median(report_common_ms2);
msrun_retention_time.getMs2MedianFilter().filter(median);
mpa_writer->append(QLatin1String("ms2_median"));
writeVectorDouble(median.yValues());
msrun_retention_time.getMs2MeanFilter().filter(median);
mpa_writer->append(QLatin1String("ms2_mean"));
writeVectorDouble(median.yValues());
mpa_writer->endMap();
}
pappso::FilterMorphoWindowBase::filter
virtual Trace & filter(Trace &data_points) const override
Definition filtermorpho.cpp:78
pappso::MsRunRetentionTime::getMs2MedianFilter
const FilterMorphoMedian & getMs2MedianFilter() const
Definition msrunretentiontime.cpp:72
pappso::MsRunRetentionTime::getAlignedRetentionTimeVector
const std::vector< double > & getAlignedRetentionTimeVector() const
get aligned retention time vector
Definition msrunretentiontime.cpp:123
pappso::MsRunRetentionTime::getMs1RetentionTimeVector
const std::vector< double > & getMs1RetentionTimeVector() const
get orginal retention time vector (not aligned)
Definition msrunretentiontime.cpp:136
pappso::MsRunRetentionTime::getMs2MeanFilter
const FilterMorphoMean & getMs2MeanFilter() const
Definition msrunretentiontime.cpp:86
pappso::masschroq::CborOutputStream::writeVectorDouble
void writeVectorDouble(const std::vector< double > &vector)
Definition cboroutputstream.cpp:413

References pappso::FilterMorphoWindowBase::filter(), pappso::MsRunRetentionTime< T >::getAlignedRetentionTimeVector(), pappso::MsRunRetentionTime< T >::getMs1RetentionTimeVector(), pappso::MsRunRetentionTime< T >::getMs2MeanFilter(), pappso::MsRunRetentionTime< T >::getMs2MedianFilter(), mpa_writer, writeTrace(), writeVectorDouble(), and pappso::Trace::yValues().

Referenced by pappso::masschroq::MsRunGroup::alignRetentionTimeBetweenMsRuns().

## writePeptideMeasurements()

void pappso::masschroq::CborOutputStream::writePeptideMeasurements | ( | const PeptideMeasurements & | peptide_measurements,
|  | const pappso::MsRunRetentionTime< QString > * | msrun_retention_time_p )

private

Definition at line 123 of file cboroutputstream.cpp.

{
masschroq::PeptideSp peptide_sp =
peptide_measurements.getPeptideObservationSp().get()->getPeptideSp();
mpa_writer->append(peptide_sp.get()->getId());
mpa_writer->startMap();
// mpa_writer->append(QLatin1String("peptide_id"));
// mpa_writer->append(peptide_sp.get()->getId());
mpa_writer->append(QLatin1String("proforma"));
mpa_writer->append(peptide_sp.get()->getPappsoPeptideSp().get()->toProForma());
mpa_writer->append(QLatin1String("mods"));
mpa_writer->append(peptide_sp.get()->getMods());
std::size_t size_measurement = peptide_measurements.getMeasurementList().size();
if(size_measurement > 0)
{
mpa_writer->append(QLatin1String("rt_target"));
mpa_writer->append(
peptide_measurements.getMeasurementList().at(0).msp_xicCoord.get()->rtTarget);
}
mpa_writer->append(QLatin1String("xics"));
mpa_writer->startArray(size_measurement);
for(const masschroq::PeptideMeasurements::Measurement &measure :
peptide_measurements.getMeasurementList())
{
// write(peptide_sp, measure, msrun_retention_time_p);
writeMeasurement(measure, msrun_retention_time_p);
}
mpa_writer->endArray();
mpa_writer->endMap();
}

References pappso::masschroq::Peptide::getId(), pappso::masschroq::PeptideMeasurementsBase::getMeasurementList(), pappso::masschroq::Peptide::getMods(), pappso::masschroq::PeptideBase::getPappsoPeptideSp(), pappso::masschroq::PeptideMeasurements::getPeptideObservationSp(), pappso::masschroq::PeptideObservation::getPeptideSp(), mpa_writer, and writeMeasurement().

Referenced by writeQrDataBlock().

## writeProjectParameters()

void pappso::masschroq::CborOutputStream::writeProjectParameters | ( | const pappso::ProjectParameters & | project_parameters | ) |

Definition at line 424 of file cboroutputstream.cpp.

{
project_parameters.writeParameters(*mpa_writer);
}
pappso::ProjectParameters::writeParameters
void writeParameters(CalcWriterInterface &writer) const
Definition projectparameters.cpp:208

References mpa_writer, and pappso::ProjectParameters::writeParameters().

Referenced by pappso::masschroq::JsonInput::action().

## writeQrDataBlock()

void pappso::masschroq::CborOutputStream::writeQrDataBlock | ( | pappso::UiMonitorInterface & | m_uiMonitor,
|  | const MsRunPeptideList & | msrun_peptide_list,
|  | bool | is_mbr )

Definition at line 338 of file cboroutputstream.cpp.

{
quint64 size;
if(is_mbr)
{
size = msrun_peptide_list.getMbrPeptideMeasurementsList().size();
monitor.setStatus(QString("Writing MBR quantification results for msrun %1")
.arg(msrun_peptide_list.getMsRunSp()
.get()
->getMsRunReaderSPtr()
.get()
->getMsRunId()
.get()
->getSampleName()));
}
else
{
size = msrun_peptide_list.getPeptideMeasurementsList().size();
monitor.setStatus(QString("Writing quantification results for msrun %1")
.arg(msrun_peptide_list.getMsRunSp()
.get()
->getMsRunReaderSPtr()
.get()
->getMsRunId()
.get()
->getSampleName()));
}
monitor.setTotalSteps(size);
mpa_writer->append(msrun_peptide_list.getMsRunSp()
.get()
->getMsRunReaderSPtr()
.get()
->getMsRunId()
.get()
->getXmlId());
mpa_writer->startMap();
writeMsRun(*(msrun_peptide_list.getMsRunSp().get()));
mpa_writer->append("peptide_measurements");
mpa_writer->startMap(size);
if(is_mbr)
{
for(const masschroq::MbrPeptideMeasurementsSp &measures :
msrun_peptide_list.getMbrPeptideMeasurementsList())
{
writeMbrPeptideMeasurements(*(measures.get()),
msrun_peptide_list.getMsRunRetentionTimeConstPtr());
monitor.count();
}
}
else
{
for(const masschroq::PeptideMeasurementsSp &measures :
msrun_peptide_list.getPeptideMeasurementsList())
{
writePeptideMeasurements(*(measures.get()),
msrun_peptide_list.getMsRunRetentionTimeConstPtr());
monitor.count();
}
}
monitor.setTotalSteps(0);
mpa_writer->endMap();
mpa_writer->endMap();
}
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::writeMsRun
void writeMsRun(const MsRun &msrun)
Definition cboroutputstream.cpp:108
pappso::masschroq::CborOutputStream::writePeptideMeasurements
void writePeptideMeasurements(const PeptideMeasurements &peptide_measurements, const pappso::MsRunRetentionTime< QString > *msrun_retention_time_p)
Definition cboroutputstream.cpp:123
pappso::masschroq::PeptideMeasurementsSp
std::shared_ptr< PeptideMeasurements > PeptideMeasurementsSp
Definition peptidemeasurements.h:50
pappso::masschroq::MbrPeptideMeasurementsSp
std::shared_ptr< MbrPeptideMeasurements > MbrPeptideMeasurementsSp
Definition mbrpeptidemeasurements.h:44

References pappso::UiMonitorInterface::count(), pappso::masschroq::MsRunPeptideList::getMbrPeptideMeasurementsList(), pappso::masschroq::MsRun::getMsRunReaderSPtr(), pappso::masschroq::MsRunPeptideList::getMsRunRetentionTimeConstPtr(), pappso::masschroq::MsRunPeptideList::getMsRunSp(), pappso::masschroq::MsRunPeptideList::getPeptideMeasurementsList(), mpa_writer, pappso::UiMonitorInterface::setStatus(), pappso::UiMonitorInterface::setTotalSteps(), writeMbrPeptideMeasurements(), writeMsRun(), and writePeptideMeasurements().

Referenced by pappso::masschroq::MsRunGroup::quantify().

## writeTrace()

void pappso::masschroq::CborOutputStream::writeTrace | ( | const pappso::Trace & | trace | ) |

private

Definition at line 242 of file cboroutputstream.cpp.

{
mpa_writer->startMap(2);
mpa_writer->append(QLatin1String("x"));
mpa_writer->startArray(trace.size());
for(double x : trace.xValues())
{
mpa_writer->append(x);
}
mpa_writer->endArray();
mpa_writer->append(QLatin1String("y"));
mpa_writer->startArray(trace.size());
for(double y : trace.yValues())
{
mpa_writer->append(y);
}
mpa_writer->endArray();
mpa_writer->endMap();
}
pappso::Trace::xValues
std::vector< pappso_double > xValues() const
Definition trace.cpp:697
pappso::Trace::yValues
std::vector< pappso_double > yValues() const
Definition trace.cpp:711
pappso::PeptideIonCter::y
@ y
Definition peptide.h:87
pappso::PeptideIonCter::x
@ x
Definition peptide.h:92

References mpa_writer, pappso::x, pappso::Trace::xValues(), pappso::y, and pappso::Trace::yValues().

Referenced by writeMeasurement(), and writeMsRunRetentionTime().

## writeTracePeak()

void pappso::masschroq::CborOutputStream::writeTracePeak | ( | const pappso::TracePeak & | peak,
|  | const pappso::MsRunRetentionTime< QString > * | msrun_retention_time_p )

private

Definition at line 265 of file cboroutputstream.cpp.

{
mpa_writer->startMap();
mpa_writer->append(QLatin1String("area"));
mpa_writer->append(peak.getArea());
mpa_writer->append(QLatin1String("max_intensity"));
mpa_writer->append(peak.getMaxXicElement().y);
mpa_writer->append(QLatin1String("rt"));
mpa_writer->startArray();
mpa_writer->append(peak.getLeftBoundary().x);
mpa_writer->append(peak.getMaxXicElement().x);
mpa_writer->append(peak.getRightBoundary().x);
mpa_writer->endArray();
if((msrun_retention_time_p != nullptr) && msrun_retention_time_p->isAligned())
{
mpa_writer->append(QLatin1String("aligned_rt"));
mpa_writer->startArray();
mpa_writer->append(
msrun_retention_time_p->translateOriginal2AlignedRetentionTime(peak.getLeftBoundary().x));
mpa_writer->append(
msrun_retention_time_p->translateOriginal2AlignedRetentionTime(peak.getMaxXicElement().x));
mpa_writer->append(
msrun_retention_time_p->translateOriginal2AlignedRetentionTime(peak.getRightBoundary().x));
mpa_writer->endArray();
}
mpa_writer->endMap();
}
pappso::MsRunRetentionTime::isAligned
bool isAligned() const
Definition msrunretentiontime.cpp:395
pappso::MsRunRetentionTime::translateOriginal2AlignedRetentionTime
double translateOriginal2AlignedRetentionTime(double original_retention_time) const
Definition msrunretentiontime.cpp:288
pappso::TracePeak::getLeftBoundary
DataPoint & getLeftBoundary()
Definition tracepeak.cpp:93
pappso::TracePeak::getArea
pappso_double getArea() const
Definition tracepeak.cpp:119
pappso::TracePeak::getMaxXicElement
DataPoint & getMaxXicElement()
Definition tracepeak.cpp:83
pappso::TracePeak::getRightBoundary
DataPoint & getRightBoundary()
Definition tracepeak.cpp:104
pappso::DataPoint::x
pappso_double x
Definition datapoint.h:24
pappso::DataPoint::y
pappso_double y
Definition datapoint.h:25

References pappso::TracePeak::getArea(), pappso::TracePeak::getLeftBoundary(), pappso::TracePeak::getMaxXicElement(), pappso::TracePeak::getRightBoundary(), pappso::MsRunRetentionTime< T >::isAligned(), mpa_writer, pappso::MsRunRetentionTime< T >::translateOriginal2AlignedRetentionTime(), pappso::DataPoint::x, and pappso::DataPoint::y.

Referenced by writeMeasurement().

## writeVectorDouble()

void pappso::masschroq::CborOutputStream::writeVectorDouble | ( | const std::vector< double > & | vector | ) |

private

Definition at line 413 of file cboroutputstream.cpp.

{
mpa_writer->startArray(vector.size());
for(double x : vector)
{
mpa_writer->append(x);
}
mpa_writer->endArray();
}

References mpa_writer, and pappso::x.

Referenced by writeMsRunRetentionTime().

## Member Data Documentation

## m_isPeakShapeOutput

bool pappso::masschroq::CborOutputStream::m_isPeakShapeOutput = false

private

Definition at line 115 of file cboroutputstream.h.

Referenced by setIsPeakShapeOutput(), and writeMeasurement().

## m_isTraceOutput

bool pappso::masschroq::CborOutputStream::m_isTraceOutput = false

private

Definition at line 114 of file cboroutputstream.h.

Referenced by setIsTraceOutput(), and writeMeasurement().

## m_isXicCoordOutput

bool pappso::masschroq::CborOutputStream::m_isXicCoordOutput = true

private

Definition at line 116 of file cboroutputstream.h.

Referenced by writeMeasurement().

## m_peakShapeMarginInSeconds

double pappso::masschroq::CborOutputStream::m_peakShapeMarginInSeconds = 20

private

Definition at line 118 of file cboroutputstream.h.

Referenced by setIsPeakShapeOutput(), and writeMeasurement().

## mpa_writer

pappso::cbor::CborStreamWriter* pappso::masschroq::CborOutputStream::mpa_writer = nullptr

private

Definition at line 113 of file cboroutputstream.h.

Referenced by CborOutputStream(), close(), getCborStreamWriter(), writeActionBegin(), writeActionEnd(), writeJsonObject(), writeMbrPeptideMeasurements(), writeMeasurement(), writeMsRun(), writeMsRunRetentionTime(), writePeptideMeasurements(), writeProjectParameters(), writeQrDataBlock(), writeTrace(), writeTracePeak(), and writeVectorDouble().

The documentation for this class was generated from the following files:

- pappsomspp/core/masschroq/output/cboroutputstream.h
- pappsomspp/core/masschroq/output/cboroutputstream.cpp