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

`#include <timsmsrunreaderbase.h>`

Inheritance diagram for pappso::TimsMsRunReaderBase:

## Public Member Functions

| TimsMsRunReaderBase (MsRunIdCstSPtr &msrun_id_csp)
| TimsMsRunReaderBase (const TimsMsRunReaderBase &msrun_reader_base)
virtual | ~TimsMsRunReaderBase ()
virtual TimsDataSp | getTimsDataSPtr ()
| give an access to the underlying raw data pointer
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
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
virtual bool | acquireDevice () override
| acquire data back end device
virtual Trace | getTicChromatogram () override
| get a TIC chromatogram
virtual std::vector< double > | getRetentionTimeLine () override
| retention timeline get retention times along the MSrun in seconds
virtual pappso::XicCoordSPtr | newXicCoordSPtrFromSpectrumIndex (std::size_t spectrum_index, pappso::PrecisionPtr precision) const override
| get a xic coordinate object from a given spectrum index
virtual pappso::XicCoordSPtr | newXicCoordSPtrFromQualifiedMassSpectrum (const pappso::QualifiedMassSpectrum &mass_spectrum, pappso::PrecisionPtr precision) const override
| get a xic coordinate object from a given spectrum
Public Member Functions inherited from pappso::MsRunReader
| MsRunReader (const MsRunIdCstSPtr &ms_run_id)
| MsRunReader (const MsRunReader &other)
virtual | ~MsRunReader ()
const MsRunIdCstSPtr & | getMsRunId () const
virtual MassSpectrumSPtr | massSpectrumSPtr (std::size_t spectrum_index)=0
| get a MassSpectrumSPtr class given its spectrum index
virtual MassSpectrumCstSPtr | massSpectrumCstSPtr (std::size_t spectrum_index)=0
virtual QualifiedMassSpectrum | qualifiedMassSpectrum (std::size_t spectrum_index, bool want_binary_data=true) const =0
| get a QualifiedMassSpectrum class given its scan number
virtual std::size_t | spectrumListSize () const =0
| get the totat number of spectrum conained in the MSrun data file
virtual void | readSpectrumCollection (SpectrumCollectionHandlerInterface &handler)=0
| function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
virtual void | readSpectrumCollection2 (const MsRunReadConfig &config, SpectrumCollectionHandlerInterface &handler)=0
virtual void | readSpectrumCollectionByMsLevel (SpectrumCollectionHandlerInterface &handler, unsigned int ms_level)=0
| function to visit an MsRunReader and get each Spectrum in a spectrum collection handler by Ms Levels
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.
void | setMonoThread (bool is_mono_thread)
| set only one is_mono_thread to true
bool | isMonoThread () const

## 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

## Protected Attributes

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

## Friends

class | MsFileAccessor

## Detailed Description

Definition at line 37 of file timsmsrunreaderbase.h.

## Constructor & Destructor Documentation

## TimsMsRunReaderBase() [1/2]

pappso::TimsMsRunReaderBase::TimsMsRunReaderBase | ( | MsRunIdCstSPtr & | msrun_id_csp | ) |

Default constructor

Definition at line 36 of file timsmsrunreaderbase.cpp.

: MsRunReader(msrun_id_csp)
{
initialize();
}
pappso::MsRunReader::MsRunReader
MsRunReader(const MsRunIdCstSPtr &ms_run_id)
Definition msrunreader.cpp:43
pappso::TimsMsRunReaderBase::initialize
virtual void initialize() override
Definition timsmsrunreaderbase.cpp:58

References initialize().

## TimsMsRunReaderBase() [2/2]

pappso::TimsMsRunReaderBase::TimsMsRunReaderBase | ( | const TimsMsRunReaderBase & | msrun_reader_base | ) |

Definition at line 42 of file timsmsrunreaderbase.cpp.

: MsRunReader(msrun_reader_base.getMsRunId()),
msp_timsData(msrun_reader_base.msp_timsData)
{
initialize();
}
pappso::TimsMsRunReaderBase::msp_timsData
TimsDataSp msp_timsData
Definition timsmsrunreaderbase.h:84

References initialize().

## ~TimsMsRunReaderBase()

pappso::TimsMsRunReaderBase::~TimsMsRunReaderBase | ( |  | ) |

virtual

Destructor

Definition at line 51 of file timsmsrunreaderbase.cpp.

{
msp_timsData = nullptr;
}

References msp_timsData.

## Member Function Documentation

## accept()

bool pappso::TimsMsRunReaderBase::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.

Reimplemented in pappso::TimsMsRunReaderMs2, and pappso::TimsMsRunReaderMs2Selected.

Definition at line 75 of file timsmsrunreaderbase.cpp.

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

## acquireDevice()

bool pappso::TimsMsRunReaderBase::acquireDevice | ( |  | ) |

override virtual

acquire data back end device

Returns
  bool true if done

Implements pappso::MsRunReader.

Reimplemented in pappso::TimsMsRunReaderDia, and pappso::TimsMsRunReaderMs2.

Definition at line 96 of file timsmsrunreaderbase.cpp.

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

References initialize(), and msp_timsData.

Referenced by pappso::TimsMsRunReaderDia::acquireDevice(), getTicChromatogram(), and getTimsDataSPtr().

