Loading...
Searching...
No Matches
pappso::cbor::mzcbor::MzcborReaderBase Class Reference

base class to initialize mzCBOR file parsing More...

`#include <mzcborreaderbase.h>`

Inheritance diagram for pappso::cbor::mzcbor::MzcborReaderBase:

## Public Member Functions

| MzcborReaderBase ()
virtual | ~MzcborReaderBase ()
virtual void | readCbor (QFile *cborp, pappso::UiMonitorInterface &monitor)
| read mzCBOR file
virtual void | readCbor (QIODevice *cborp, pappso::UiMonitorInterface &monitor)
| read mzCBOR from any device (memory buffer or else)
virtual void | close ()
| convenient function to clean pointer before leaving
bool | isMzcbor () const
const QStringList & | getMsrunIdList () const
Public Member Functions inherited from pappso::cbor::CborStreamReaderInterface
| CborStreamReaderInterface ()
virtual | ~CborStreamReaderInterface ()

## Protected Member Functions

void | readRoot (pappso::UiMonitorInterface &monitor)
virtual void | readMsrun ()
virtual void | readReferenceableParamGroupList ()
std::map< QString, CvParam > | getCvParamsMap ()
| read the array containing cvParams to give accessions and values
Protected Member Functions inherited from pappso::cbor::CborStreamReaderInterface
bool | getExpectedString ()
void | initCborReader (QFile *pcborfile)
void | initCborReader (QIODevice *pcborfile)

## Protected Attributes

bool | m_stopParsing = false
Protected Attributes inherited from pappso::cbor::CborStreamReaderInterface
CborStreamReader * | mpa_cborReader = nullptr
QString | m_expectedString
QByteArray | m_data

## Private Attributes

bool | m_isMzcbor = false
QStringList | m_msrunIdList

## Detailed Description

base class to initialize mzCBOR file parsing

ensures stream read on regular file or any readable device

Definition at line 44 of file mzcborreaderbase.h.

## Constructor & Destructor Documentation

## MzcborReaderBase()

pappso::cbor::mzcbor::MzcborReaderBase::MzcborReaderBase | ( |  | ) |

Default constructor

Definition at line 31 of file mzcborreaderbase.cpp.

{
}

## ~MzcborReaderBase()

pappso::cbor::mzcbor::MzcborReaderBase::~MzcborReaderBase | ( |  | ) |

virtual

Destructor

Definition at line 35 of file mzcborreaderbase.cpp.

{
}

## Member Function Documentation

## close()

void pappso::cbor::mzcbor::MzcborReaderBase::close | ( |  | ) |

virtual

convenient function to clean pointer before leaving

Reimplemented from pappso::cbor::CborStreamReaderInterface.

Definition at line 40 of file mzcborreaderbase.cpp.

{
}

Referenced by pappso::MzcborMsRunReader::initialize(), and pappso::MzcborMsRunReader::readSpectrumCollectionWithMsrunReadConfig().

## getCvParamsMap()

std::map< QString, pappso::cbor::mzcbor::CvParam > pappso::cbor::mzcbor::MzcborReaderBase::getCvParamsMap | ( |  | ) |

protected

read the array containing cvParams to give accessions and values

Definition at line 190 of file mzcborreaderbase.cpp.

{
qDebug();
std::map<QString, CvParam> accession_values;
mpa_cborReader->enterContainer(); // start array
while(mpa_cborReader->hasNext())
{
CvParam cv_param;
cv_param.fromCbor(*mpa_cborReader);
accession_values.insert({cv_param.accession, cv_param});
}
mpa_cborReader->leaveContainer(); // end array
return accession_values;
}
pappso::cbor::CborStreamReaderInterface::mpa_cborReader
CborStreamReader * mpa_cborReader
Definition cborstreamreaderinterface.h:68

References pappso::cbor::mzcbor::CvParam::accession, pappso::cbor::mzcbor::CvParam::fromCbor(), and pappso::cbor::CborStreamReaderInterface::mpa_cborReader.

Referenced by pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::readScan().

