Loading...
Searching...
No Matches
pappso::MgfOutput Class Reference

`#include <mgfoutput.h>`

## Public Member Functions

| MgfOutput (QIODevice *p_output_device)
void | write (const QualifiedMassSpectrum &mass_spectrum)
void | close ()
virtual | ~MgfOutput ()

## Private Attributes

QTextStream * | mpa_outputStream

## Detailed Description

Todo
  write docs

Definition at line 39 of file mgfoutput.h.

## Constructor & Destructor Documentation

## MgfOutput()

MgfOutput::MgfOutput | ( | QIODevice * | p_output_device | ) |

Default constructor

Definition at line 5 of file mgfoutput.cpp.

{
mpa_outputStream = new QTextStream(p_output_device);
}
pappso::MgfOutput::mpa_outputStream
QTextStream * mpa_outputStream
Definition mgfoutput.h:55

References mpa_outputStream.

## ~MgfOutput()

MgfOutput::~MgfOutput | ( |  | ) |

virtual

Destructor

Definition at line 11 of file mgfoutput.cpp.

{
}

## Member Function Documentation

## close()

void MgfOutput::close | ( |  | ) |

Definition at line 50 of file mgfoutput.cpp.

{
mpa_outputStream->flush();
}

References mpa_outputStream.

## write()

void MgfOutput::write | ( | const QualifiedMassSpectrum & | mass_spectrum | ) |

Definition at line 16 of file mgfoutput.cpp.

{
/*
* BEGIN IONS
TITLE=20120906_balliau_extract_1_A01_urnb-1.15968.15968.2
RTINSECONDS=2843.58
PEPMASS=638.36934732588 270659.09375
CHARGE=2+
89.01705933 1255.7088623047
89.06031799 258758.140625
90.06361389 12425.6162109375
*/
*mpa_outputStream << "BEGIN IONS" << Qt::endl;
*mpa_outputStream << "TITLE="
<< mass_spectrum.getMassSpectrumId().getMsRunIdCstSPtr().get()->getSampleName()
<< "." << mass_spectrum.getMassSpectrumId().getSpectrumIndex() << Qt::endl;
*mpa_outputStream << "RTINSECONDS=" << QString::number(mass_spectrum.getRtInSeconds(), 'f', 2)
<< Qt::endl;
*mpa_outputStream << "PEPMASS=" << QString::number(mass_spectrum.getPrecursorMz(), 'g', 15) << " "
<< QString::number(mass_spectrum.getPrecursorIntensity(), 'f', 5) << Qt::endl;
*mpa_outputStream << "CHARGE=" << mass_spectrum.getPrecursorCharge() << "+" << Qt::endl;
if(mass_spectrum.getMassSpectrumCstSPtr() != nullptr)
{
for(auto &&peak : *(mass_spectrum.getMassSpectrumCstSPtr().get()))
{
*mpa_outputStream << QString::number(peak.x, 'g', 15) << " "
<< QString::number(peak.y, 'g', 15) << Qt::endl;
}
}
*mpa_outputStream << "END IONS" << Qt::endl;
}
pappso::MassSpectrumId::getSpectrumIndex
std::size_t getSpectrumIndex() const
Definition massspectrumid.cpp:113
pappso::MassSpectrumId::getMsRunIdCstSPtr
const MsRunIdCstSPtr & getMsRunIdCstSPtr() const
Definition massspectrumid.cpp:85
pappso::MsRunId::getSampleName
const QString & getSampleName() const
Definition msrunid.cpp:84
pappso::QualifiedMassSpectrum::getMassSpectrumCstSPtr
MassSpectrumCstSPtr getMassSpectrumCstSPtr() const
Get the MassSpectrumCstSPtr.
Definition qualifiedmassspectrum.cpp:138
pappso::QualifiedMassSpectrum::getPrecursorCharge
uint getPrecursorCharge(bool *ok=nullptr) const
get precursor charge
Definition qualifiedmassspectrum.cpp:336
pappso::QualifiedMassSpectrum::getPrecursorIntensity
pappso_double getPrecursorIntensity(bool *ok=nullptr) const
get precursor intensity
Definition qualifiedmassspectrum.cpp:396
pappso::QualifiedMassSpectrum::getMassSpectrumId
const MassSpectrumId & getMassSpectrumId() const
Get the MassSpectrumId.
Definition qualifiedmassspectrum.cpp:154
pappso::QualifiedMassSpectrum::getPrecursorMz
pappso_double getPrecursorMz(bool *ok=nullptr) const
get precursor mz
Definition qualifiedmassspectrum.cpp:240
pappso::QualifiedMassSpectrum::getRtInSeconds
pappso_double getRtInSeconds() const
Get the retention time in seconds.
Definition qualifiedmassspectrum.cpp:205

References pappso::QualifiedMassSpectrum::getMassSpectrumCstSPtr(), pappso::QualifiedMassSpectrum::getMassSpectrumId(), pappso::MassSpectrumId::getMsRunIdCstSPtr(), pappso::QualifiedMassSpectrum::getPrecursorCharge(), pappso::QualifiedMassSpectrum::getPrecursorIntensity(), pappso::QualifiedMassSpectrum::getPrecursorMz(), pappso::QualifiedMassSpectrum::getRtInSeconds(), pappso::MsRunId::getSampleName(), pappso::MassSpectrumId::getSpectrumIndex(), and mpa_outputStream.

## Member Data Documentation

## mpa_outputStream

QTextStream* pappso::MgfOutput::mpa_outputStream

private

Definition at line 55 of file mgfoutput.h.

Referenced by MgfOutput(), close(), and write().

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

- pappsomspp/core/msrun/output/mgfoutput.h
- pappsomspp/core/msrun/output/mgfoutput.cpp