## getRetentionTimeLine()

std::vector< double > pappso::TimsMsRunReaderBase::getRetentionTimeLine | ( |  | ) |

override virtual

retention timeline get retention times along the MSrun in seconds

Returns
  vector of retention times (seconds)

Reimplemented from pappso::MsRunReader.

Reimplemented in pappso::TimsMsRunReaderMs2.

Definition at line 127 of file timsmsrunreaderbase.cpp.

{
return msp_timsData.get()->getRetentionTimeLineInSeconds();
}

## getTicChromatogram()

Trace pappso::TimsMsRunReaderBase::getTicChromatogram | ( |  | ) |

override virtual

get a TIC chromatogram

for each retention time, computes the sum of all intensities. For IM-MS, combines the mobility spectra

Note that, formally, a TIC chromatogram is computed only for MS1 spectra.

Returns
  a trace (x=rt, y=intensities)

Reimplemented from pappso::MsRunReader.

Reimplemented in pappso::TimsMsRunReaderMs2.

Definition at line 114 of file timsmsrunreaderbase.cpp.

{
// Use the Sqlite database to fetch the total ion current chromatogram (TIC
// chromatogram).
acquireDevice();
// The time unit here is seconds, not minutes!!!
return msp_timsData->getTicChromatogram();
}
pappso::TimsMsRunReaderBase::acquireDevice
virtual bool acquireDevice() override
acquire data back end device
Definition timsmsrunreaderbase.cpp:96

References acquireDevice(), and msp_timsData.

## getTimsDataSPtr()

TimsDataSp pappso::TimsMsRunReaderBase::getTimsDataSPtr | ( |  | ) |

virtual

give an access to the underlying raw data pointer

Reimplemented in pappso::TimsMsRunReaderMs2.

Definition at line 106 of file timsmsrunreaderbase.cpp.

{
acquireDevice();
return msp_timsData;
}

References acquireDevice(), and msp_timsData.

## hasScanNumbers()

bool pappso::TimsMsRunReaderBase::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.

Reimplemented in pappso::TimsMsRunReaderMs2, and pappso::TimsMsRunReaderMs2Selected.

Definition at line 82 of file timsmsrunreaderbase.cpp.

{
return false;
}

## initialize()

void pappso::TimsMsRunReaderBase::initialize | ( |  | ) |

override protected virtual

Implements pappso::MsRunReader.

Reimplemented in pappso::TimsMsRunReaderDia, pappso::TimsMsRunReaderMs2, and pappso::TimsMsRunReaderMs2Selected.

Definition at line 58 of file timsmsrunreaderbase.cpp.

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

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

Referenced by pappso::TimsMsRunReader::TimsMsRunReader(), pappso::TimsMsRunReader::TimsMsRunReader(), TimsMsRunReaderBase(), TimsMsRunReaderBase(), and acquireDevice().

## newXicCoordSPtrFromQualifiedMassSpectrum()

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

override virtual

get a xic coordinate object from a given spectrum

Implements pappso::MsRunReader.

Reimplemented in pappso::TimsMsRunReaderMs2, and pappso::TimsMsRunReaderDia.

Definition at line 145 of file timsmsrunreaderbase.cpp.

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

## newXicCoordSPtrFromSpectrumIndex()

XicCoordSPtr pappso::TimsMsRunReaderBase::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.

Reimplemented in pappso::TimsMsRunReaderMs2, and pappso::TimsMsRunReaderDia.

Definition at line 134 of file timsmsrunreaderbase.cpp.

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

## releaseDevice()

bool pappso::TimsMsRunReaderBase::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.

Reimplemented in pappso::TimsMsRunReaderMs2.

Definition at line 89 of file timsmsrunreaderbase.cpp.

{
msp_timsData = nullptr;
return true;
}

References msp_timsData.

## Friends And Related Symbol Documentation

## MsFileAccessor

friend class MsFileAccessor

friend

Definition at line 39 of file timsmsrunreaderbase.h.

## Member Data Documentation

## msp_timsData

TimsDataSp pappso::TimsMsRunReaderBase::msp_timsData = nullptr

protected

Definition at line 84 of file timsmsrunreaderbase.h.

Referenced by pappso::TimsFramesMsRunReader::~TimsFramesMsRunReader(), ~TimsMsRunReaderBase(), acquireDevice(), pappso::TimsMsRunReaderDia::acquireDevice(), pappso::TimsFramesMsRunReader::computeTicChromatogram(), getTicChromatogram(), getTimsDataSPtr(), initialize(), pappso::TimsFramesMsRunReader::massSpectrumCstSPtr(), pappso::TimsMsRunReader::massSpectrumCstSPtr(), pappso::TimsFramesMsRunReader::qualifiedMassSpectrum(), pappso::TimsMsRunReader::qualifiedMassSpectrum(), pappso::TimsFramesMsRunReader::readSpectrumCollection2(), pappso::TimsMsRunReader::readSpectrumCollection2(), pappso::TimsMsRunReader::readSpectrumCollectionByMsLevel(), releaseDevice(), pappso::TimsFramesMsRunReader::spectrumListSize(), and pappso::TimsMsRunReader::spectrumListSize().

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

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