## getMsrunIdList()

const QStringList & pappso::cbor::mzcbor::MzcborReaderBase::getMsrunIdList | ( |  | ) | const

Definition at line 126 of file mzcborreaderbase.cpp.

{
return m_msrunIdList;
}
pappso::cbor::mzcbor::MzcborReaderBase::m_msrunIdList
QStringList m_msrunIdList
Definition mzcborreaderbase.h:94

References m_msrunIdList.

## isMzcbor()

bool pappso::cbor::mzcbor::MzcborReaderBase::isMzcbor | ( |  | ) | const

Definition at line 120 of file mzcborreaderbase.cpp.

{
return m_isMzcbor;
}
pappso::cbor::mzcbor::MzcborReaderBase::m_isMzcbor
bool m_isMzcbor
Definition mzcborreaderbase.h:93

References m_isMzcbor.

## readCbor() [1/2]

void pappso::cbor::mzcbor::MzcborReaderBase::readCbor | ( | QFile * | cborp,
|  | pappso::UiMonitorInterface & | monitor )

virtual

read mzCBOR file

Parameters

  cborp | file pointer
  monitor | monitor read progress and messages

Reimplemented in pappso::cbor::mzcbor::MzcborBuildIndexReader.

Definition at line 45 of file mzcborreaderbase.cpp.

{
qDebug();
initCborReader(cborp);
qDebug();
if(mpa_cborReader->isMap())
{
readRoot(monitor);
}
qDebug();
}
pappso::cbor::CborStreamReaderInterface::initCborReader
void initCborReader(QFile *pcborfile)
Definition cborstreamreaderinterface.cpp:80
pappso::cbor::mzcbor::MzcborReaderBase::readRoot
void readRoot(pappso::UiMonitorInterface &monitor)
Definition mzcborreaderbase.cpp:75

References pappso::cbor::CborStreamReaderInterface::initCborReader(), pappso::cbor::CborStreamReaderInterface::mpa_cborReader, and readRoot().

Referenced by pappso::MzcborMsRunReader::readSpectrumCollectionWithMsrunReadConfig().

## readCbor() [2/2]

void pappso::cbor::mzcbor::MzcborReaderBase::readCbor | ( | QIODevice * | cborp,
|  | pappso::UiMonitorInterface & | monitor )

virtual

read mzCBOR from any device (memory buffer or else)

Parameters

  cborp | device pointer
  monitor | monitor read progress and messages

Definition at line 59 of file mzcborreaderbase.cpp.

{
qDebug();
initCborReader(cborp);
qDebug();
if(mpa_cborReader->isMap())
{
readRoot(monitor);
}
qDebug();
}

References pappso::cbor::CborStreamReaderInterface::initCborReader(), pappso::cbor::CborStreamReaderInterface::mpa_cborReader, and readRoot().

## readMsrun()

void pappso::cbor::mzcbor::MzcborReaderBase::readMsrun | ( |  | ) |

protected virtual

Reimplemented in pappso::cbor::mzcbor::MzcborBuildIndexReader, and pappso::cbor::mzcbor::MzcborSpectrumCollectionReader.

Definition at line 169 of file mzcborreaderbase.cpp.

{
mpa_cborReader->enterContainer();
while(getExpectedString())
{
if(m_expectedString == "id")
{
getExpectedString();
m_msrunIdList << m_expectedString;
}
else
{
mpa_cborReader->next();
}
}
mpa_cborReader->leaveContainer();
}
pappso::cbor::CborStreamReaderInterface::m_expectedString
QString m_expectedString
Definition cborstreamreaderinterface.h:69
pappso::cbor::CborStreamReaderInterface::getExpectedString
bool getExpectedString()
Definition cborstreamreaderinterface.cpp:54

References pappso::cbor::CborStreamReaderInterface::getExpectedString(), pappso::cbor::CborStreamReaderInterface::m_expectedString, m_msrunIdList, and pappso::cbor::CborStreamReaderInterface::mpa_cborReader.

Referenced by readRoot().

## readReferenceableParamGroupList()

