pappso::TimsMsFileReader Class Reference

`#include <timsmsfilereader.h>`

Inheritance diagram for pappso::TimsMsFileReader:

## Public Member Functions

| TimsMsFileReader (const QString &file_name)
virtual | ~TimsMsFileReader ()
virtual MzFormat | getFileFormat () override
virtual std::vector< MsRunIdCstSPtr > | getMsRunIds (const QString &run_prefix) override
MsRunReader * | selectMsRunReader (const QString &file_name) const

## Private Member Functions

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

## Additional Inherited Members

Private Attributes inherited from pappso::MsFileReader
QString | m_fileName
MzFormat | m_fileFormat = MzFormat::unknown

## Detailed Description

Todo:
  write docs

Definition at line 40 of file timsmsfilereader.h.

## Constructor & Destructor Documentation

## TimsMsFileReader()

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

Definition at line 39 of file timsmsfilereader.cpp.

: MsFileReader(file_name)
{
qDebug() << " " << m_fileName;
initialize();
}
pappso::MsFileReader::MsFileReader
MsFileReader(const QString &file_name)
Definition: msfilereader.cpp:19
pappso::MsFileReader::m_fileName
QString m_fileName
Definition: msfilereader.h:17
pappso::TimsMsFileReader::initialize
virtual std::size_t initialize()
Definition: timsmsfilereader.cpp:53

References initialize(), and pappso::MsFileReader::m_fileName.

## ~TimsMsFileReader()

pappso::TimsMsFileReader::~TimsMsFileReader | ( |  | ) |

virtual

Definition at line 47 of file timsmsfilereader.cpp.

{
}

## Member Function Documentation

## getFileFormat()

MzFormat pappso::TimsMsFileReader::getFileFormat | ( |  | ) |

override virtual

Implements pappso::MsFileReader.

Definition at line 80 of file timsmsfilereader.cpp.

{
return m_fileFormat;
}
pappso::MsFileReader::m_fileFormat
MzFormat m_fileFormat
Definition: msfilereader.h:18

References pappso::MsFileReader::m_fileFormat.

Referenced by pappso::MsFileAccessor::buildTimsMsRunReaderMs2SPtr(), and pappso::MsFileAccessor::getMsRunIds().

## getMsRunIds()

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

override virtual

Implements pappso::MsFileReader.

Definition at line 87 of file timsmsfilereader.cpp.

{
std::vector<MsRunIdCstSPtr> ms_run_ids;
if(!initialize())
return ms_run_ids;
// Finally create the MsRunId with the file name.
MsRunId ms_run_id(m_fileName);
ms_run_id.setMzFormat(m_fileFormat);
// We need to set the unambiguous xmlId string.
ms_run_id.setXmlId(QString("%1a1").arg(run_prefix));
ms_run_id.setRunId("a1");
// Now set the sample name to the run id:
ms_run_id.setSampleName(QFileInfo(m_fileName).baseName());
qDebug() << "Current ms_run_id:" << ms_run_id.toString();
// Finally make a shared pointer out of it and append it to the vector.
ms_run_ids.push_back(std::make_shared<MsRunId>(ms_run_id));
return ms_run_ids;
}

References initialize(), pappso::MsFileReader::m_fileFormat, pappso::MsFileReader::m_fileName, pappso::MsRunId::setMzFormat(), pappso::MsRunId::setRunId(), pappso::MsRunId::setSampleName(), pappso::MsRunId::setXmlId(), and pappso::MsRunId::toString().

Referenced by pappso::MsFileAccessor::buildTimsMsRunReaderMs2SPtr(), and pappso::MsFileAccessor::getMsRunIds().

## initialize()

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

private virtual

Definition at line 53 of file timsmsfilereader.cpp.

{
m_fileFormat = MzFormat::unknown;
try
{
TimsData tims_data(m_fileName);
m_fileFormat = MzFormat::brukerTims;
}
catch(ExceptionNotImplemented &error)
{
m_fileFormat = MzFormat::brukerTims;
throw pappso::ExceptionNotImplemented(
QObject::tr("Error reading Bruker tims data in %1 :\n%2")
.arg(m_fileName)
.arg(error.qwhat()));
}
catch(PappsoException &error)
{
return 0;
}
return 1;
}
pappso::ExceptionNotImplemented
Definition: exceptionnotimplemented.h:32
pappso::MzFormat::brukerTims
@ brukerTims
pappso::MzFormat::unknown
@ unknown
unknown format

References pappso::brukerTims, pappso::MsFileReader::m_fileFormat, pappso::MsFileReader::m_fileName, pappso::PappsoException::qwhat(), and pappso::unknown.

Referenced by TimsMsFileReader(), and getMsRunIds().

## selectMsRunReader()

MsRunReader* pappso::TimsMsFileReader::selectMsRunReader | ( | const QString & | file_name | ) | const

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

- pappsomspp/msfile/timsmsfilereader.h
- pappsomspp/msfile/timsmsfilereader.cpp