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

`#include <wraptandemresults.h>`

Inheritance diagram for pappso::WrapTandemResults:

## Public Member Functions

| WrapTandemResults (const QString &final_tandem_output, const QString &original_msdata_file_name)
virtual | ~WrapTandemResults ()
void | setInputParameters (const QString &label_name_attribute, const QString &input_value)
Public Member Functions inherited from pappso::XmlStreamReaderInterface
| XmlStreamReaderInterface ()
virtual | ~XmlStreamReaderInterface ()
virtual bool | readFile (const QString &fileName)
bool | read (QIODevice *device)
bool | read (const QString &xml_content)
QString | errorString () const

## Protected Member Functions

virtual void | readStream () override
Protected Member Functions inherited from pappso::XmlStreamReaderInterface
void | cloneStartElement (QXmlStreamWriter &output) const
void | cloneElement (QXmlStreamWriter &output)
void | cloneNode (QXmlStreamWriter &output)

## Private Member Functions

void | process_group_note ()

## Private Attributes

QFile | m_destinationTandemOutputFile
QXmlStreamWriter | m_writerXmlTandemOutput
QString | m_originalMsDataFileName
std::map< QString, QString > | m_mapTandemInputParameters

## Additional Inherited Members

Protected Attributes inherited from pappso::XmlStreamReaderInterface
QXmlStreamReader | m_qxmlStreamReader

## Detailed Description

Todo
  write docs

Definition at line 42 of file wraptandemresults.h.

## Constructor & Destructor Documentation

## WrapTandemResults()

pappso::WrapTandemResults::WrapTandemResults | ( | const QString & | final_tandem_output,
|  | const QString & | original_msdata_file_name )

Default constructor

Definition at line 36 of file wraptandemresults.cpp.

: m_destinationTandemOutputFile(final_tandem_output)
{
qDebug() << final_tandem_output;
m_originalMsDataFileName = QFileInfo(original_msdata_file_name).absoluteFilePath();
if(!m_destinationTandemOutputFile.open(QIODevice::WriteOnly))
{
throw pappso::PappsoException(
QObject::tr("ERROR: unable to open %1 to write XML output").arg(final_tandem_output));
}
m_writerXmlTandemOutput.setDevice(&m_destinationTandemOutputFile);
m_writerXmlTandemOutput.writeStartDocument("1.0");
m_writerXmlTandemOutput.setAutoFormatting(true);
}
pappso::WrapTandemResults::m_destinationTandemOutputFile
QFile m_destinationTandemOutputFile
Definition wraptandemresults.h:67
pappso::WrapTandemResults::m_writerXmlTandemOutput
QXmlStreamWriter m_writerXmlTandemOutput
Definition wraptandemresults.h:68
pappso::WrapTandemResults::m_originalMsDataFileName
QString m_originalMsDataFileName
Definition wraptandemresults.h:69

References m_destinationTandemOutputFile, m_originalMsDataFileName, and m_writerXmlTandemOutput.

## ~WrapTandemResults()

pappso::WrapTandemResults::~WrapTandemResults | ( |  | ) |

virtual

Destructor

Definition at line 52 of file wraptandemresults.cpp.

{
}

## Member Function Documentation

## process_group_note()

void pappso::WrapTandemResults::process_group_note | ( |  | ) |

private

Definition at line 64 of file wraptandemresults.cpp.

{
cloneStartElement(m_writerXmlTandemOutput);
while(m_qxmlStreamReader.readNext() && !m_qxmlStreamReader.isEndElement())
{
if(m_qxmlStreamReader.isStartElement())
{
QString type = m_qxmlStreamReader.attributes().value("type").toString();
QString label = m_qxmlStreamReader.attributes().value("label").toString();
qDebug() << "type=" << type << " label=" << label;
// qDebug() << "XtandemParamSaxHandler::endElement_note begin " <<
// <note type="input" label="spectrum,
// path">/tmp/tandemwrapper-IehrEL/msdata.mzxml</note>
if(label == "spectrum, path")
{
//<note type="input"
// label="spectrum,path">/gorgone/pappso/jouy/raw/2019_Lumos/20191222_107_Juste/20191222_18_EF1.mzXML</note>
// m_originMzDataFileName = m_currentText;
// p_writeXmlTandemOutput->writeCharacters(m_destinationMzXmlFileName);
m_writerXmlTandemOutput.writeStartElement("note");
m_writerXmlTandemOutput.writeAttributes(m_qxmlStreamReader.attributes());
m_writerXmlTandemOutput.writeCharacters(m_originalMsDataFileName);
m_writerXmlTandemOutput.writeEndElement();
for(auto pair_input : m_mapTandemInputParameters)
{
m_writerXmlTandemOutput.writeStartElement("note");
m_writerXmlTandemOutput.writeAttribute("type", "input");
m_writerXmlTandemOutput.writeAttribute("label", pair_input.first);
m_writerXmlTandemOutput.writeCharacters(pair_input.second);
m_writerXmlTandemOutput.writeEndElement();
}
m_qxmlStreamReader.skipCurrentElement();
}
else if(label == "output, path")
{
//<note type="input" label="output,
// path">/tmp/tandemwrapper-sSGxtE/output_tandem.xml</note>
m_writerXmlTandemOutput.writeStartElement("note");
m_writerXmlTandemOutput.writeAttributes(m_qxmlStreamReader.attributes());
m_writerXmlTandemOutput.writeCharacters(
QFileInfo(m_destinationTandemOutputFile).absoluteFilePath());
m_writerXmlTandemOutput.writeEndElement();
m_qxmlStreamReader.skipCurrentElement();
}
else
{
cloneElement(m_writerXmlTandemOutput);
}
}
}
m_writerXmlTandemOutput.writeEndElement();
}
pappso::WrapTandemResults::m_mapTandemInputParameters
std::map< QString, QString > m_mapTandemInputParameters
Definition wraptandemresults.h:71
pappso::XmlStreamReaderInterface::cloneStartElement
void cloneStartElement(QXmlStreamWriter &output) const
Definition xmlstreamreaderinterface.cpp:108
pappso::XmlStreamReaderInterface::m_qxmlStreamReader
QXmlStreamReader m_qxmlStreamReader
Definition xmlstreamreaderinterface.h:71
pappso::XmlStreamReaderInterface::cloneElement
void cloneElement(QXmlStreamWriter &output)
Definition xmlstreamreaderinterface.cpp:120

