libpappsomspp
Library for mass spectrometry
|
base class to read MSrun the only way to build a MsRunReader object is to use the MsRunReaderFactory More...
#include <msrunreader.h>
Public Member Functions | |
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 XicCoordSPtr | newXicCoordSPtrFromSpectrumIndex (std::size_t spectrum_index, PrecisionPtr precision) const =0 |
get a xic coordinate object from a given spectrum index | |
virtual XicCoordSPtr | newXicCoordSPtrFromQualifiedMassSpectrum (const QualifiedMassSpectrum &mass_spectrum, PrecisionPtr precision) const =0 |
get a xic coordinate object from a given spectrum | |
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. | |
virtual bool | hasScanNumbers () const |
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 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 | |
virtual bool | releaseDevice ()=0 |
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 ()=0 |
acquire data back end device | |
virtual std::vector< double > | getRetentionTimeLine () |
retention timeline get retention times along the MSrun in seconds | |
virtual Trace | getTicChromatogram () |
get a TIC chromatogram | |
void | setMonoThread (bool is_mono_thread) |
set only one is_mono_thread to true | |
bool | isMonoThread () const |
virtual const OboPsiModTerm | getOboPsiModTermInstrumentModelName () const |
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 | |
Protected Member Functions | |
virtual void | initialize ()=0 |
virtual bool | accept (const QString &file_name) const =0 |
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 | |
MsRunIdCstSPtr | mcsp_msRunId |
MsRunReaderScanNumberMultiMap * | mpa_multiMapScanNumber = nullptr |
Private Attributes | |
bool | m_isMonoThread = false |
Friends | |
class | MsFileAccessor |
base class to read MSrun the only way to build a MsRunReader object is to use the MsRunReaderFactory
Definition at line 63 of file msrunreader.h.
pappso::MsRunReader::MsRunReader | ( | const MsRunIdCstSPtr & | ms_run_id | ) |
Definition at line 44 of file msrunreader.cpp.
References mcsp_msRunId.
Referenced by pappso::BafAsciiMsRunReader::BafAsciiMsRunReader(), MsRunReader(), pappso::PwizMsRunReader::PwizMsRunReader(), pappso::TimsMsRunReaderBase::TimsMsRunReaderBase(), pappso::TimsMsRunReaderBase::TimsMsRunReaderBase(), pappso::XyMsRunReader::XyMsRunReader(), and MsFileAccessor.
pappso::MsRunReader::MsRunReader | ( | const MsRunReader & | other | ) |
Definition at line 48 of file msrunreader.cpp.
References MsRunReader(), m_isMonoThread, mcsp_msRunId, and mpa_multiMapScanNumber.
|
virtual |
Definition at line 62 of file msrunreader.cpp.
References mpa_multiMapScanNumber.
|
protectedpure 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
Implemented in pappso::BafAsciiMsRunReader, pappso::PwizMsRunReader, pappso::TimsMsRunReaderBase, pappso::TimsMsRunReaderMs2, pappso::TimsMsRunReaderMs2Selected, and pappso::XyMsRunReader.
|
pure virtual |
acquire data back end device
Implemented in pappso::BafAsciiMsRunReader, pappso::PwizMsRunReader, pappso::TimsMsRunReaderBase, pappso::TimsMsRunReaderDia, pappso::TimsMsRunReaderMs2, and pappso::XyMsRunReader.
References getOboPsiModTermInstrumentModelName(), getRetentionTimeLine(), getTicChromatogram(), isMonoThread(), and setMonoThread().
const MsRunIdCstSPtr & pappso::MsRunReader::getMsRunId | ( | ) | const |
Definition at line 56 of file msrunreader.cpp.
References mcsp_msRunId.
Referenced by pappso::TimsMsRunReaderBase::TimsMsRunReaderBase(), MsFileAccessor, pappso::TimsFramesMsRunReader::qualifiedMassSpectrum(), pappso::TimsMsRunReader::qualifiedMassSpectrum(), pappso::TimsMsRunReaderDia::qualifiedMassSpectrum(), pappso::TimsMsRunReaderMs2::qualifiedMassSpectrum(), pappso::TimsMsRunReaderMs2Selected::qualifiedMassSpectrum(), pappso::TimsFramesMsRunReader::readSpectrumCollection2(), pappso::TimsMsRunReader::readSpectrumCollection2(), pappso::TimsMsRunReader::readSpectrumCollectionByMsLevel(), pappso::TimsMsRunReaderMs2::readSpectrumCollectionByMsLevel(), and pappso::MzxmlOutput::writeHeader().
|
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 in pappso::PwizMsRunReader, and pappso::TimsMsRunReaderBase.
Definition at line 181 of file msrunreader.cpp.
References mcsp_msRunId.
Referenced by acquireDevice().
|
virtual |
retention timeline get retention times along the MSrun in seconds
Reimplemented in pappso::TimsMsRunReaderBase, and pappso::TimsMsRunReaderMs2.
Definition at line 118 of file msrunreader.cpp.
References pappso::MsRunReaderRetentionTimeLine::getRetentionTimeLine(), mcsp_msRunId, pappso::PappsoException::qwhat(), readSpectrumCollection2(), pappso::MsRunReadConfig::setMsLevels(), and pappso::MsRunReadConfig::setNeedPeakList().
Referenced by acquireDevice().
|
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.
Reimplemented in pappso::TimsMsRunReaderBase, and pappso::TimsMsRunReaderMs2.
Definition at line 151 of file msrunreader.cpp.
References pappso::MsRunReaderTicChromatogram::getTicChromatogram(), mcsp_msRunId, pappso::PappsoException::qwhat(), and readSpectrumCollection().
Referenced by acquireDevice().
|
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 in pappso::PwizMsRunReader, pappso::TimsMsRunReaderBase, pappso::TimsMsRunReaderMs2, and pappso::TimsMsRunReaderMs2Selected.
Definition at line 112 of file msrunreader.cpp.
Referenced by readSpectrumCollectionByMsLevel().
|
protectedpure virtual |
bool pappso::MsRunReader::isMonoThread | ( | ) | const |
Definition at line 75 of file msrunreader.cpp.
References m_isMonoThread.
Referenced by acquireDevice(), and pappso::TimsMsRunReaderMs2::readSpectrumCollectionByMsLevel().
|
pure virtual |
|
pure virtual |
get a MassSpectrumSPtr class given its spectrum index
Implemented in pappso::BafAsciiMsRunReader, pappso::PwizMsRunReader, pappso::TimsFramesMsRunReader, pappso::TimsMsRunReader, pappso::TimsMsRunReaderDia, pappso::TimsMsRunReaderMs2, pappso::TimsMsRunReaderMs2Selected, and pappso::XyMsRunReader.
|
pure virtual |
get a xic coordinate object from a given spectrum
Implemented in pappso::BafAsciiMsRunReader, pappso::PwizMsRunReader, pappso::TimsMsRunReaderBase, pappso::TimsMsRunReaderDia, pappso::TimsMsRunReaderMs2, and pappso::XyMsRunReader.
|
pure virtual |
get a xic coordinate object from a given spectrum index
Implemented in pappso::BafAsciiMsRunReader, pappso::PwizMsRunReader, pappso::TimsMsRunReaderBase, pappso::TimsMsRunReaderDia, pappso::TimsMsRunReaderMs2, and pappso::XyMsRunReader.
|
pure virtual |
get a QualifiedMassSpectrum class given its scan number
Implemented in pappso::BafAsciiMsRunReader, pappso::PwizMsRunReader, pappso::TimsFramesMsRunReader, pappso::TimsMsRunReader, pappso::TimsMsRunReaderDia, pappso::TimsMsRunReaderMs2, pappso::TimsMsRunReaderMs2Selected, and pappso::XyMsRunReader.
|
pure virtual |
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
Implemented in pappso::BafAsciiMsRunReader, pappso::PwizMsRunReader, pappso::TimsFramesMsRunReader, pappso::TimsMsRunReader, pappso::TimsMsRunReaderDia, pappso::TimsMsRunReaderMs2, pappso::TimsMsRunReaderMs2Selected, and pappso::XyMsRunReader.
Referenced by getTicChromatogram(), scanNumber2SpectrumIndex(), and pappso::MzxmlOutput::write().
|
pure virtual |
Implemented in pappso::BafAsciiMsRunReader, pappso::PwizMsRunReader, pappso::TimsFramesMsRunReader, pappso::TimsMsRunReader, pappso::TimsMsRunReaderDia, pappso::TimsMsRunReaderMs2, pappso::TimsMsRunReaderMs2Selected, and pappso::XyMsRunReader.
Referenced by getRetentionTimeLine(), and pappso::MzxmlOutput::write().
|
pure virtual |
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler by Ms Levels
Implemented in pappso::BafAsciiMsRunReader, pappso::PwizMsRunReader, pappso::TimsFramesMsRunReader, pappso::TimsMsRunReader, pappso::TimsMsRunReaderDia, pappso::TimsMsRunReaderMs2, and pappso::XyMsRunReader.
References hasScanNumbers(), and scanNumber2SpectrumIndex().
|
pure 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
Implemented in pappso::BafAsciiMsRunReader, pappso::PwizMsRunReader, pappso::TimsMsRunReaderBase, pappso::TimsMsRunReaderMs2, and pappso::XyMsRunReader.
|
virtual |
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.
Definition at line 82 of file msrunreader.cpp.
References mcsp_msRunId, mpa_multiMapScanNumber, pappso::PappsoException::qwhat(), and readSpectrumCollection().
Referenced by readSpectrumCollectionByMsLevel().
void pappso::MsRunReader::setMonoThread | ( | bool | is_mono_thread | ) |
set only one is_mono_thread to true
this avoid to use qtconcurrent
Definition at line 69 of file msrunreader.cpp.
References m_isMonoThread.
Referenced by acquireDevice().
|
pure virtual |
get the totat number of spectrum conained in the MSrun data file
Implemented in pappso::BafAsciiMsRunReader, pappso::PwizMsRunReader, pappso::TimsFramesMsRunReader, pappso::TimsMsRunReader, pappso::TimsMsRunReaderDia, pappso::TimsMsRunReaderMs2, pappso::TimsMsRunReaderMs2Selected, and pappso::XyMsRunReader.
Referenced by pappso::MzxmlOutput::write(), pappso::MzxmlOutput::write(), and pappso::MzxmlOutput::writeHeader().
|
pure virtual |
if possible, get the spectrum index given a string identifier throw a not found exception if spectrum identifier is not found
spectrum_identifier | string identifier of a specific spectrum |
Implemented in pappso::BafAsciiMsRunReader, pappso::PwizMsRunReader, pappso::TimsFramesMsRunReader, pappso::TimsMsRunReader, pappso::TimsMsRunReaderDia, pappso::TimsMsRunReaderMs2, pappso::TimsMsRunReaderMs2Selected, and pappso::XyMsRunReader.
|
friend |
Definition at line 66 of file msrunreader.h.
References MsRunReader(), getMsRunId(), and MsFileAccessor.
Referenced by MsFileAccessor.
|
private |
Definition at line 201 of file msrunreader.h.
Referenced by MsRunReader(), isMonoThread(), and setMonoThread().
|
protected |
Definition at line 189 of file msrunreader.h.
Referenced by MsRunReader(), MsRunReader(), getMsRunId(), getOboPsiModTermInstrumentModelName(), pappso::PwizMsRunReader::getOboPsiModTermInstrumentModelName(), getRetentionTimeLine(), getTicChromatogram(), pappso::BafAsciiMsRunReader::initialize(), pappso::PwizMsRunReader::initialize(), pappso::TimsMsRunReaderBase::initialize(), pappso::TimsMsRunReaderDia::initialize(), pappso::TimsMsRunReaderMs2::initialize(), pappso::TimsMsRunReaderMs2Selected::initialize(), pappso::XyMsRunReader::initialize(), pappso::PwizMsRunReader::processRetentionTime(), pappso::PwizMsRunReader::qualifiedMassSpectrum(), pappso::XyMsRunReader::qualifiedMassSpectrum(), pappso::BafAsciiMsRunReader::qualifiedMassSpectrumFromBafAsciiMSDataFile(), pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizMSData(), pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr(), pappso::XyMsRunReader::qualifiedMassSpectrumFromXyMSDataFile(), pappso::XyMsRunReader::readSpectrumCollection(), pappso::BafAsciiMsRunReader::readSpectrumCollectionByMsLevel(), pappso::PwizMsRunReader::readSpectrumCollectionByMsLevel(), pappso::XyMsRunReader::readSpectrumCollectionByMsLevel(), pappso::PwizMsRunReader::readSpectrumCollectionWithMsrunReadConfig(), and scanNumber2SpectrumIndex().
|
protected |
Definition at line 190 of file msrunreader.h.
Referenced by MsRunReader(), ~MsRunReader(), and scanNumber2SpectrumIndex().