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
virtual const OboPsiModTerm | getOboPsiModTermInstrumentModelName () const override
| get OboPsiModTerm corresponding to the instrument model name child of : [Term] id: MS:1000031 name: instrument model def: "Instrument model name not including the vendor's name." [PSI:MS] relationship: part_of MS:1000463 ! instrument
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
| function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
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.
virtual std::size_t | spectrumStringIdentifier2SpectrumIndex (const QString &spectrum_identifier)=0
| if possible, get the spectrum index given a string identifier throw a not found exception if spectrum identifier is not found
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 38 of file timsmsrunreaderbase.cpp.

: MsRunReader(msrun_id_csp)
{
initialize();
}
pappso::TimsMsRunReaderBase::initialize
virtual void initialize() override
Definition timsmsrunreaderbase.cpp:57
pappso::MsRunReader
class PMSPP_LIB_DECL MsRunReader
Definition msrunreader.h:56

References pappso::MsRunReader::MsRunReader(), and initialize().

Referenced by pappso::TimsFramesMsRunReader::TimsFramesMsRunReader(), pappso::TimsMsRunReader::TimsMsRunReader(), pappso::TimsMsRunReader::TimsMsRunReader(), TimsMsRunReaderBase(), pappso::TimsMsRunReaderDia::TimsMsRunReaderDia(), pappso::TimsMsRunReaderDia::TimsMsRunReaderDia(), pappso::TimsMsRunReaderMs2::TimsMsRunReaderMs2(), pappso::TimsMsRunReaderMs2::TimsMsRunReaderMs2(), pappso::TimsMsRunReader::MsFileAccessor, MsFileAccessor, pappso::TimsMsRunReaderDia::MsFileAccessor, and pappso::TimsMsRunReaderMs2::MsFileAccessor.

## TimsMsRunReaderBase() [2/2]

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

Definition at line 43 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:87

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

## ~TimsMsRunReaderBase()

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

virtual

Destructor

Definition at line 50 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 72 of file timsmsrunreaderbase.cpp.

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

Referenced by MsFileAccessor.

## 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 93 of file timsmsrunreaderbase.cpp.

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

References initialize(), and msp_timsData.

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

## getOboPsiModTermInstrumentModelName()

const pappso::OboPsiModTerm pappso::TimsMsRunReaderBase::getOboPsiModTermInstrumentModelName | ( |  | ) | const

override virtual

get OboPsiModTerm corresponding to the instrument model name child of : [Term] id: MS:1000031 name: instrument model def: "Instrument model name not including the vendor's name." [PSI:MS] relationship: part_of MS:1000463 ! instrument

Reimplemented from pappso::MsRunReader.

Definition at line 152 of file timsmsrunreaderbase.cpp.

{
pappso::FilterOboPsiModMap psims_map;
pappso::OboPsiMs psims_file(psims_map);
pappso::OboPsiModTerm term;
term = psims_map.getOboPsiModTermWithAccession("MS:1003123");
/*
* [Term]
id: MS:1003123
name: Bruker Daltonics timsTOF series
def: "Bruker Daltonics timsTOF series" [PSI:MS]
is_a: MS:1000122 ! Bruker Daltonics instrument model
*/
/*
*
[Term]
id: MS:1003124
name: timsTOF fleX
def: "Bruker Daltonics' timsTOF fleX" [PSI:MS]
is_a: MS:1003123 ! Bruker Daltonics timsTOF series
[Term]
id: MS:1003229
name: timsTOF
def: "Bruker Daltonics' timsTOF." [PSI:MS]
is_a: MS:1003123 ! Bruker Daltonics timsTOF series
[Term]
id: MS:1003230
name: timsTOF Pro 2
def: "Bruker Daltonics' timsTOF Pro 2." [PSI:MS]
is_a: MS:1003123 ! Bruker Daltonics timsTOF series
[Term]
id: MS:1003231
name: timsTOF SCP
def: "Bruker Daltonics' timsTOF SCP." [PSI:MS]
is_a: MS:1003123 ! Bruker Daltonics timsTOF series
[Term]
id: MS:1003383
name: timsTOF Ultra
def: "Bruker Daltonics' timsTOF Ultra." [PSI:MS]
is_a: MS:1003123 ! Bruker Daltonics timsTOF series
[Term]
id: MS:1003397
name: timsTOF fleX MALDI-2
def: "Bruker Daltonics' timsTOF fleX MALDI-2." [PSI:MS]
is_a: MS:1003123 ! Bruker Daltonics timsTOF series
[Term]
id: MS:1003404
name: timsTOF HT
def: "Bruker Daltonics' timsTOF HT." [PSI:MS]
is_a: MS:1003123 ! Bruker Daltonics timsTOF series
[Term]
id: MS:1003412
name: timsTOF Ultra 2
def: "Bruker Daltonics timsTOF Ultra 2." [PSI:MS]
is_a: MS:1003123 ! Bruker Daltonics timsTOF series
*/
QStringList timstof_list;
timstof_list << "MS:1003005"
<< "MS:1003412"
<< "MS:1003404"
<< "MS:1003397"
<< "MS:1003383"
<< "MS:1003231"
<< "MS:1003230"
<< "MS:1003229"
<< "MS:1003124";
QString instrument_name = msp_timsData.get()->getGlobalMetadataValue("InstrumentName").toString();
for(auto &accession : timstof_list)
{
pappso::OboPsiModTerm test_term = psims_map.getOboPsiModTermWithAccession(accession);
if(test_term.m_name == instrument_name)
{
term = test_term;
break;
}
}
return term;
}
pappso::FilterOboPsiModMap::getOboPsiModTermWithAccession
const OboPsiModTerm & getOboPsiModTermWithAccession(const QString &accession) const
Definition filterobopsimodmap.cpp:49
pappso::OboPsiModTerm::m_name
QString m_name
Definition obopsimodterm.h:58