References pappso::XmlStreamReaderInterface::cloneElement(), pappso::XmlStreamReaderInterface::cloneStartElement(), m_destinationTandemOutputFile, m_mapTandemInputParameters, m_originalMsDataFileName, pappso::XmlStreamReaderInterface::m_qxmlStreamReader, and m_writerXmlTandemOutput.

Referenced by readStream().

## readStream()

void pappso::WrapTandemResults::readStream | ( |  | ) |

override protected virtual

Implements pappso::XmlStreamReaderInterface.

Definition at line 125 of file wraptandemresults.cpp.

{
qDebug();
if(m_qxmlStreamReader.readNextStartElement())
{
if(m_qxmlStreamReader.name().toString() == "bioml")
{
cloneStartElement(m_writerXmlTandemOutput);
qDebug();
while(m_qxmlStreamReader.readNextStartElement())
{
if(m_qxmlStreamReader.name().toString() == "group")
{
QString type = m_qxmlStreamReader.attributes().value("type").toString();
if(type == "model")
{
cloneElement(m_writerXmlTandemOutput);
}
else if(type == "parameters")
{
QString label = m_qxmlStreamReader.attributes().value("label").toString();
if(label == "performance parameters")
{
cloneElement(m_writerXmlTandemOutput);
}
else if(label == "input parameters")
{
process_group_note();
// cloneElement(m_writerXmlTandemOutput);
}
else if(label == "unused input parameters")
{
cloneElement(m_writerXmlTandemOutput);
}
else
{
m_qxmlStreamReader.skipCurrentElement();
}
}
}
else
{
qDebug() << m_qxmlStreamReader.name();
// read_note();
cloneStartElement(m_writerXmlTandemOutput);
m_writerXmlTandemOutput.writeCharacters(m_qxmlStreamReader.readElementText());
m_writerXmlTandemOutput.writeEndElement();
}
}
}
else
{
m_qxmlStreamReader.raiseError(QObject::tr("Not an X!Tandem result file"));
m_qxmlStreamReader.skipCurrentElement();
}
}
m_writerXmlTandemOutput.writeEndDocument();
m_destinationTandemOutputFile.close();
qDebug();
}
pappso::WrapTandemResults::process_group_note
void process_group_note()
Definition wraptandemresults.cpp:64

References pappso::XmlStreamReaderInterface::cloneElement(), pappso::XmlStreamReaderInterface::cloneStartElement(), m_destinationTandemOutputFile, pappso::XmlStreamReaderInterface::m_qxmlStreamReader, m_writerXmlTandemOutput, and process_group_note().

## setInputParameters()

void pappso::WrapTandemResults::setInputParameters | ( | const QString & | label_name_attribute,
|  | const QString & | input_value )

Definition at line 57 of file wraptandemresults.cpp.

{
m_mapTandemInputParameters.insert(std::pair<QString, QString>(label_name_attribute, input_value));
}

References m_mapTandemInputParameters.

Referenced by pappso::TandemWrapperRun::writeFinalTandemOutput().

## Member Data Documentation

## m_destinationTandemOutputFile

QFile pappso::WrapTandemResults::m_destinationTandemOutputFile

private

Definition at line 67 of file wraptandemresults.h.

Referenced by WrapTandemResults(), process_group_note(), and readStream().

## m_mapTandemInputParameters

std::map<QString, QString> pappso::WrapTandemResults::m_mapTandemInputParameters

private

Definition at line 71 of file wraptandemresults.h.

Referenced by process_group_note(), and setInputParameters().

## m_originalMsDataFileName

QString pappso::WrapTandemResults::m_originalMsDataFileName

private

Definition at line 69 of file wraptandemresults.h.

Referenced by WrapTandemResults(), and process_group_note().

## m_writerXmlTandemOutput

QXmlStreamWriter pappso::WrapTandemResults::m_writerXmlTandemOutput

private

Definition at line 68 of file wraptandemresults.h.

Referenced by WrapTandemResults(), process_group_note(), and readStream().

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

- pappsomspp/core/processing/tandemwrapper/wraptandemresults.h
- pappsomspp/core/processing/tandemwrapper/wraptandemresults.cpp