libpappsomspp
Library for mass spectrometry
|
#include <timsdata.h>
Public Member Functions | |
TimsData (QDir timsDataDirectory) | |
build using the tims data directory | |
TimsData (const TimsData &other) | |
virtual | ~TimsData () |
bool | isDdaRun () const |
tells if this MS run is a DDA run | |
bool | isDiaRun () const |
tells if this MS run is a DIA run | |
pappso::MassSpectrumCstSPtr | getMassSpectrumCstSPtrByRawIndex (std::size_t raw_index) |
get a mass spectrum given its spectrum index | |
pappso::MassSpectrumCstSPtr | getMassSpectrumCstSPtrByGlobalScanIndex (std::size_t index) |
pappso::MassSpectrumCstSPtr | getMassSpectrumCstSPtr (std::size_t timsId, std::size_t scanNum) |
get a mass spectrum given the tims frame database id and scan number within tims frame | |
std::size_t | getTotalNumberOfFrames () const |
Get total number of frames. | |
std::size_t | getFrameCount () const |
std::size_t | getTotalNumberOfScans () const |
get the total number of scans | |
std::size_t | getTotalScanCount () const |
unsigned int | getMsLevelBySpectrumIndex (std::size_t index) |
unsigned int | getMsLevelByGlobalScanIndex (std::size_t index) |
void | getQualifiedMassSpectrumByRawIndex (const MsRunIdCstSPtr &msrun_id, QualifiedMassSpectrum &mass_spectrum, std::size_t global_scan_index, bool want_binary_data) |
void | getQualifiedMassSpectrumByGlobalScanIndex (const MsRunIdCstSPtr &msrun_id, QualifiedMassSpectrum &mass_spectrum, std::size_t global_scan_index, bool want_binary_data) |
Trace | getTicChromatogram () const |
std::vector< std::size_t > | getTimsMS1FrameIdsInRtRange (double rt_begin, double rt_end) const |
std::vector< std::size_t > | getTimsMS2FrameIdsInRtRange (double rt_begin, double rt_end) const |
TimsFrameCstSPtr | getTimsFrameCstSPtrCached (std::size_t timsId) |
get a Tims frame with his database ID but look in the cache first | |
TimsFrameCstSPtr | getTimsFrameCstSPtr (std::size_t timsId) |
get a Tims frame with his database ID | |
TimsDataFastMap & | getRawMsBySpectrumIndex (std::size_t index) |
get raw signal for a spectrum index only to use to see the raw signal | |
TimsDataFastMap & | getScanByGlobalScanIndex (std::size_t index) |
virtual std::vector< double > | getRetentionTimeLine () const |
retention timeline get retention times along the MSrun in seconds | |
virtual std::vector< double > | getRetentionTimeLineInSeconds () const |
const std::vector< FrameIdDescr > & | getFrameIdDescrList () const |
const std::vector< TimsFrameRecord > & | getTimsFrameRecordList () const |
const QDir & | getTimsDataDirectory () const |
TimsDdaPrecursors * | getTimsDdaPrecursorsPtr () const |
TimsDiaSlices * | getTimsDiaSlicesPtr () const |
const QVariant & | getGlobalMetadataValue (const QString &key) const |
Protected Member Functions | |
QSqlDatabase | openDatabaseConnection () const |
TimsBinDec * | getTimsBinDecPtr () const |
Private Member Functions | |
std::pair< std::size_t, std::size_t > | getScanCoordinateFromRawIndex (std::size_t spectrum_index) const |
std::pair< std::size_t, std::size_t > | getScanCoordinatesByGlobalScanIndex (std::size_t index) const |
std::size_t | getRawIndexFromCoordinate (std::size_t frame_id, std::size_t scan_num) const |
std::size_t | getGlobalScanIndexByScanCoordinates (std::size_t frame_id, std::size_t index) const |
TimsFrameBaseCstSPtr | getTimsFrameBaseCstSPtr (std::size_t timsId) |
get a Tims frame base (no binary data file access) with his database ID | |
TimsFrameBaseCstSPtr | getTimsFrameBaseCstSPtrCached (std::size_t timsId) |
void | fillFrameIdDescrList () |
private function to fill m_frameIdDescrList | |
Private Attributes | |
friend | TimsDdaPrecursors |
friend | TimsDiaSlices |
QDir | m_timsDataDirectory |
TimsBinDec * | mpa_timsBinDec = nullptr |
TimsDdaPrecursors * | mpa_timsDdaPrecursors = nullptr |
TimsDiaSlices * | mpa_timsDiaSlices = nullptr |
std::size_t | m_totalScanCount |
std::size_t | m_frameCount |
std::size_t | m_cacheSize = 60 |
std::deque< TimsFrameCstSPtr > | m_timsFrameCache |
std::deque< TimsFrameBaseCstSPtr > | m_timsFrameBaseCache |
std::map< int, QSqlRecord > | m_mapMzCalibrationRecord |
std::map< int, QSqlRecord > | m_mapTimsCalibrationRecord |
std::vector< TimsFrameRecord > | m_mapFramesRecord |
MzCalibrationStore * | mpa_mzCalibrationStore |
std::vector< FrameIdDescr > | m_frameIdDescrList |
store every frame id and corresponding sizes | |
std::map< std::size_t, std::size_t > | m_thousandIndexToFrameIdDescrListIndex |
index to find quickly a frameId in the description list with the raw index of spectrum modulo 1000 @key thousands of TOF scans @value corresponding m_frameIdDescrList index | |
std::vector< std::size_t > | m_someoneIsLoadingFrameId |
tells if someone is loading a frame id | |
std::map< QString, QVariant > | m_mapGlobalMetadaTable |
QMutex | m_mutex |
Definition at line 67 of file timsdata.h.
pappso::TimsData::TimsData | ( | QDir | timsDataDirectory | ) |
build using the tims data directory
Definition at line 46 of file timsdata.cpp.
References pappso::TimsFrameRecord::accumulation_time, fillFrameIdDescrList(), pappso::TimsFrameRecord::frame_id, pappso::TimsFrameRecord::frame_t1, pappso::TimsFrameRecord::frame_t2, pappso::TimsFrameRecord::frame_time, getGlobalMetadataValue(), m_frameCount, m_mapFramesRecord, m_mapGlobalMetadaTable, m_mapMzCalibrationRecord, m_mapTimsCalibrationRecord, m_timsDataDirectory, m_totalScanCount, mpa_mzCalibrationStore, mpa_timsBinDec, mpa_timsDdaPrecursors, mpa_timsDiaSlices, pappso::TimsFrameRecord::msms_type, pappso::TimsFrameRecord::mz_calibration_id, openDatabaseConnection(), pappso::TimsFrameRecord::tims_calibration_id, pappso::TimsFrameRecord::tims_offset, TimsDdaPrecursors, and TimsDiaSlices.
Referenced by TimsData().
pappso::TimsData::TimsData | ( | const TimsData & | other | ) |
Copy constructor
other | TODO |
Definition at line 250 of file timsdata.cpp.
References TimsData().
|
virtual |
Destructor
Definition at line 255 of file timsdata.cpp.
References mpa_mzCalibrationStore, mpa_timsBinDec, mpa_timsDdaPrecursors, and mpa_timsDiaSlices.
|
private |
private function to fill m_frameIdDescrList
number of scans in mobility dimension (number of TOF scans)
Definition at line 277 of file timsdata.cpp.
References m_frameIdDescrList, m_thousandIndexToFrameIdDescrListIndex, m_timsDataDirectory, and openDatabaseConnection().
Referenced by TimsData().
std::size_t pappso::TimsData::getFrameCount | ( | ) | const |
Definition at line 649 of file timsdata.cpp.
References m_frameCount.
const std::vector< FrameIdDescr > & pappso::TimsData::getFrameIdDescrList | ( | ) | const |
Definition at line 1025 of file timsdata.cpp.
References m_frameIdDescrList.
const QVariant & pappso::TimsData::getGlobalMetadataValue | ( | const QString & | key | ) | const |
Definition at line 1088 of file timsdata.cpp.
References m_mapGlobalMetadaTable.
Referenced by TimsData().
|
private |
Definition at line 363 of file timsdata.cpp.
References m_frameIdDescrList.
Referenced by getQualifiedMassSpectrumByGlobalScanIndex(), and getRawIndexFromCoordinate().
MassSpectrumCstSPtr pappso::TimsData::getMassSpectrumCstSPtr | ( | std::size_t | timsId, |
std::size_t | scanNum ) |
get a mass spectrum given the tims frame database id and scan number within tims frame
Definition at line 632 of file timsdata.cpp.
References getTimsFrameCstSPtrCached().
Referenced by getMassSpectrumCstSPtrByGlobalScanIndex().
pappso::MassSpectrumCstSPtr pappso::TimsData::getMassSpectrumCstSPtrByGlobalScanIndex | ( | std::size_t | index | ) |
Definition at line 390 of file timsdata.cpp.
References getMassSpectrumCstSPtr(), getScanCoordinatesByGlobalScanIndex(), and pappso::PappsoException::qwhat().
Referenced by getMassSpectrumCstSPtrByRawIndex().
MassSpectrumCstSPtr pappso::TimsData::getMassSpectrumCstSPtrByRawIndex | ( | std::size_t | raw_index | ) |
get a mass spectrum given its spectrum index
raw_index | a number begining at 0, corresponding to a Tims Scan in the order they lies in the binary data file |
Definition at line 384 of file timsdata.cpp.
References getMassSpectrumCstSPtrByGlobalScanIndex().
unsigned int pappso::TimsData::getMsLevelByGlobalScanIndex | ( | std::size_t | index | ) |
Definition at line 676 of file timsdata.cpp.
References getScanCoordinatesByGlobalScanIndex(), and getTimsFrameCstSPtrCached().
Referenced by getMsLevelBySpectrumIndex().
unsigned int pappso::TimsData::getMsLevelBySpectrumIndex | ( | std::size_t | index | ) |
Definition at line 669 of file timsdata.cpp.
References getMsLevelByGlobalScanIndex().
void pappso::TimsData::getQualifiedMassSpectrumByGlobalScanIndex | ( | const MsRunIdCstSPtr & | msrun_id, |
QualifiedMassSpectrum & | mass_spectrum, | ||
std::size_t | global_scan_index, | ||
bool | want_binary_data ) |
Definition at line 696 of file timsdata.cpp.
References pappso::QualifiedMassSpectrum::appendPrecursorIonData(), pappso::BrukerPrecursorIndex, pappso::CollisionEnergy, getGlobalScanIndexByScanCoordinates(), getScanCoordinatesByGlobalScanIndex(), getTimsFrameBaseCstSPtrCached(), getTimsFrameCstSPtrCached(), pappso::IonMobOneOverK0, pappso::IsolationMz, pappso::IsolationMzWidth, mpa_timsDdaPrecursors, pappso::PappsoException::qwhat(), pappso::QualifiedMassSpectrum::setDtInMilliSeconds(), pappso::QualifiedMassSpectrum::setEmptyMassSpectrum(), pappso::QualifiedMassSpectrum::setMassSpectrumId(), pappso::QualifiedMassSpectrum::setMassSpectrumSPtr(), pappso::QualifiedMassSpectrum::setMsLevel(), pappso::MassSpectrumId::setMsRunId(), pappso::MassSpectrumId::setNativeId(), pappso::QualifiedMassSpectrum::setParameterValue(), pappso::QualifiedMassSpectrum::setPrecursorNativeId(), pappso::QualifiedMassSpectrum::setPrecursorSpectrumIndex(), pappso::QualifiedMassSpectrum::setRtInSeconds(), pappso::MassSpectrumId::setSpectrumIndex(), and pappso::QualifiedMassSpectrum::size().
Referenced by getQualifiedMassSpectrumByRawIndex().
void pappso::TimsData::getQualifiedMassSpectrumByRawIndex | ( | const MsRunIdCstSPtr & | msrun_id, |
QualifiedMassSpectrum & | mass_spectrum, | ||
std::size_t | global_scan_index, | ||
bool | want_binary_data ) |
Definition at line 685 of file timsdata.cpp.
References getQualifiedMassSpectrumByGlobalScanIndex().
|
private |
Definition at line 356 of file timsdata.cpp.
References getGlobalScanIndexByScanCoordinates().
TimsDataFastMap & pappso::TimsData::getRawMsBySpectrumIndex | ( | std::size_t | index | ) |
get raw signal for a spectrum index only to use to see the raw signal
spectrum_index | spcetrum index |
Definition at line 1004 of file timsdata.cpp.
References getScanByGlobalScanIndex().
|
virtual |
retention timeline get retention times along the MSrun in seconds
Definition at line 982 of file timsdata.cpp.
References getRetentionTimeLineInSeconds().
|
virtual |
Definition at line 988 of file timsdata.cpp.
References m_mapFramesRecord.
Referenced by getRetentionTimeLine().
TimsDataFastMap & pappso::TimsData::getScanByGlobalScanIndex | ( | std::size_t | index | ) |
Definition at line 1010 of file timsdata.cpp.
References pappso::TimsDataFastMap::clear(), getScanCoordinatesByGlobalScanIndex(), pappso::TimsDataFastMap::getTimsDataFastMapInstance(), and getTimsFrameCstSPtrCached().
Referenced by getRawMsBySpectrumIndex().
|
private |
Definition at line 320 of file timsdata.cpp.
References getScanCoordinatesByGlobalScanIndex().
|
private |
Definition at line 326 of file timsdata.cpp.
References m_frameIdDescrList, and m_thousandIndexToFrameIdDescrListIndex.
Referenced by getMassSpectrumCstSPtrByGlobalScanIndex(), getMsLevelByGlobalScanIndex(), getQualifiedMassSpectrumByGlobalScanIndex(), getScanByGlobalScanIndex(), and getScanCoordinateFromRawIndex().
Trace pappso::TimsData::getTicChromatogram | ( | ) | const |
Definition at line 801 of file timsdata.cpp.
References m_timsDataDirectory, openDatabaseConnection(), and pappso::MapTrace::toTrace().
|
protected |
Definition at line 1053 of file timsdata.cpp.
References mpa_timsBinDec.
const QDir & pappso::TimsData::getTimsDataDirectory | ( | ) | const |
Definition at line 1037 of file timsdata.cpp.
References m_timsDataDirectory.
TimsDdaPrecursors * pappso::TimsData::getTimsDdaPrecursorsPtr | ( | ) | const |
Definition at line 1043 of file timsdata.cpp.
References mpa_timsDdaPrecursors.
TimsDiaSlices * pappso::TimsData::getTimsDiaSlicesPtr | ( | ) | const |
Definition at line 1075 of file timsdata.cpp.
References mpa_timsDiaSlices.
|
private |
get a Tims frame base (no binary data file access) with his database ID
Definition at line 409 of file timsdata.cpp.
References pappso::TimsFrameRecord::accumulation_time, pappso::TimsFrameRecord::frame_t1, pappso::TimsFrameRecord::frame_t2, pappso::TimsFrameRecord::frame_time, m_mapFramesRecord, m_mapMzCalibrationRecord, m_mapTimsCalibrationRecord, m_totalScanCount, mpa_mzCalibrationStore, pappso::TimsFrameRecord::msms_type, pappso::TimsFrameRecord::mz_calibration_id, pappso::TimsFrameRecord::tims_calibration_id, and pappso::TimsFrameRecord::tims_offset.
Referenced by getTimsFrameBaseCstSPtrCached().
|
private |
Definition at line 883 of file timsdata.cpp.
References getTimsFrameBaseCstSPtr(), m_cacheSize, m_mutex, and m_timsFrameBaseCache.
Referenced by getQualifiedMassSpectrumByGlobalScanIndex().
TimsFrameCstSPtr pappso::TimsData::getTimsFrameCstSPtr | ( | std::size_t | timsId | ) |
get a Tims frame with his database ID
this function is not thread safe
Definition at line 550 of file timsdata.cpp.
References pappso::TimsFrameRecord::accumulation_time, pappso::TimsFrameRecord::frame_t1, pappso::TimsFrameRecord::frame_t2, pappso::TimsFrameRecord::frame_time, m_mapFramesRecord, m_mapMzCalibrationRecord, m_mapTimsCalibrationRecord, m_totalScanCount, mpa_mzCalibrationStore, mpa_timsBinDec, pappso::TimsFrameRecord::msms_type, pappso::TimsFrameRecord::mz_calibration_id, and pappso::TimsFrameRecord::tims_calibration_id.
Referenced by getTimsFrameCstSPtrCached().
TimsFrameCstSPtr pappso::TimsData::getTimsFrameCstSPtrCached | ( | std::size_t | timsId | ) |
get a Tims frame with his database ID but look in the cache first
thread safe
Definition at line 904 of file timsdata.cpp.
References getTimsFrameCstSPtr(), m_cacheSize, m_mutex, and m_timsFrameCache.
Referenced by getMassSpectrumCstSPtr(), getMsLevelByGlobalScanIndex(), getQualifiedMassSpectrumByGlobalScanIndex(), and getScanByGlobalScanIndex().
const std::vector< TimsFrameRecord > & pappso::TimsData::getTimsFrameRecordList | ( | ) | const |
Definition at line 1031 of file timsdata.cpp.
References m_mapFramesRecord.
std::vector< std::size_t > pappso::TimsData::getTimsMS1FrameIdsInRtRange | ( | double | rt_begin, |
double | rt_end ) const |
Definition at line 476 of file timsdata.cpp.
References m_timsDataDirectory, and openDatabaseConnection().
std::vector< std::size_t > pappso::TimsData::getTimsMS2FrameIdsInRtRange | ( | double | rt_begin, |
double | rt_end ) const |
Definition at line 514 of file timsdata.cpp.
References m_timsDataDirectory, and openDatabaseConnection().
std::size_t pappso::TimsData::getTotalNumberOfFrames | ( | ) | const |
std::size_t pappso::TimsData::getTotalNumberOfScans | ( | ) | const |
get the total number of scans
Definition at line 656 of file timsdata.cpp.
References m_totalScanCount.
std::size_t pappso::TimsData::getTotalScanCount | ( | ) | const |
Definition at line 663 of file timsdata.cpp.
References m_totalScanCount.
bool pappso::TimsData::isDdaRun | ( | ) | const |
tells if this MS run is a DDA run
Definition at line 1059 of file timsdata.cpp.
References mpa_timsDdaPrecursors.
bool pappso::TimsData::isDiaRun | ( | ) | const |
tells if this MS run is a DIA run
Definition at line 1067 of file timsdata.cpp.
References mpa_timsDiaSlices.
|
protected |
Definition at line 221 of file timsdata.cpp.
References m_timsDataDirectory.
Referenced by TimsData(), fillFrameIdDescrList(), getTicChromatogram(), getTimsMS1FrameIdsInRtRange(), and getTimsMS2FrameIdsInRtRange().
|
private |
Definition at line 247 of file timsdata.h.
Referenced by getTimsFrameBaseCstSPtrCached(), and getTimsFrameCstSPtrCached().
|
private |
Definition at line 246 of file timsdata.h.
Referenced by TimsData(), getFrameCount(), and getTotalNumberOfFrames().
|
private |
store every frame id and corresponding sizes
Definition at line 261 of file timsdata.h.
Referenced by fillFrameIdDescrList(), getFrameIdDescrList(), getGlobalScanIndexByScanCoordinates(), and getScanCoordinatesByGlobalScanIndex().
|
private |
Definition at line 254 of file timsdata.h.
Referenced by TimsData(), getRetentionTimeLineInSeconds(), getTimsFrameBaseCstSPtr(), getTimsFrameCstSPtr(), and getTimsFrameRecordList().
|
private |
Definition at line 275 of file timsdata.h.
Referenced by TimsData(), and getGlobalMetadataValue().
|
private |
Definition at line 252 of file timsdata.h.
Referenced by TimsData(), getTimsFrameBaseCstSPtr(), and getTimsFrameCstSPtr().
|
private |
Definition at line 253 of file timsdata.h.
Referenced by TimsData(), getTimsFrameBaseCstSPtr(), and getTimsFrameCstSPtr().
|
private |
Definition at line 277 of file timsdata.h.
Referenced by getTimsFrameBaseCstSPtrCached(), and getTimsFrameCstSPtrCached().
|
private |
tells if someone is loading a frame id
Definition at line 273 of file timsdata.h.
|
private |
index to find quickly a frameId in the description list with the raw index of spectrum modulo 1000 @key thousands of TOF scans @value corresponding m_frameIdDescrList index
Definition at line 268 of file timsdata.h.
Referenced by fillFrameIdDescrList(), and getScanCoordinatesByGlobalScanIndex().
|
private |
Definition at line 239 of file timsdata.h.
Referenced by TimsData(), fillFrameIdDescrList(), getTicChromatogram(), getTimsDataDirectory(), getTimsMS1FrameIdsInRtRange(), getTimsMS2FrameIdsInRtRange(), and openDatabaseConnection().
|
private |
Definition at line 249 of file timsdata.h.
Referenced by getTimsFrameBaseCstSPtrCached().
|
private |
Definition at line 248 of file timsdata.h.
Referenced by getTimsFrameCstSPtrCached().
|
private |
Definition at line 245 of file timsdata.h.
Referenced by TimsData(), getTimsFrameBaseCstSPtr(), getTimsFrameCstSPtr(), getTotalNumberOfScans(), and getTotalScanCount().
|
private |
Definition at line 256 of file timsdata.h.
Referenced by TimsData(), ~TimsData(), getTimsFrameBaseCstSPtr(), and getTimsFrameCstSPtr().
|
private |
Definition at line 240 of file timsdata.h.
Referenced by TimsData(), ~TimsData(), getTimsBinDecPtr(), and getTimsFrameCstSPtr().
|
private |
Definition at line 242 of file timsdata.h.
Referenced by TimsData(), ~TimsData(), getQualifiedMassSpectrumByGlobalScanIndex(), getTimsDdaPrecursorsPtr(), and isDdaRun().
|
private |
Definition at line 243 of file timsdata.h.
Referenced by TimsData(), ~TimsData(), getTimsDiaSlicesPtr(), and isDiaRun().
|
private |
Definition at line 69 of file timsdata.h.
Referenced by TimsData().
|
private |
Definition at line 70 of file timsdata.h.
Referenced by TimsData().