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

`#include <mzcbormsfilereader.h>`

Inheritance diagram for pappso::MzcborMsFileReader:

## Public Member Functions

| MzcborMsFileReader (const QString &file_name)
virtual | ~MzcborMsFileReader ()
virtual Enums::MsDataFormat | getFileFormat () override
virtual std::vector< MsRunIdCstSPtr > | getMsRunIds (const QString &run_prefix) override

## Private Member Functions

virtual std::size_t | initialize ()
Private Member Functions inherited from pappso::MsFileReader
| MsFileReader (const QString &file_name)
virtual | ~MsFileReader ()

## Private Attributes

std::vector< pwiz::msdata::MSDataPtr > | m_msDataPtrVector
pappso::cbor::mzcbor::MzcborReaderBase | m_mzcborReaderBase
pappso::cbor::mzcbor::MzcborIndexReader | m_mzcborIndexReader
Private Attributes inherited from pappso::MsFileReader
QString | m_fileName
Enums::MsDataFormat | m_fileFormat = Enums::MsDataFormat::unknown

## Detailed Description

Todo
  write docs

Definition at line 21 of file mzcbormsfilereader.h.

## Constructor & Destructor Documentation

## MzcborMsFileReader()

pappso::MzcborMsFileReader::MzcborMsFileReader | ( | const QString & | file_name | ) |

Definition at line 12 of file mzcbormsfilereader.cpp.

: MsFileReader{file_name}
{
m_fileFormat = pappso::Enums::MsDataFormat::unknown;
initialize();
}
pappso::MsFileReader::MsFileReader
MsFileReader(const QString &file_name)
Definition msfilereader.cpp:19
pappso::MsFileReader::m_fileFormat
Enums::MsDataFormat m_fileFormat
Definition msfilereader.h:17
pappso::MzcborMsFileReader::initialize
virtual std::size_t initialize()
Definition mzcbormsfilereader.cpp:35
pappso::Enums::MsDataFormat::unknown
@ unknown
unknown format
Definition types.h:149

References pappso::MsFileReader::MsFileReader(), initialize(), pappso::MsFileReader::m_fileFormat, and pappso::Enums::unknown.

## ~MzcborMsFileReader()

pappso::MzcborMsFileReader::~MzcborMsFileReader | ( |  | ) |

virtual

Definition at line 19 of file mzcbormsfilereader.cpp.

{
}

## Member Function Documentation

## getFileFormat()

Enums::MsDataFormat pappso::MzcborMsFileReader::getFileFormat | ( |  | ) |

override virtual

Implements pappso::MsFileReader.

Definition at line 25 of file mzcbormsfilereader.cpp.

{
// std::cout << __FILE__ << " @ " << __LINE__ << " " << __FUNCTION__ << " () "
// << std::setprecision(15) << "m_fileFormat: " << (int)m_fileFormat
// << std::endl;
return m_fileFormat;
}

References pappso::MsFileReader::m_fileFormat.

Referenced by pappso::MsFileAccessor::getMsRunIds().

## getMsRunIds()

std::vector< MsRunIdCstSPtr > pappso::MzcborMsFileReader::getMsRunIds | ( | const QString & | run_prefix | ) |

override virtual

Implements pappso::MsFileReader.

Definition at line 81 of file mzcbormsfilereader.cpp.

