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

`#include <wraptandeminput.h>`

Inheritance diagram for pappso::WrapTandemInput:

## Public Member Functions

| WrapTandemInput (const QString &destinationMzXmlFile, const QString &destinationTandemInputFile, const QString &destinationTandemOutputFile)
virtual | ~WrapTandemInput ()
const QString & | getOriginalMsDataFileName () const
const QString & | getOriginalTandemOutputFileName () const
const QString & | getOriginalTandemPresetFileName () const
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 Attributes

QString | m_destinationMzXmlFileName
QString | m_originMzDataFileName
QString | m_destinationTandemInputFileName
QString | m_originTandemPresetFileName
QString | m_originTandemOutpuFileName
QString | m_destinationTandemOutputFileName
QFile | m_destinationTandemInputFile
QXmlStreamWriter | m_writerXmlTandemInput

## Additional Inherited Members

Protected Attributes inherited from pappso::XmlStreamReaderInterface
QXmlStreamReader | m_qxmlStreamReader

## Detailed Description

Todo
  write docs

Definition at line 42 of file wraptandeminput.h.

## Constructor & Destructor Documentation

## WrapTandemInput()

pappso::WrapTandemInput::WrapTandemInput | ( | const QString & | destinationMzXmlFile,
|  | const QString & | destinationTandemInputFile,
|  | const QString & | destinationTandemOutputFile )

Default constructor

Definition at line 36 of file wraptandeminput.cpp.

: m_destinationTandemInputFile(destinationTandemInputFile)
{
m_destinationMzXmlFileName = destinationMzXmlFile;
m_destinationTandemOutputFileName = destinationTandemOutputFile;
m_destinationTandemInputFileName = QFileInfo(destinationTandemInputFile).absoluteFilePath();
if(destinationTandemInputFile.isEmpty())
{
throw pappso::PappsoException(QObject::tr("ERROR: X!Tandem input file path is empty"));
}
if(!m_destinationTandemInputFile.open(QIODevice::WriteOnly))
{
throw pappso::PappsoException(
QObject::tr("ERROR: unable to open %1 tandem output file for write")
.arg(destinationTandemInputFile));
}
m_writerXmlTandemInput.setDevice(&m_destinationTandemInputFile);
m_writerXmlTandemInput.setAutoFormatting(true);
m_writerXmlTandemInput.writeStartDocument("1.0");
}
pappso::WrapTandemInput::m_writerXmlTandemInput
QXmlStreamWriter m_writerXmlTandemInput
Definition wraptandeminput.h:75
pappso::WrapTandemInput::m_destinationTandemInputFile
QFile m_destinationTandemInputFile
Definition wraptandeminput.h:74
pappso::WrapTandemInput::m_destinationTandemInputFileName
QString m_destinationTandemInputFileName
Definition wraptandeminput.h:70
pappso::WrapTandemInput::m_destinationTandemOutputFileName
QString m_destinationTandemOutputFileName
Definition wraptandeminput.h:73
pappso::WrapTandemInput::m_destinationMzXmlFileName
QString m_destinationMzXmlFileName
Definition wraptandeminput.h:68

References m_destinationMzXmlFileName, m_destinationTandemInputFile, m_destinationTandemInputFileName, m_destinationTandemOutputFileName, and m_writerXmlTandemInput.

## ~WrapTandemInput()

pappso::WrapTandemInput::~WrapTandemInput | ( |  | ) |

virtual

Destructor

Definition at line 62 of file wraptandeminput.cpp.

{
m_destinationTandemInputFile.close();
}

References m_destinationTandemInputFile.

## Member Function Documentation

## getOriginalMsDataFileName()

const QString & pappso::WrapTandemInput::getOriginalMsDataFileName | ( |  | ) | const

Definition at line 131 of file wraptandeminput.cpp.

{
return m_originMzDataFileName;
}
pappso::WrapTandemInput::m_originMzDataFileName
QString m_originMzDataFileName
Definition wraptandeminput.h:69

References m_originMzDataFileName.

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

## getOriginalTandemOutputFileName()

const QString & pappso::WrapTandemInput::getOriginalTandemOutputFileName | ( |  | ) | const

Definition at line 137 of file wraptandeminput.cpp.

{
return m_originTandemOutpuFileName;
}
pappso::WrapTandemInput::m_originTandemOutpuFileName
QString m_originTandemOutpuFileName
Definition wraptandeminput.h:72

References m_originTandemOutpuFileName.

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

## getOriginalTandemPresetFileName()

const QString & pappso::WrapTandemInput::getOriginalTandemPresetFileName | ( |  | ) | const

Definition at line 143 of file wraptandeminput.cpp.

{
return m_originTandemPresetFileName;
}
pappso::WrapTandemInput::m_originTandemPresetFileName
QString m_originTandemPresetFileName
Definition wraptandeminput.h:71

References m_originTandemPresetFileName.

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

## readStream()

