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

`#include <xtandempresetreader.h>`

Inheritance diagram for pappso::XtandemPresetReader:

## Public Member Functions

| XtandemPresetReader ()
virtual | ~XtandemPresetReader ()
int | getNumberOfThreads () const
const QString | getMs2FiltersOptions () const
int | getCountNote () 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 Member Functions

void | read_note ()

## Private Attributes

int | m_countNote = -1
int | m_threads = -1
Enums::PrecisionUnit | m_ms2precisionUnit = Enums::PrecisionUnit::dalton
double | m_ms2precisionValue = 0

## Additional Inherited Members

Protected Attributes inherited from pappso::XmlStreamReaderInterface
QXmlStreamReader | m_qxmlStreamReader

## Detailed Description

Definition at line 39 of file xtandempresetreader.h.

## Constructor & Destructor Documentation

## XtandemPresetReader()

pappso::XtandemPresetReader::XtandemPresetReader | ( |  | ) |

Default constructor

Definition at line 35 of file xtandempresetreader.cpp.

{
}

## ~XtandemPresetReader()

pappso::XtandemPresetReader::~XtandemPresetReader | ( |  | ) |

virtual

Destructor

Definition at line 39 of file xtandempresetreader.cpp.

{
}

## Member Function Documentation

## getCountNote()

int pappso::XtandemPresetReader::getCountNote | ( |  | ) | const

Definition at line 161 of file xtandempresetreader.cpp.

{
return m_countNote;
}
pappso::XtandemPresetReader::m_countNote
int m_countNote
Definition xtandempresetreader.h:63

References m_countNote.

## getMs2FiltersOptions()

const QString pappso::XtandemPresetReader::getMs2FiltersOptions | ( |  | ) | const

Definition at line 110 of file xtandempresetreader.cpp.

{
QString filter_suite;
PrecisionPtr precision =
PrecisionFactory::getPrecisionPtrInstance(m_ms2precisionUnit, m_ms2precisionValue);
QString charge_decon_filter =
QString("chargeDeconvolution|%1").arg(precision->toString().replace(" ", ""));
PrecisionPtr precision_exclu =
PrecisionFactory::getPrecisionPtrInstance(m_ms2precisionUnit, m_ms2precisionValue / 2);
QString mz_exclusion_filter =
QString("mzExclusion|%1").arg(precision_exclu->toString().replace(" ", ""));
filter_suite = charge_decon_filter + " " + mz_exclusion_filter;
return filter_suite;
}
pappso::PrecisionFactory::getPrecisionPtrInstance
static PrecisionPtr getPrecisionPtrInstance(Enums::PrecisionUnit unit, double value)
get a precision pointer instance
Definition precision.cpp:219
pappso::XtandemPresetReader::m_ms2precisionUnit
Enums::PrecisionUnit m_ms2precisionUnit
Definition xtandempresetreader.h:66
pappso::XtandemPresetReader::m_ms2precisionValue
double m_ms2precisionValue
Definition xtandempresetreader.h:67
pappso::PrecisionPtr
const PrecisionBase * PrecisionPtr
Definition precision.h:122

References pappso::PrecisionFactory::getPrecisionPtrInstance(), m_ms2precisionUnit, m_ms2precisionValue, and pappso::PrecisionBase::toString().

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

## getNumberOfThreads()

int pappso::XtandemPresetReader::getNumberOfThreads | ( |  | ) | const

Definition at line 103 of file xtandempresetreader.cpp.

{
return m_threads;
}
pappso::XtandemPresetReader::m_threads
int m_threads
Definition xtandempresetreader.h:64

References m_threads.

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

## read_note()

void pappso::XtandemPresetReader::read_note | ( |  | ) |

private

Definition at line 45 of file xtandempresetreader.cpp.