References pappso::FilterOboPsiModMap::getOboPsiModTermWithAccession(), pappso::OboPsiModTerm::m_name, and msp_timsData.

Referenced by MsFileAccessor.

## 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 124 of file timsmsrunreaderbase.cpp.

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

References msp_timsData.

Referenced by MsFileAccessor.

## 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 111 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:93

References acquireDevice(), and msp_timsData.

Referenced by MsFileAccessor.

## getTimsDataSPtr()

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

virtual

give an access to the underlying raw data pointer

Reimplemented in pappso::TimsMsRunReaderMs2.

Definition at line 103 of file timsmsrunreaderbase.cpp.

{
acquireDevice();
return msp_timsData;
}

References acquireDevice(), and msp_timsData.

Referenced by MsFileAccessor.

## 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 79 of file timsmsrunreaderbase.cpp.

{
return false;
}

Referenced by MsFileAccessor.

## initialize()

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

override protected virtual

Implements pappso::MsRunReader.

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

Definition at line 57 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:194

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

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

## 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::TimsMsRunReaderDia, and pappso::TimsMsRunReaderMs2.

Definition at line 140 of file timsmsrunreaderbase.cpp.

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

Referenced by MsFileAccessor.

## 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::TimsMsRunReaderDia, and pappso::TimsMsRunReaderMs2.

Definition at line 131 of file timsmsrunreaderbase.cpp.

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

Referenced by MsFileAccessor.

## 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 86 of file timsmsrunreaderbase.cpp.

{
msp_timsData = nullptr;
return true;
}

References msp_timsData.

Referenced by MsFileAccessor.

## Friends And Related Symbol Documentation

## MsFileAccessor

friend class MsFileAccessor

friend

Definition at line 39 of file timsmsrunreaderbase.h.

References TimsMsRunReaderBase(), accept(), acquireDevice(), getOboPsiModTermInstrumentModelName(), getRetentionTimeLine(), getTicChromatogram(), getTimsDataSPtr(), hasScanNumbers(), initialize(), MsFileAccessor, newXicCoordSPtrFromQualifiedMassSpectrum(), newXicCoordSPtrFromSpectrumIndex(), and releaseDevice().

Referenced by MsFileAccessor.

## Member Data Documentation

## msp_timsData

TimsDataSp pappso::TimsMsRunReaderBase::msp_timsData = nullptr

protected

Definition at line 87 of file timsmsrunreaderbase.h.

Referenced by TimsMsRunReaderBase(), pappso::TimsFramesMsRunReader::~TimsFramesMsRunReader(), ~TimsMsRunReaderBase(), acquireDevice(), pappso::TimsMsRunReaderDia::acquireDevice(), pappso::TimsFramesMsRunReader::computeTicChromatogram(), getOboPsiModTermInstrumentModelName(), getRetentionTimeLine(), getTicChromatogram(), getTimsDataSPtr(), initialize(), pappso::TimsMsRunReaderDia::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/core/msrun/private/timsmsrunreaderbase.h
- pappsomspp/core/msrun/private/timsmsrunreaderbase.cpp