void pappso::cbor::mzcbor::MzcborReaderBase::readReferenceableParamGroupList | ( |  | ) |

protected virtual

Definition at line 133 of file mzcborreaderbase.cpp.

{
mpa_cborReader->enterContainer();
while(getExpectedString())
{
if(m_expectedString == "referenceableParamGroup")
{
mpa_cborReader->next();
/*
mpa_cborReader->enterContainer();
while(getExpectedString())
{
if(m_expectedString == "cvParam")
{
std::map<QString, pappso::cbor::mzcbor::CvParam> cvParamMap =
CvParam::getCvParamsMapFromCbor(*mpa_cborReader);
}
else
{
mpa_cborReader->next();
}
}
mpa_cborReader->leaveContainer();*/
}
else
{
mpa_cborReader->next();
}
}
mpa_cborReader->leaveContainer();
}

References pappso::cbor::CborStreamReaderInterface::getExpectedString(), pappso::cbor::CborStreamReaderInterface::m_expectedString, and pappso::cbor::CborStreamReaderInterface::mpa_cborReader.

Referenced by readRoot().

## readRoot()

void pappso::cbor::mzcbor::MzcborReaderBase::readRoot | ( | pappso::UiMonitorInterface & | monitor | ) |

protected

Definition at line 75 of file mzcborreaderbase.cpp.

{
qDebug();
mpa_cborReader->enterContainer();
while(getExpectedString())
{
if(m_expectedString == "mzCBOR")
{
m_isMzcbor = true;
mpa_cborReader->next();
}
else if(m_expectedString == "mzML")
{
m_isMzcbor = true;
qDebug() << m_expectedString;
mpa_cborReader->next();
while(getExpectedString())
{
qDebug() << m_expectedString;
if(m_expectedString == "run")
{
readMsrun();
}
else if(m_expectedString == "referenceableParamGroupList")
{
readReferenceableParamGroupList();
}
else
{
mpa_cborReader->next();
}
if(m_stopParsing)
break;
}
}
}
mpa_cborReader->leaveContainer();
}
pappso::cbor::mzcbor::MzcborReaderBase::readReferenceableParamGroupList
virtual void readReferenceableParamGroupList()
Definition mzcborreaderbase.cpp:133
pappso::cbor::mzcbor::MzcborReaderBase::readMsrun
virtual void readMsrun()
Definition mzcborreaderbase.cpp:169
pappso::cbor::mzcbor::MzcborReaderBase::m_stopParsing
bool m_stopParsing
Definition mzcborreaderbase.h:90

References pappso::cbor::CborStreamReaderInterface::getExpectedString(), pappso::cbor::CborStreamReaderInterface::m_expectedString, m_isMzcbor, m_stopParsing, pappso::cbor::CborStreamReaderInterface::mpa_cborReader, readMsrun(), and readReferenceableParamGroupList().

Referenced by pappso::cbor::mzcbor::MzcborBuildIndexReader::readCbor(), readCbor(), and readCbor().

## Member Data Documentation

## m_isMzcbor

bool pappso::cbor::mzcbor::MzcborReaderBase::m_isMzcbor = false

private

Definition at line 93 of file mzcborreaderbase.h.

Referenced by isMzcbor(), and readRoot().

## m_msrunIdList

QStringList pappso::cbor::mzcbor::MzcborReaderBase::m_msrunIdList

private

Definition at line 94 of file mzcborreaderbase.h.

Referenced by getMsrunIdList(), and readMsrun().

## m_stopParsing

bool pappso::cbor::mzcbor::MzcborReaderBase::m_stopParsing = false

protected

Definition at line 90 of file mzcborreaderbase.h.

Referenced by readRoot(), pappso::cbor::mzcbor::MzcborBuildIndexReader::readSpectrumListAndLeave(), and pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::readSpectrumListAndLeave().

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

- pappsomspp/core/processing/cbor/mzcbor/mzcborreaderbase.h
- pappsomspp/core/processing/cbor/mzcbor/mzcborreaderbase.cpp