{
// <note type="input"
// label="output,path">/gorgone/pappso/jouy/users/Celine/2019_Lumos/20191222_107_Juste_APD/metapappso_condor/test_run/20191222_18_EF1_third_step_test_condor_22janv.xml</note>
if(m_qxmlStreamReader.name().toString() != "note")
{
m_qxmlStreamReader.skipCurrentElement();
return;
}
Q_ASSERT(m_qxmlStreamReader.name().toString() == "note");
QString label;
m_countNote++;
if((m_qxmlStreamReader.attributes().hasAttribute("type")) &&
(m_qxmlStreamReader.attributes().value("type").toString() == "input"))
{
if(m_qxmlStreamReader.attributes().hasAttribute("label"))
{
label = m_qxmlStreamReader.attributes().value("label").toString();
}
}
if(label.isEmpty())
{
}
else
{
if(label == "spectrum, timstof MS2 filters")
{
}
else if(label == "spectrum, threads")
{
m_threads = m_qxmlStreamReader.readElementText().toInt();
return;
}
else if(label == "spectrum, fragment monoisotopic mass error units")
{
m_ms2precisionUnit = Enums::PrecisionUnit::dalton;
if(m_qxmlStreamReader.readElementText().trimmed().toLower() == "ppm")
{
m_ms2precisionUnit = Enums::PrecisionUnit::ppm;
}
return;
}
else if(label == "spectrum, fragment monoisotopic mass error")
{
m_ms2precisionValue = m_qxmlStreamReader.readElementText().toDouble();
return;
}
}
m_qxmlStreamReader.skipCurrentElement();
// qDebug() << "end ";
//
}
pappso::XmlStreamReaderInterface::m_qxmlStreamReader
QXmlStreamReader m_qxmlStreamReader
Definition xmlstreamreaderinterface.h:71
pappso::Enums::PrecisionUnit::ppm
@ ppm
Definition types.h:99
pappso::Enums::PrecisionUnit::dalton
@ dalton
Definition types.h:98

References pappso::Enums::dalton, m_countNote, m_ms2precisionUnit, m_ms2precisionValue, pappso::XmlStreamReaderInterface::m_qxmlStreamReader, m_threads, and pappso::Enums::ppm.

Referenced by readStream().

## readStream()

void pappso::XtandemPresetReader::readStream | ( |  | ) |

override protected virtual

Implements pappso::XmlStreamReaderInterface.

Definition at line 128 of file xtandempresetreader.cpp.

{
qDebug();
m_countNote = 0;
m_threads = -1;
m_ms2precisionUnit = Enums::PrecisionUnit::dalton;
m_ms2precisionValue = -1;
if(m_qxmlStreamReader.readNextStartElement())
{
if(m_qxmlStreamReader.name().toString() == "bioml")
{
qDebug();
while(m_qxmlStreamReader.readNextStartElement())
{
// qDebug() << m_qxmlStreamReader.name();
read_note();
}
}
else
{
m_qxmlStreamReader.raiseError(QObject::tr("Not an X!Tandem preset file"));
m_qxmlStreamReader.skipCurrentElement();
}
}
if(m_threads == -1)
{
qDebug();
m_qxmlStreamReader.raiseError(QObject::tr("Not an X!Tandem preset file"));
}
qDebug();
}
pappso::XtandemPresetReader::read_note
void read_note()
Definition xtandempresetreader.cpp:45

References pappso::Enums::dalton, m_countNote, m_ms2precisionUnit, m_ms2precisionValue, pappso::XmlStreamReaderInterface::m_qxmlStreamReader, m_threads, and read_note().

## Member Data Documentation

## m_countNote

int pappso::XtandemPresetReader::m_countNote = -1

private

Definition at line 63 of file xtandempresetreader.h.

Referenced by getCountNote(), read_note(), and readStream().

## m_ms2precisionUnit

Enums::PrecisionUnit pappso::XtandemPresetReader::m_ms2precisionUnit = Enums::PrecisionUnit::dalton

private

Definition at line 66 of file xtandempresetreader.h.

Referenced by getMs2FiltersOptions(), read_note(), and readStream().

## m_ms2precisionValue

double pappso::XtandemPresetReader::m_ms2precisionValue = 0

private

Definition at line 67 of file xtandempresetreader.h.

Referenced by getMs2FiltersOptions(), read_note(), and readStream().

## m_threads

int pappso::XtandemPresetReader::m_threads = -1

private

Definition at line 64 of file xtandempresetreader.h.

Referenced by getNumberOfThreads(), read_note(), and readStream().

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

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