{
std::vector<MsRunIdCstSPtr> ms_run_ids;
if(m_fileFormat == pappso::Enums::MsDataFormat::mzcbor)
{
if(m_mzcborIndexReader.getRunIdList().size() > 0)
{
qDebug();
std::size_t iter = 0;
for(auto &msrun_id_str : m_mzcborIndexReader.getRunIdList())
{
MsRunId ms_run_id(m_fileName, msrun_id_str);
// Set the MS data format as determined in initialize().
ms_run_id.setMsDataFormat(m_fileFormat);
// We need to set the unambiguous xmlId string.
ms_run_id.setXmlId(
QString("%1%2").arg(run_prefix).arg(Utils::getLexicalOrderedString(iter)));
// Now set the sample name to the run id : we can not do that, this is not the use
// sample name ms_run_id.setSampleName(QString::fromStdString(ms_data_ptr->run.id));
// And if it is possible, the real sample name because this one is for the
// end user to recognize his sample:
ms_run_id.setSampleName(msrun_id_str);
ms_run_ids.push_back(std::make_shared<MsRunId>(ms_run_id));
iter++;
}
}
else
{
std::size_t iter = 0;
for(auto &msrun_id_str : m_mzcborReaderBase.getMsrunIdList())
{
MsRunId ms_run_id(m_fileName, msrun_id_str);
// Set the MS data format as determined in initialize().
ms_run_id.setMsDataFormat(m_fileFormat);
// We need to set the unambiguous xmlId string.
ms_run_id.setXmlId(
QString("%1%2").arg(run_prefix).arg(Utils::getLexicalOrderedString(iter)));
// Now set the sample name to the run id : we can not do that, this is not the use
// sample name ms_run_id.setSampleName(QString::fromStdString(ms_data_ptr->run.id));
// And if it is possible, the real sample name because this one is for the
// end user to recognize his sample:
ms_run_id.setSampleName(msrun_id_str);
ms_run_ids.push_back(std::make_shared<MsRunId>(ms_run_id));
iter++;
}
}
}
return ms_run_ids;
}
pappso::MsFileReader::m_fileName
QString m_fileName
Definition msfilereader.h:16
pappso::MzcborMsFileReader::m_mzcborIndexReader
pappso::cbor::mzcbor::MzcborIndexReader m_mzcborIndexReader
Definition mzcbormsfilereader.h:39
pappso::MzcborMsFileReader::m_mzcborReaderBase
pappso::cbor::mzcbor::MzcborReaderBase m_mzcborReaderBase
Definition mzcbormsfilereader.h:38
pappso::Utils::getLexicalOrderedString
static const QString getLexicalOrderedString(unsigned int num)
Definition utils.cpp:72
pappso::Enums::MsDataFormat::mzcbor
@ mzcbor
Definition types.h:167

References pappso::Utils::getLexicalOrderedString(), pappso::MsFileReader::m_fileFormat, pappso::MsFileReader::m_fileName, m_mzcborIndexReader, m_mzcborReaderBase, pappso::Enums::mzcbor, pappso::MsRunId::setMsDataFormat(), pappso::MsRunId::setSampleName(), and pappso::MsRunId::setXmlId().

Referenced by pappso::MsFileAccessor::getMsRunIds().

## initialize()

std::size_t pappso::MzcborMsFileReader::initialize | ( |  | ) |

private virtual

Definition at line 35 of file mzcbormsfilereader.cpp.

{
pappso::UiMonitorVoid monitor;
QString str_index_file = m_fileName;
QFileInfo mzcbor_index_fileinfo(str_index_file.append(".idx"));
if(mzcbor_index_fileinfo.exists())
{
qDebug() << "mzcbor_index_fileinfo.exists()";
QFile mzcbor_index_file(mzcbor_index_fileinfo.absoluteFilePath());
mzcbor_index_file.open(QIODevice::ReadOnly);
m_mzcborIndexReader.readCbor(&mzcbor_index_file);
if(m_mzcborIndexReader.isMzcborIndex())
{
m_fileFormat = pappso::Enums::MsDataFormat::mzcbor;
}
m_mzcborIndexReader.close();
mzcbor_index_file.close();
qDebug() << m_mzcborIndexReader.getRunIdList().size();
return m_mzcborIndexReader.getRunIdList().size();
}
else
{
qDebug();
QFile mzcbor_file(m_fileName);
mzcbor_file.open(QIODevice::ReadOnly);
m_mzcborReaderBase.readCbor(&mzcbor_file, monitor);
if(m_mzcborReaderBase.isMzcbor())
{
m_fileFormat = pappso::Enums::MsDataFormat::mzcbor;
}
m_mzcborReaderBase.close();
mzcbor_file.close();
qDebug() << m_mzcborReaderBase.getMsrunIdList().join(" ");
return m_mzcborReaderBase.getMsrunIdList().size();
}
}

References pappso::MsFileReader::m_fileFormat, pappso::MsFileReader::m_fileName, m_mzcborIndexReader, m_mzcborReaderBase, and pappso::Enums::mzcbor.

Referenced by MzcborMsFileReader().

## Member Data Documentation

## m_msDataPtrVector

std::vector<pwiz::msdata::MSDataPtr> pappso::MzcborMsFileReader::m_msDataPtrVector

private

Definition at line 36 of file mzcbormsfilereader.h.

## m_mzcborIndexReader

pappso::cbor::mzcbor::MzcborIndexReader pappso::MzcborMsFileReader::m_mzcborIndexReader

private

Definition at line 39 of file mzcbormsfilereader.h.

Referenced by getMsRunIds(), and initialize().

## m_mzcborReaderBase

pappso::cbor::mzcbor::MzcborReaderBase pappso::MzcborMsFileReader::m_mzcborReaderBase

private

Definition at line 38 of file mzcbormsfilereader.h.

Referenced by getMsRunIds(), and initialize().

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

- pappsomspp/core/msfile/mzcbormsfilereader.h
- pappsomspp/core/msfile/mzcbormsfilereader.cpp