void pappso::WrapTandemInput::readStream | ( |  | ) |

override protected virtual

Implements pappso::XmlStreamReaderInterface.

Definition at line 69 of file wraptandeminput.cpp.

{
qDebug();
if(m_qxmlStreamReader.readNextStartElement())
{
if(m_qxmlStreamReader.name().toString() == "bioml")
{
cloneStartElement(m_writerXmlTandemInput);
qDebug();
while(m_qxmlStreamReader.readNextStartElement())
{
// qDebug() << m_qxmlStreamReader.name();
// read_note();
cloneStartElement(m_writerXmlTandemInput);
QString type = m_qxmlStreamReader.attributes().value("type").toString();
QString label = m_qxmlStreamReader.attributes().value("label").toString();
if((type == "input") && (label == "spectrum, path"))
{
//<note type="input" label="spectrum, path">
m_originMzDataFileName = m_qxmlStreamReader.readElementText();
m_writerXmlTandemInput.writeCharacters(m_destinationMzXmlFileName);
// m_qxmlStreamReader.skipCurrentElement();
}
else if((type == "input") && (label == "output, path"))
{
//<note type="input" label="output, path">
m_originTandemOutpuFileName = m_qxmlStreamReader.readElementText();
m_writerXmlTandemInput.writeCharacters(m_destinationTandemOutputFileName);
// m_qxmlStreamReader.skipCurrentElement();
}
// list path, default parameters
else if((type == "input") && (label == "list path, default parameters"))
{
//<note type="input" label="list path, default
// parameters">/gorgone/pappso/tmp/xtpcpp.AjyZGg/Lumos_trypsin_rev_camC_oxM_10ppm_HCDOT_12102017CH.xml</note>
m_originTandemPresetFileName = m_qxmlStreamReader.readElementText();
m_writerXmlTandemInput.writeCharacters(m_originTandemPresetFileName);
}
else
{
m_writerXmlTandemInput.writeCharacters(m_qxmlStreamReader.readElementText());
}
m_writerXmlTandemInput.writeEndElement();
}
}
else
{
m_qxmlStreamReader.raiseError(QObject::tr("Not an X!Tandem input file"));
m_qxmlStreamReader.skipCurrentElement();
}
}
m_writerXmlTandemInput.writeEndDocument();
m_destinationTandemInputFile.close();
qDebug();
}
pappso::XmlStreamReaderInterface::cloneStartElement
void cloneStartElement(QXmlStreamWriter &output) const
Definition xmlstreamreaderinterface.cpp:108
pappso::XmlStreamReaderInterface::m_qxmlStreamReader
QXmlStreamReader m_qxmlStreamReader
Definition xmlstreamreaderinterface.h:71

References pappso::XmlStreamReaderInterface::cloneStartElement(), m_destinationMzXmlFileName, m_destinationTandemInputFile, m_destinationTandemOutputFileName, m_originMzDataFileName, m_originTandemOutpuFileName, m_originTandemPresetFileName, pappso::XmlStreamReaderInterface::m_qxmlStreamReader, and m_writerXmlTandemInput.

## Member Data Documentation

## m_destinationMzXmlFileName

QString pappso::WrapTandemInput::m_destinationMzXmlFileName

private

Definition at line 68 of file wraptandeminput.h.

Referenced by WrapTandemInput(), and readStream().

## m_destinationTandemInputFile

QFile pappso::WrapTandemInput::m_destinationTandemInputFile

private

Definition at line 74 of file wraptandeminput.h.

Referenced by WrapTandemInput(), ~WrapTandemInput(), and readStream().

## m_destinationTandemInputFileName

QString pappso::WrapTandemInput::m_destinationTandemInputFileName

private

Definition at line 70 of file wraptandeminput.h.

Referenced by WrapTandemInput().

## m_destinationTandemOutputFileName

QString pappso::WrapTandemInput::m_destinationTandemOutputFileName

private

Definition at line 73 of file wraptandeminput.h.

Referenced by WrapTandemInput(), and readStream().

## m_originMzDataFileName

QString pappso::WrapTandemInput::m_originMzDataFileName

private

Definition at line 69 of file wraptandeminput.h.

Referenced by getOriginalMsDataFileName(), and readStream().

## m_originTandemOutpuFileName

QString pappso::WrapTandemInput::m_originTandemOutpuFileName

private

Definition at line 72 of file wraptandeminput.h.

Referenced by getOriginalTandemOutputFileName(), and readStream().

## m_originTandemPresetFileName

QString pappso::WrapTandemInput::m_originTandemPresetFileName

private

Definition at line 71 of file wraptandeminput.h.

Referenced by getOriginalTandemPresetFileName(), and readStream().

## m_writerXmlTandemInput

QXmlStreamWriter pappso::WrapTandemInput::m_writerXmlTandemInput

private

Definition at line 75 of file wraptandeminput.h.

Referenced by WrapTandemInput(), and readStream().

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

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