libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::WrapTandemInput Class Reference

#include <wraptandeminput.h>

Inheritance diagram for pappso::WrapTandemInput:
pappso::XmlStreamReaderInterface

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.

39 : m_destinationTandemInputFile(destinationTandemInputFile)
40{
41 m_destinationMzXmlFileName = destinationMzXmlFile;
42 m_destinationTandemOutputFileName = destinationTandemOutputFile;
43 m_destinationTandemInputFileName = QFileInfo(destinationTandemInputFile).absoluteFilePath();
44
45 if(destinationTandemInputFile.isEmpty())
46 {
47 throw pappso::PappsoException(QObject::tr("ERROR: X!Tandem input file path is empty"));
48 }
49
50 if(!m_destinationTandemInputFile.open(QIODevice::WriteOnly))
51 {
52 throw pappso::PappsoException(
53 QObject::tr("ERROR: unable to open %1 tandem output file for write")
54 .arg(destinationTandemInputFile));
55 }
56
58 m_writerXmlTandemInput.setAutoFormatting(true);
59 m_writerXmlTandemInput.writeStartDocument("1.0");
60}
QXmlStreamWriter m_writerXmlTandemInput
QString m_destinationTandemOutputFileName

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.

63{
65}

References m_destinationTandemInputFile.

Member Function Documentation

◆ getOriginalMsDataFileName()

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

Definition at line 131 of file wraptandeminput.cpp.

132{
134}

References m_originMzDataFileName.

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

◆ getOriginalTandemOutputFileName()

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

Definition at line 137 of file wraptandeminput.cpp.

138{
140}

References m_originTandemOutpuFileName.

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

◆ getOriginalTandemPresetFileName()

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

◆ readStream()

void pappso::WrapTandemInput::readStream ( )
overrideprotectedvirtual

Implements pappso::XmlStreamReaderInterface.

Definition at line 69 of file wraptandeminput.cpp.

70{
71 qDebug();
72 if(m_qxmlStreamReader.readNextStartElement())
73 {
74 if(m_qxmlStreamReader.name().toString() == "bioml")
75 {
77 qDebug();
78 while(m_qxmlStreamReader.readNextStartElement())
79 {
80 // qDebug() << m_qxmlStreamReader.name();
81 // read_note();
83
84 QString type = m_qxmlStreamReader.attributes().value("type").toString();
85 QString label = m_qxmlStreamReader.attributes().value("label").toString();
86
87 if((type == "input") && (label == "spectrum, path"))
88 {
89 //<note type="input" label="spectrum, path">
90
93 // m_qxmlStreamReader.skipCurrentElement();
94 }
95 else if((type == "input") && (label == "output, path"))
96 {
97 //<note type="input" label="output, path">
100 // m_qxmlStreamReader.skipCurrentElement();
101 }
102 // list path, default parameters
103 else if((type == "input") && (label == "list path, default parameters"))
104 {
105 //<note type="input" label="list path, default
106 // parameters">/gorgone/pappso/tmp/xtpcpp.AjyZGg/Lumos_trypsin_rev_camC_oxM_10ppm_HCDOT_12102017CH.xml</note>
107
110 }
111 else
112 {
113 m_writerXmlTandemInput.writeCharacters(m_qxmlStreamReader.readElementText());
114 }
115 m_writerXmlTandemInput.writeEndElement();
116 }
117 }
118 else
119 {
120 m_qxmlStreamReader.raiseError(QObject::tr("Not an X!Tandem input file"));
121 m_qxmlStreamReader.skipCurrentElement();
122 }
123 }
124 m_writerXmlTandemInput.writeEndDocument();
126 qDebug();
127}
void cloneStartElement(QXmlStreamWriter &output) const

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: