pappso::TimsMsRunReader Class Reference

`#include <timsmsrunreader.h>`

Inheritance diagram for pappso::TimsMsRunReader:

## Public Member Functions

| TimsMsRunReader (MsRunIdCstSPtr &msrun_id_csp)
virtual | ~TimsMsRunReader ()
virtual MassSpectrumSPtr | massSpectrumSPtr (std::size_t spectrum_index) override
| get a MassSpectrumSPtr class given its spectrum index More...
virtual MassSpectrumCstSPtr | massSpectrumCstSPtr (std::size_t spectrum_index) override
virtual QualifiedMassSpectrum | qualifiedMassSpectrum (std::size_t spectrum_index, bool want_binary_data=true) const override
| get a QualifiedMassSpectrum class given its scan number More...
virtual void | readSpectrumCollection (SpectrumCollectionHandlerInterface &handler) override
| function to visit an MsRunReader and get each Spectrum in a spectrum collection handler More...
virtual void | readSpectrumCollectionByMsLevel (SpectrumCollectionHandlerInterface &handler, unsigned int ms_level) override
| function to visit an MsRunReader and get each Spectrum in a spectrum collection handler by Ms Levels More...
virtual pappso::XicCoordSPtr | newXicCoordSPtrFromSpectrumIndex (std::size_t spectrum_index, pappso::PrecisionPtr precision) const override
| get a xic coordinate object from a given spectrum index More...
virtual pappso::XicCoordSPtr | newXicCoordSPtrFromQualifiedMassSpectrum (const pappso::QualifiedMassSpectrum &mass_spectrum, pappso::PrecisionPtr precision) const override
| get a xic coordinate object from a given spectrum More...
virtual std::size_t | spectrumListSize () const override
| get the totat number of spectrum conained in the MSrun data file More...
virtual bool | hasScanNumbers () const override
| tells if spectra can be accessed using scan numbers by default, it returns false. Only overrided functions can check if scan numbers are available in the current file More...
virtual bool | releaseDevice () override
| release data back end device if a the data back end is released, the developper has to use acquireDevice before using the msrunreader object More...
virtual bool | acquireDevice () override
| acquire data back end device More...
virtual TimsDataSp | getTimsDataSPtr ()
| give an access to the underlying raw data pointer More...
virtual Trace | getTicChromatogram () override
Public Member Functions inherited from pappso::MsRunReader
| MsRunReader (MsRunIdCstSPtr &ms_run_id)
| MsRunReader (const MsRunReader &other)
virtual | ~MsRunReader ()
const MsRunIdCstSPtr & | getMsRunId () const
virtual std::size_t | scanNumber2SpectrumIndex (std::size_t scan_number)
| if possible, converts a scan number into a spectrum index This is a convenient function to help transition from the old scan number (not implemented by all vendors) to more secure spectrum index (not vendor dependant). It is better to not rely on this function. More...
virtual std::vector< double > | getRetentionTimeLine ()
| retention timeline get retention times along the MSrun in seconds More...

## Protected Member Functions

virtual void | initialize () override
virtual bool | accept (const QString &file_name) const override
| tells if the reader is able to handle this file must be implemented by private MS run reader, specific of one or more file format More...

## Private Attributes

TimsDataSp | msp_timsData = nullptr

## Friends

class | MsFileAccessor

## Additional Inherited Members

Protected Attributes inherited from pappso::MsRunReader
MsRunIdCstSPtr | mcsp_msRunId
MsRunReaderScanNumberMultiMap * | mpa_multiMapScanNumber = nullptr

## Detailed Description

Definition at line 38 of file timsmsrunreader.h.

## Constructor & Destructor Documentation

## TimsMsRunReader()

TimsMsRunReader::TimsMsRunReader | ( | MsRunIdCstSPtr & | msrun_id_csp | ) |

Todo:
  write docs

Definition at line 34 of file timsmsrunreader.cpp.

: MsRunReader(msrun_id_csp)
{
initialize();
}
pappso::MsRunReader::MsRunReader
MsRunReader(MsRunIdCstSPtr &ms_run_id)
Definition: msrunreader.cpp:257
pappso::TimsMsRunReader::initialize
virtual void initialize() override
Definition: timsmsrunreader.cpp:46

References initialize().

## ~TimsMsRunReader()

TimsMsRunReader::~TimsMsRunReader | ( |  | ) |

virtual

Definition at line 40 of file timsmsrunreader.cpp.

{
msp_timsData = nullptr;
}
pappso::TimsMsRunReader::msp_timsData
TimsDataSp msp_timsData
Definition: timsmsrunreader.h:94

References msp_timsData.

## Member Function Documentation

## accept()

bool TimsMsRunReader::accept | ( | const QString & | file_name | ) | const

override protected virtual

tells if the reader is able to handle this file must be implemented by private MS run reader, specific of one or more file format

Implements pappso::MsRunReader.

Definition at line 59 of file timsmsrunreader.cpp.

{
qDebug() << file_name;
return true;
}

## acquireDevice()

bool TimsMsRunReader::acquireDevice | ( |  | ) |

override virtual

acquire data back end device

Returns
  bool true if done

Implements pappso::MsRunReader.

Definition at line 145 of file timsmsrunreader.cpp.

{
if(msp_timsData == nullptr)
{
initialize();
}
return true;
}

References initialize(), and msp_timsData.

Referenced by getTicChromatogram(), and getTimsDataSPtr().

## getTicChromatogram()

Trace TimsMsRunReader::getTicChromatogram | ( |  | ) |

override virtual

Reimplemented from pappso::MsRunReader.

Definition at line 187 of file timsmsrunreader.cpp.

{
// Use the Sqlite database to fetch the total ion current chromatogram (TIC
// chromatogram).
acquireDevice();
return msp_timsData->getTicChromatogram();
}
pappso::TimsMsRunReader::acquireDevice
virtual bool acquireDevice() override
acquire data back end device
Definition: timsmsrunreader.cpp:145

References acquireDevice(), and msp_timsData.

## getTimsDataSPtr()

TimsDataSp TimsMsRunReader::getTimsDataSPtr | ( |  | ) |

virtual

give an access to the underlying raw data pointer

Definition at line 179 of file timsmsrunreader.cpp.

{
acquireDevice();
return msp_timsData;
}

References acquireDevice(), and msp_timsData.

## hasScanNumbers()

bool TimsMsRunReader::hasScanNumbers | ( |  | ) | const

override virtual

tells if spectra can be accessed using scan numbers by default, it returns false. Only overrided functions can check if scan numbers are available in the current file

Reimplemented from pappso::MsRunReader.

Definition at line 131 of file timsmsrunreader.cpp.

{
return false;
}

## initialize()

void TimsMsRunReader::initialize | ( |  | ) |

override protected virtual

Implements pappso::MsRunReader.

Definition at line 46 of file timsmsrunreader.cpp.

{
msp_timsData = std::make_shared<TimsData>(mcsp_msRunId.get()->getFileName());
if(msp_timsData == nullptr)
{
throw PappsoException(QObject::tr("ERROR in TimsMsRunReader::initialize "
"msp_timsData is null for MsRunId %1")
.arg(mcsp_msRunId.get()->toString()));
}
}
pappso::MsRunReader::mcsp_msRunId
MsRunIdCstSPtr mcsp_msRunId
Definition: msrunreader.h:282
pappso::PappsoException
Definition: pappsoexception.h:42

References pappso::MsRunReader::mcsp_msRunId, and msp_timsData.

Referenced by TimsMsRunReader(), and acquireDevice().

## massSpectrumCstSPtr()

pappso::MassSpectrumCstSPtr TimsMsRunReader::massSpectrumCstSPtr | ( | std::size_t | spectrum_index | ) |

override virtual

Implements pappso::MsRunReader.

Definition at line 76 of file timsmsrunreader.cpp.

{
return msp_timsData->getMassSpectrumCstSPtrByRawIndex(spectrum_index);
}

References msp_timsData.

## massSpectrumSPtr()

pappso::MassSpectrumSPtr TimsMsRunReader::massSpectrumSPtr | ( | std::size_t | spectrum_index | ) |

override virtual

get a MassSpectrumSPtr class given its spectrum index

Implements pappso::MsRunReader.

Definition at line 67 of file timsmsrunreader.cpp.

{
throw ExceptionNotImplemented(
QObject::tr("Not yet implemented in TimsMsRunReader %1.\n").arg(__LINE__));
return pappso::MassSpectrumSPtr();
}
pappso::ExceptionNotImplemented
Definition: exceptionnotimplemented.h:32
pappso::MassSpectrumSPtr
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
Definition: massspectrum.h:54

## newXicCoordSPtrFromQualifiedMassSpectrum()

XicCoordSPtr TimsMsRunReader::newXicCoordSPtrFromQualifiedMassSpectrum | ( | const pappso::QualifiedMassSpectrum & | mass_spectrum,
|  | pappso::PrecisionPtr | precision
| ) |  | const

override virtual

get a xic coordinate object from a given spectrum

Implements pappso::MsRunReader.

Definition at line 168 of file timsmsrunreader.cpp.

{
throw ExceptionNotImplemented(QObject::tr("Not implemented %1 %2 %3")
.arg(__FILE__)
.arg(__FUNCTION__)
.arg(__LINE__));
}

## newXicCoordSPtrFromSpectrumIndex()

