libpappsomspp
Library for mass spectrometry
|
#include <timsframebase.h>
Classes | |
struct | TofIndexIntensityPair |
Public Member Functions | |
TimsFrameBase (std::size_t frameId, quint32 scanCount) | |
constructor for binary independant tims frame | |
TimsFrameBase (const TimsFrameBase &other) | |
virtual | ~TimsFrameBase () |
virtual bool | hasSameCalibrationData (const TimsFrameBase &other) const |
tells if 2 tims frame has the same calibration data Usefull to know if raw data can be handled between frames | |
virtual std::size_t | getScanPeakCount (std::size_t scanIndex) const |
get the number of peaks in this spectrum need the binary file | |
virtual std::size_t | getTotalNumberOfScans () const |
get the number of scans contained in this frame each scan represents an ion mobility slice | |
virtual quint32 | getMaximumRawMassIndex () const |
get the maximum raw mass index contained in this frame | |
virtual MassSpectrumSPtr | getMassSpectrumSPtr (std::size_t scan_index) const |
get Mass spectrum with peaks for this scan index need the binary file | |
virtual pappso::MassSpectrumCstSPtr | getMassSpectrumCstSPtr (std::size_t scan_index) const final |
get the mass spectrum corresponding to a scan index | |
virtual Trace | cumulateScansToTrace (std::size_t scanIndexBegin, std::size_t scanIndexEnd) const |
cumulate spectrum given a scan number range need the binary file The intensities are normalized with respect to the frame accumulation time | |
virtual Trace | combineScansToTraceWithDowngradedMzResolution (std::size_t tof_index_merge_window, std::size_t scanIndexBegin, std::size_t scanIndexEnd, quint32 &minimum_tof_index_out, quint32 &maximum_tof_index_out) const |
cumulate spectrum given a scan index range need the binary file The intensities are normalized with respect to the frame accumulation time to leverage computing performance, this function decreases the mz resolution | |
virtual Trace | combineScansToTraceWithDowngradedMzResolution2 (std::size_t mz_index_merge_window, double mz_range_begin, double mz_range_end, std::size_t mobility_scan_begin, std::size_t mobility_scan_end, quint32 &mz_minimum_index_out, quint32 &mz_maximum_index_out) const |
cumulate spectrum given a scan number range need the binary file The intensities are normalized with respect to the frame accumulation time to leverage computing performance, this function decreases the mz resolution | |
virtual Trace | getMobilityScan (std::size_t scan_index, std::size_t tof_index_merge_window, double mz_range_begin, double mz_range_end, quint32 &mz_minimum_index_out, quint32 &mz_maximum_index_out) const |
get a single mobility scan m/z + intensities | |
virtual void | combineScansInTofIndexIntensityMap (TimsDataFastMap &tof_index_intensity_map, std::size_t scan_index_begin, std::size_t scan_index_end) const |
cumulate scan list into a trace into a raw spectrum map The intensities are NOT normalized with respect to the frame accumulation time | |
virtual void | combineScansInTofIndexIntensityMap (TimsDataFastMap &tof_index_intensity_map, std::size_t scan_index_begin, std::size_t scan_index_end, quint32 tof_index_begin, quint32 tof_index_end) const |
cumulate scan list into a trace into a raw spectrum map The intensities are NOT normalized with respect to the frame accumulation time | |
virtual quint64 | cumulateScanIntensities (std::size_t scan_index) const |
virtual quint64 | cumulateScanRangeIntensities (std::size_t scan_index_begin, std::size_t scan_index_end) const |
bool | checkScanNum (std::size_t scanNum) const |
check that this scan number exists | |
void | setAcqDurationInMilliseconds (double acquisition_duration_ms) |
void | setMzCalibration (double T1_frame, double T2_frame, double digitizerTimebase, double digitizerDelay, double C0, double C1, double C2, double C3, double C4, double T1_ref, double T2_ref, double dC1, double dC2) |
void | setTimsCalibration (int tims_model_type, double C0, double C1, double C2, double C3, double C4, double C5, double C6, double C7, double C8, double C9) |
void | setRtInSeconds (double time) |
void | setMsMsType (quint8 type) |
unsigned int | getMsLevel () const |
double | getRtInSeconds () const |
std::size_t | getId () const |
double | getDriftTimeInMilliseconds (std::size_t scan_index) const |
get drift time of a scan number in milliseconds | |
double | getOneOverK0Transformation (std::size_t scan_index) const |
get 1/K0 value of a given scan (mobility value) | |
std::size_t | getScanIndexFromOneOverK0 (double one_over_k0) const |
get the scan number from a given 1/Ko mobility value | |
double | getVoltageTransformation (std::size_t scanNum) const |
get voltage for a given scan number | |
pappso::Trace | getTraceFromTofIndexIntensityMap (TimsDataFastMap &accumulated_scans) const |
transform accumulation of raw scans into a real mass spectrum | |
virtual const MzCalibrationInterfaceSPtr & | getMzCalibrationInterfaceSPtr () const final |
get the MzCalibration model to compute mz and TOF for this frame | |
void | setMzCalibrationInterfaceSPtr (MzCalibrationInterfaceSPtr mzCalibration) |
virtual std::vector< quint32 > | getScanTofIndexList (std::size_t scan_index) const |
get raw index list for one given scan index are not TOF nor m/z, just index on digitizer | |
virtual std::vector< quint32 > | getScanIntensityList (std::size_t scan_index) const |
get raw intensities without transformation from one scan it needs intensity normalization | |
virtual Trace | getIonMobilityTraceByTofIndexRange (std::size_t tof_index_begin, std::size_t tof_index_end, XicExtractMethod method, std::size_t scan_index_begin, std::size_t scan_index_end) const |
get a mobility trace cumulating intensities inside the given mass index range | |
Protected Member Functions | |
virtual std::vector< TofIndexIntensityPair > & | downgradeResolutionOfTofIndexIntensityPairList (std::size_t tof_index_merge_window, std::vector< TofIndexIntensityPair > &spectrum) const |
Downgrade the TOF index resolution to lower the number of real m/z computations. | |
Protected Attributes | |
quint32 | m_scanCount |
total number of scans contained in this frame | |
std::size_t | m_frameId |
Tims frame database id (the SQL identifier of this frame) | |
double | m_acqDurationInMilliseconds = 0 |
acquisition duration in milliseconds | |
quint8 | m_msMsType = 0 |
double | m_rtInSeconds = 0 |
retention time | |
double | m_timsDvStart = 0 |
double | m_timsSlope |
double | m_timsTtrans = 0 |
double | m_timsNdelay = 0 |
double | m_timsVmin = 0 |
double | m_timsVmax = 0 |
double | m_timsC6 = 0 |
double | m_timsC7 = 0 |
MzCalibrationInterfaceSPtr | msp_mzCalibration = nullptr |
Definition at line 48 of file timsframebase.h.
pappso::TimsFrameBase::TimsFrameBase | ( | std::size_t | frameId, |
quint32 | scanCount | ||
) |
constructor for binary independant tims frame
timsId | tims frame identifier in the database |
scanCount | the number of scans in this frame |
Definition at line 39 of file timsframebase.cpp.
References m_frameId, and m_scanCount.
pappso::TimsFrameBase::TimsFrameBase | ( | const TimsFrameBase & | other | ) |
|
virtual |
bool pappso::TimsFrameBase::checkScanNum | ( | std::size_t | scanNum | ) | const |
check that this scan number exists
scanNum | scan number in the frame in the order it lies in binary file, from 0 to N-1 |
Definition at line 103 of file timsframebase.cpp.
References m_scanCount.
Referenced by pappso::TimsFrame::getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), pappso::TimsFrame::getScanIntensityList(), pappso::TimsFrameType1::getScanIntensityList(), pappso::TimsFrame::getScanPeakCount(), pappso::TimsFrame::getScanTofIndexList(), and pappso::TimsFrameType1::getScanTofIndexList().
|
virtual |
cumulate scan list into a trace into a raw spectrum map The intensities are NOT normalized with respect to the frame accumulation time
tof_index_intensity_map | simple map of integers to cumulate raw counts |
scan_index_begin | scan index in the frame in the order it lies in binary file, from 0 to N-1 |
scan_index_end | scan index in the frame in the order it lies in binary file, from 0 to N-1 |
Reimplemented in pappso::TimsFrame.
Definition at line 206 of file timsframebase.cpp.
|
virtual |
cumulate scan list into a trace into a raw spectrum map The intensities are NOT normalized with respect to the frame accumulation time
tof_index_intensity_map | simple map of integers to cumulate raw counts |
scan_index_begin | scan index in the frame in the order it lies in binary file, from 0 to N-1 |
scan_index_end | scan index in the frame in the order it lies in binary file, from 0 to N-1 |
tof_index_begin | |
tof_index_end |
Reimplemented in pappso::TimsFrame.
Definition at line 221 of file timsframebase.cpp.
|
virtual |
cumulate spectrum given a scan index range need the binary file The intensities are normalized with respect to the frame accumulation time to leverage computing performance, this function decreases the mz resolution
tof_index_merge_window | width of the TOF index window used to merge all intensities into a single point. This results in faster computing. |
scanIndexBegin | scan index in the frame in the order it lies in binary file, from 0 to N-1 |
scanIndexEnd | scan index in the frame in the order it lies in binary file, from 0 to N-1 |
minimum_tof_index_out | report the minimum mz index contained in the resulting trace |
maximum_tof_index_out | report the maximum mz index contained in the resulting trace |
Reimplemented in pappso::TimsFrame.
Definition at line 160 of file timsframebase.cpp.
|
virtual |
cumulate spectrum given a scan number range need the binary file The intensities are normalized with respect to the frame accumulation time to leverage computing performance, this function decreases the mz resolution
mzindex_merge_window | width of the mzindex window used to merge all intensities into a single point. This results in faster computing. |
mz_range_begin | |
mz_range_end | |
scanNumBegin | scan number in the frame in the order it lies in binary file, from 0 to N-1 |
scanNumEnd | scan number in the frame in the order it lies in binary file, from 0 to N-1 |
mz_minimum_index | report the minimum mz index contained in the resulting trace (constrained by the mz_range_begin) |
mz_maximum_index | report the maximum mz index contained in the resulting trace (constrained by the mz_range_end) |
Reimplemented in pappso::TimsFrame.
Definition at line 174 of file timsframebase.cpp.
|
virtual |
Reimplemented in pappso::TimsFrame.
Definition at line 239 of file timsframebase.cpp.
|
virtual |
Reimplemented in pappso::TimsFrame.
Definition at line 252 of file timsframebase.cpp.
|
virtual |
cumulate spectrum given a scan number range need the binary file The intensities are normalized with respect to the frame accumulation time
scanIndexBegin | scan index in the frame in the order it lies in the frame in the binary file, from 0 to N-1 |
scanIndexEnd | scan number in the frame in the order it lies in the frame in the binary file, from 0 to N-1 |
Reimplemented in pappso::TimsFrame.
Definition at line 149 of file timsframebase.cpp.
|
protectedvirtual |
Downgrade the TOF index resolution to lower the number of real m/z computations.
This function merges together into a single TOF index bin all the TOF
indices contained in the tof_index_merge_window. Then the window is shifted and the operation is performed again. When all the list of \l{TofIndexIntensityPair}s has been gone through, the resolution of the data has effectively been downgrade by a factor corresponding to tof_index_merge_window.
@param tof_index_merge_window width of the TOF index window used to merge
all intensities into a single point. This results in faster computing.
rawSpectrum | the spectrum to shrink |
Definition at line 566 of file timsframebase.cpp.
References pappso::TimsFrameBase::TofIndexIntensityPair::intensity_index, and pappso::TimsFrameBase::TofIndexIntensityPair::tof_index.
Referenced by pappso::TimsFrame::getMobilityScan().
double pappso::TimsFrameBase::getDriftTimeInMilliseconds | ( | std::size_t | scan_index | ) | const |
get drift time of a scan number in milliseconds
scanNum | scan number in the frame in the order it lies in binary file, from 0 to N-1 |
Definition at line 356 of file timsframebase.cpp.
References m_acqDurationInMilliseconds, and m_scanCount.
std::size_t pappso::TimsFrameBase::getId | ( | ) | const |
Definition at line 294 of file timsframebase.cpp.
References m_frameId.
Referenced by pappso::TimsFrameType1::getMassSpectrumSPtr(), pappso::TimsFrameType1::getScanIntensityList(), and pappso::TimsFrameType1::getScanTofIndexList().
|
virtual |
get a mobility trace cumulating intensities inside the given mass index range
tof_index_begin | raw mass index lower bound |
tof_index_end | raw mass index upper bound |
method | max or sum intensities |
scan_index_begin | first mobility scan to integrate |
scan_index_end | last mobility scan to integrate |
Definition at line 498 of file timsframebase.cpp.
References getScanIntensityList(), getScanTofIndexList(), m_scanCount, pappso::sum, pappso::DataPoint::x, and pappso::DataPoint::y.
|
finalvirtual |
get the mass spectrum corresponding to a scan index
scan_index | the scan index of the mass spectrum to retrieve |
Definition at line 142 of file timsframebase.cpp.
References getMassSpectrumSPtr().
|
virtual |
get Mass spectrum with peaks for this scan index need the binary file
scan_index | scan index in the frame in the order it lies in binary file, from 0 to N-1 (this is the mobility index) |
Reimplemented in pappso::TimsFrame, and pappso::TimsFrameType1.
Definition at line 132 of file timsframebase.cpp.
Referenced by getMassSpectrumCstSPtr().
|
virtual |
get the maximum raw mass index contained in this frame
Definition at line 462 of file timsframebase.cpp.
References getScanTofIndexList(), and m_scanCount.
|
virtual |
get a single mobility scan m/z + intensities
scanIndex | scan number in the frame in the order it lies in binary file, from 0 to N-1 |
tof_index_merge_window | width of the TOF index window used to merge all intensities into a single point. This results in faster computing. |
mz_range_begin | |
mz_range_end | |
mz_minimum_index | report the minimum mz index contained in the resulting trace (constrained by the mz_range_begin) |
mz_maximum_index | report the maximum mz index contained in the resulting trace (constrained by the mz_range_end) |
Reimplemented in pappso::TimsFrame.
Definition at line 190 of file timsframebase.cpp.
unsigned int pappso::TimsFrameBase::getMsLevel | ( | ) | const |
Definition at line 280 of file timsframebase.cpp.
References m_msMsType.
|
finalvirtual |
get the MzCalibration model to compute mz and TOF for this frame
Definition at line 429 of file timsframebase.cpp.
References msp_mzCalibration.
Referenced by pappso::TimsFrame::XicComputeStructure::XicComputeStructure(), pappso::TimsFrame::combineScansToTraceWithDowngradedMzResolution(), pappso::TimsFrame::combineScansToTraceWithDowngradedMzResolution2(), pappso::TimsFrame::cumulateScansToTrace(), pappso::TimsFrame::getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), and getTraceFromTofIndexIntensityMap().
double pappso::TimsFrameBase::getOneOverK0Transformation | ( | std::size_t | scan_index | ) | const |
get 1/K0 value of a given scan (mobility value)
scanNum | scan number in the frame in the order it lies in binary file, from 0 to N-1 |
Definition at line 363 of file timsframebase.cpp.
References getVoltageTransformation(), m_timsC6, and m_timsC7.
double pappso::TimsFrameBase::getRtInSeconds | ( | ) | const |
Definition at line 288 of file timsframebase.cpp.
References m_rtInSeconds.
std::size_t pappso::TimsFrameBase::getScanIndexFromOneOverK0 | ( | double | one_over_k0 | ) | const |
get the scan number from a given 1/Ko mobility value
one_over_k0 | the mobility value to tranform |
Definition at line 370 of file timsframebase.cpp.
References m_timsC6, m_timsC7, m_timsDvStart, m_timsNdelay, m_timsSlope, and m_timsTtrans.
|
virtual |
get raw intensities without transformation from one scan it needs intensity normalization
Reimplemented in pappso::TimsFrame, and pappso::TimsFrameType1.
Definition at line 489 of file timsframebase.cpp.
Referenced by getIonMobilityTraceByTofIndexRange().
|
virtual |
get the number of peaks in this spectrum need the binary file
scanIndex | scan index in the frame in the order it lies in frame's binary data, from 0 to N-1 |
Reimplemented in pappso::TimsFrame, and pappso::TimsFrameType1.
Definition at line 117 of file timsframebase.cpp.
|
virtual |
get raw index list for one given scan index are not TOF nor m/z, just index on digitizer
Reimplemented in pappso::TimsFrame, and pappso::TimsFrameType1.
Definition at line 479 of file timsframebase.cpp.
Referenced by getIonMobilityTraceByTofIndexRange(), and getMaximumRawMassIndex().
|
virtual |
get the number of scans contained in this frame each scan represents an ion mobility slice
Definition at line 126 of file timsframebase.cpp.
References m_scanCount.
Referenced by pappso::BaseColorMapPlotWidget::addColorMap().
pappso::Trace pappso::TimsFrameBase::getTraceFromTofIndexIntensityMap | ( | TimsDataFastMap & | accumulated_scans | ) | const |
transform accumulation of raw scans into a real mass spectrum
Definition at line 397 of file timsframebase.cpp.
References getMzCalibrationInterfaceSPtr(), pappso::MzCalibrationInterface::getMzFromTofIndex(), pappso::TimsDataFastMap::getTofIndexList(), m_acqDurationInMilliseconds, pappso::TimsDataFastMap::readIntensity(), pappso::Trace::sortX(), pappso::DataPoint::x, and pappso::DataPoint::y.
double pappso::TimsFrameBase::getVoltageTransformation | ( | std::size_t | scanNum | ) | const |
get voltage for a given scan number
scanNum | scan number in the frame in the order it lies in binary file, from 0 to N-1 |
Definition at line 330 of file timsframebase.cpp.
References m_timsDvStart, m_timsNdelay, m_timsSlope, m_timsTtrans, m_timsVmax, and m_timsVmin.
Referenced by getOneOverK0Transformation().
|
virtual |
tells if 2 tims frame has the same calibration data Usefull to know if raw data can be handled between frames
Definition at line 382 of file timsframebase.cpp.
References m_timsC6, m_timsC7, m_timsDvStart, m_timsNdelay, m_timsSlope, m_timsTtrans, m_timsVmax, and m_timsVmin.
void pappso::TimsFrameBase::setAcqDurationInMilliseconds | ( | double | acquisition_duration_ms | ) |
Definition at line 56 of file timsframebase.cpp.
References m_acqDurationInMilliseconds.
void pappso::TimsFrameBase::setMsMsType | ( | quint8 | type | ) |
Definition at line 272 of file timsframebase.cpp.
References m_msMsType.
void pappso::TimsFrameBase::setMzCalibration | ( | double | T1_frame, |
double | T2_frame, | ||
double | digitizerTimebase, | ||
double | digitizerDelay, | ||
double | C0, | ||
double | C1, | ||
double | C2, | ||
double | C3, | ||
double | C4, | ||
double | T1_ref, | ||
double | T2_ref, | ||
double | dC1, | ||
double | dC2 | ||
) |
Definition at line 63 of file timsframebase.cpp.
References msp_mzCalibration.
void pappso::TimsFrameBase::setMzCalibrationInterfaceSPtr | ( | MzCalibrationInterfaceSPtr | mzCalibration | ) |
Definition at line 444 of file timsframebase.cpp.
References msp_mzCalibration.
void pappso::TimsFrameBase::setRtInSeconds | ( | double | time | ) |
Definition at line 266 of file timsframebase.cpp.
References m_rtInSeconds.
void pappso::TimsFrameBase::setTimsCalibration | ( | int | tims_model_type, |
double | C0, | ||
double | C1, | ||
double | C2, | ||
double | C3, | ||
double | C4, | ||
double | C5, | ||
double | C6, | ||
double | C7, | ||
double | C8, | ||
double | C9 | ||
) |
Definition at line 299 of file timsframebase.cpp.
References m_timsC6, m_timsC7, m_timsDvStart, m_timsNdelay, m_timsSlope, m_timsTtrans, m_timsVmax, and m_timsVmin.
|
protected |
acquisition duration in milliseconds
Definition at line 393 of file timsframebase.h.
Referenced by pappso::TimsFrame::combineScansToTraceWithDowngradedMzResolution(), pappso::TimsFrame::combineScansToTraceWithDowngradedMzResolution2(), pappso::TimsFrame::cumulateScanIntensities(), pappso::TimsFrame::cumulateScansToTrace(), getDriftTimeInMilliseconds(), pappso::TimsFrame::getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), pappso::TimsFrame::getMobilityScan(), pappso::TimsFrame::getRawTraceSPtr(), pappso::TimsFrameType1::getRawTraceSPtr(), pappso::TimsFrameType1::getRawValuePairList(), getTraceFromTofIndexIntensityMap(), and setAcqDurationInMilliseconds().
|
protected |
Tims frame database id (the SQL identifier of this frame)
Definition at line 389 of file timsframebase.h.
Referenced by pappso::TimsFrame::TimsFrame(), TimsFrameBase(), pappso::TimsFrameType1::TimsFrameType1(), getId(), and pappso::TimsFrameType1::lzfDecompressScan().
|
protected |
Definition at line 395 of file timsframebase.h.
Referenced by getMsLevel(), and setMsMsType().
|
protected |
retention time
Definition at line 399 of file timsframebase.h.
Referenced by pappso::TimsFrame::extractTimsXicListInRtRange(), getRtInSeconds(), and setRtInSeconds().
|
protected |
total number of scans contained in this frame
Definition at line 383 of file timsframebase.h.
Referenced by pappso::TimsFrame::TimsFrame(), TimsFrameBase(), pappso::TimsFrameType1::TimsFrameType1(), checkScanNum(), pappso::TimsFrameType1::copyAndLzfDecompress(), pappso::TimsFrame::extractTimsXicListInRtRange(), getDriftTimeInMilliseconds(), getIonMobilityTraceByTofIndexRange(), getMaximumRawMassIndex(), pappso::TimsFrame::getScanPeakCount(), and getTotalNumberOfScans().
|
protected |
Definition at line 409 of file timsframebase.h.
Referenced by getOneOverK0Transformation(), getScanIndexFromOneOverK0(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 410 of file timsframebase.h.
Referenced by getOneOverK0Transformation(), getScanIndexFromOneOverK0(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 401 of file timsframebase.h.
Referenced by getScanIndexFromOneOverK0(), getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 406 of file timsframebase.h.
Referenced by getScanIndexFromOneOverK0(), getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 402 of file timsframebase.h.
Referenced by getScanIndexFromOneOverK0(), getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 405 of file timsframebase.h.
Referenced by getScanIndexFromOneOverK0(), getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 408 of file timsframebase.h.
Referenced by getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 407 of file timsframebase.h.
Referenced by getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 412 of file timsframebase.h.
Referenced by pappso::TimsFrame::getMobilityScan(), getMzCalibrationInterfaceSPtr(), setMzCalibration(), and setMzCalibrationInterfaceSPtr().