XicCoordSPtr TimsMsRunReader::newXicCoordSPtrFromSpectrumIndex | ( | std::size_t | spectrum_index,
|  | pappso::PrecisionPtr | precision
| ) |  | const

override virtual

get a xic coordinate object from a given spectrum index

Implements pappso::MsRunReader.

Definition at line 156 of file timsmsrunreader.cpp.

{
throw ExceptionNotImplemented(QObject::tr("Not implemented %1 %2 %3")
.arg(__FILE__)
.arg(__FUNCTION__)
.arg(__LINE__));
}

## qualifiedMassSpectrum()

QualifiedMassSpectrum TimsMsRunReader::qualifiedMassSpectrum | ( | std::size_t | spectrum_index,
|  | bool | want_binary_data = `true`
| ) |  | const

override virtual

get a QualifiedMassSpectrum class given its scan number

Implements pappso::MsRunReader.

Definition at line 83 of file timsmsrunreader.cpp.

{
QualifiedMassSpectrum mass_spectrum;
msp_timsData->getQualifiedMassSpectrumByRawIndex(
getMsRunId(), mass_spectrum, spectrum_index, want_binary_data);
return mass_spectrum;
}
pappso::MsRunReader::getMsRunId
const MsRunIdCstSPtr & getMsRunId() const
Definition: msrunreader.cpp:269
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition: qualifiedmassspectrum.h:85

References pappso::MsRunReader::getMsRunId(), and msp_timsData.

## readSpectrumCollection()

void TimsMsRunReader::readSpectrumCollection | ( | SpectrumCollectionHandlerInterface & | handler | ) |

override virtual

function to visit an MsRunReader and get each Spectrum in a spectrum collection handler

Implements pappso::MsRunReader.

Definition at line 96 of file timsmsrunreader.cpp.

{
readSpectrumCollectionByMsLevel(handler, 0);
}
pappso::TimsMsRunReader::readSpectrumCollectionByMsLevel
virtual void readSpectrumCollectionByMsLevel(SpectrumCollectionHandlerInterface &handler, unsigned int ms_level) override
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler by Ms Levels
Definition: timsmsrunreader.cpp:104

References readSpectrumCollectionByMsLevel().

## readSpectrumCollectionByMsLevel()

void TimsMsRunReader::readSpectrumCollectionByMsLevel | ( | SpectrumCollectionHandlerInterface & | handler,
|  | unsigned int | ms_level
| ) |  |

override virtual

function to visit an MsRunReader and get each Spectrum in a spectrum collection handler by Ms Levels

Implements pappso::MsRunReader.

Definition at line 104 of file timsmsrunreader.cpp.

{
qDebug();
msp_timsData.get()->rawReaderSpectrumCollectionByMsLevel(
getMsRunId(), handler, ms_level);
// Now let the loading handler know that the loading of the data has ended.
// The handler might need this "signal" to perform additional tasks or to
// cleanup cruft.
// qDebug() << "Loading ended";
handler.loadingEnded();
}
pappso::SpectrumCollectionHandlerInterface::loadingEnded
virtual void loadingEnded()
Definition: msrunreader.cpp:48

References pappso::MsRunReader::getMsRunId(), pappso::SpectrumCollectionHandlerInterface::loadingEnded(), and msp_timsData.

Referenced by readSpectrumCollection().

## releaseDevice()

bool TimsMsRunReader::releaseDevice | ( |  | ) |

override virtual

release data back end device if a the data back end is released, the developper has to use acquireDevice before using the msrunreader object

Returns
  bool true if done

Implements pappso::MsRunReader.

Definition at line 138 of file timsmsrunreader.cpp.

{
msp_timsData = nullptr;
return true;
}

References msp_timsData.

## spectrumListSize()

std::size_t TimsMsRunReader::spectrumListSize | ( |  | ) | const

override virtual

get the totat number of spectrum conained in the MSrun data file

Implements pappso::MsRunReader.

Definition at line 124 of file timsmsrunreader.cpp.

{
return msp_timsData->getTotalNumberOfScans();
}

References msp_timsData.

## Friends And Related Function Documentation

## MsFileAccessor

friend class MsFileAccessor

friend

Definition at line 40 of file timsmsrunreader.h.

## Member Data Documentation

## msp_timsData

TimsDataSp pappso::TimsMsRunReader::msp_timsData = nullptr

private

Definition at line 94 of file timsmsrunreader.h.

Referenced by ~TimsMsRunReader(), acquireDevice(), getTicChromatogram(), getTimsDataSPtr(), initialize(), massSpectrumCstSPtr(), qualifiedMassSpectrum(), readSpectrumCollectionByMsLevel(), releaseDevice(), and spectrumListSize().

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

- pappsomspp/msrun/private/timsmsrunreader.h
- pappsomspp/msrun/private/timsmsrunreader.cpp