libpappsomspp
Library for mass spectrometry
|
#include <timsframebase.h>
Classes | |
struct | RawValuePair |
Public Member Functions | |
TimsFrameBase (std::size_t timsId, quint32 scanNum) | |
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 | getNbrPeaks (std::size_t scanNum) 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 scanNum) const |
get Mass spectrum with peaks for this scan number need the binary file | |
virtual pappso::MassSpectrumCstSPtr | getMassSpectrumCstSPtr (std::size_t scanNum) const final |
get the mass spectrum corresponding to a scan number | |
virtual Trace | cumulateScansToTrace (std::size_t scanNumBegin, std::size_t scanNumEnd) 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 | cumulateScansToTraceMzDownResolution (std::size_t mzindex_merge_window, std::size_t scanNumBegin, std::size_t scanNumEnd, quint32 &minimum_index, quint32 &maximum_index) 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 | cumulateScansToTraceMzDownResolution2 (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 scanNum, std::size_t mz_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 | cumulateScansInRawMap (TimsDataFastMap &rawSpectrum, std::size_t scanNumBegin, std::size_t scanNumEnd) 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 | cumulateSingleScanIntensities (std::size_t scanNum) const |
virtual quint64 | cumulateScansIntensities (std::size_t scanNumBegin, std::size_t scanNumEnd) const |
bool | checkScanNum (std::size_t scanNum) const |
check that this scan number exists | |
void | setAccumulationTime (double accumulation_time_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 | setTime (double time) |
void | setMsMsType (quint8 type) |
unsigned int | getMsLevel () const |
double | getTime () const |
std::size_t | getId () const |
double | getDriftTime (std::size_t scanNum) const |
get drift time of a scan number in milliseconds | |
double | getOneOverK0Transformation (std::size_t scanNum) const |
get 1/K0 value of a given scan (mobility value) | |
std::size_t | getScanNumFromOneOverK0 (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 | getTraceFromCumulatedScans (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 > | getScanIndexList (std::size_t scanNum) const |
get raw index list for one given scan index are not TOF nor m/z, just index on digitizer | |
virtual std::vector< quint32 > | getScanIntensities (std::size_t scanNum) const |
get raw intensities without transformation from one scan it needs intensity normalization | |
virtual Trace | getIonMobilityTraceByMzIndexRange (std::size_t mz_index_lower_bound, std::size_t mz_index_upper_bound, XicExtractMethod method) const |
get a mobility trace cumulating intensities inside the given mass index range | |
Protected Member Functions | |
virtual std::vector< RawValuePair > & | downsizeMzRawValuePairList (std::size_t mzindex_merge_window, std::vector< RawValuePair > &spectrum) const |
downsize mz resolution to lower the number of real mz computations | |
Protected Attributes | |
quint32 | m_scanNumber |
total number of scans contained in this frame | |
std::size_t | m_timsId |
Tims frame database id (the SQL identifier of this frame) | |
double | m_accumulationTime = 0 |
accumulation time in milliseconds | |
quint8 | m_msMsType = 0 |
double | m_time = 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 | timsId, |
quint32 | scanNum | ||
) |
constructor for binary independant tims frame
timsId | tims frame identifier in the database |
scanNum | the total number of scans contained in this frame |
Definition at line 39 of file timsframebase.cpp.
References m_scanNumber, and m_timsId.
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_scanNumber.
Referenced by pappso::TimsFrame::getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), pappso::TimsFrame::getNbrPeaks(), pappso::TimsFrame::getScanIndexList(), pappso::TimsFrameType1::getScanIndexList(), pappso::TimsFrame::getScanIntensities(), and pappso::TimsFrameType1::getScanIntensities().
|
virtual |
cumulate scan list into a trace into a raw spectrum map The intensities are NOT normalized with respect to the frame accumulation time
rawSpectrum | simple map of integers to cumulate raw counts |
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 |
Reimplemented in pappso::TimsFrame.
Definition at line 206 of file timsframebase.cpp.
|
virtual |
Reimplemented in pappso::TimsFrame.
Definition at line 234 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
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 |
Reimplemented in pappso::TimsFrame.
Definition at line 149 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. |
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 |
mz_maximum_index | 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 221 of file timsframebase.cpp.
|
protectedvirtual |
downsize mz resolution to lower the number of real mz computations
mzindex_merge_window | width of the mzindex window used to merge all intensities into a single point. This results in faster computing. |
rawSpectrum | the spectrum to shrink |
Definition at line 540 of file timsframebase.cpp.
References pappso::TimsFrameBase::RawValuePair::intensity_index, and pappso::TimsFrameBase::RawValuePair::mz_tof_index.
Referenced by pappso::TimsFrame::getMobilityScan().
double pappso::TimsFrameBase::getDriftTime | ( | std::size_t | scanNum | ) | 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 334 of file timsframebase.cpp.
References m_accumulationTime, and m_scanNumber.
std::size_t pappso::TimsFrameBase::getId | ( | ) | const |
Definition at line 276 of file timsframebase.cpp.
References m_timsId.
Referenced by pappso::TimsFrameType1::getMassSpectrumSPtr(), pappso::TimsFrameType1::getScanIndexList(), and pappso::TimsFrameType1::getScanIntensities().
|
virtual |
get a mobility trace cumulating intensities inside the given mass index range
mz_index_lower_bound | raw mass index lower bound |
mz_index_upper_bound | raw mass index upper bound |
method | max or sum intensities |
Definition at line 475 of file timsframebase.cpp.
References getScanIndexList(), getScanIntensities(), m_scanNumber, pappso::sum, pappso::DataPoint::x, and pappso::DataPoint::y.
|
finalvirtual |
get the mass spectrum corresponding to a scan number
scanNum | the scan number to retrieve |
Definition at line 142 of file timsframebase.cpp.
References getMassSpectrumSPtr().
|
virtual |
get Mass spectrum with peaks for this scan number need the binary file
scanNum | scan number 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 439 of file timsframebase.cpp.
References getScanIndexList(), and m_scanNumber.
|
virtual |
get a single mobility scan m/z + intensities
scanNum | scan number in the frame in the order it lies in binary file, from 0 to N-1 |
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 | |
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 262 of file timsframebase.cpp.
References m_msMsType.
|
finalvirtual |
get the MzCalibration model to compute mz and TOF for this frame
Definition at line 406 of file timsframebase.cpp.
References msp_mzCalibration.
Referenced by pappso::TimsFrame::XicComputeStructure::XicComputeStructure(), pappso::TimsFrame::cumulateScansToTrace(), pappso::TimsFrame::cumulateScansToTraceMzDownResolution(), pappso::TimsFrame::cumulateScansToTraceMzDownResolution2(), pappso::TimsFrame::getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), and getTraceFromCumulatedScans().
|
virtual |
get the number of peaks in this spectrum need the binary file
scanNum | scan number in the frame in the order it lies in binary file, from 0 to N-1 |
Reimplemented in pappso::TimsFrame, and pappso::TimsFrameType1.
Definition at line 117 of file timsframebase.cpp.
double pappso::TimsFrameBase::getOneOverK0Transformation | ( | std::size_t | scanNum | ) | 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 340 of file timsframebase.cpp.
References getVoltageTransformation(), m_timsC6, and m_timsC7.
|
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 456 of file timsframebase.cpp.
Referenced by getIonMobilityTraceByMzIndexRange(), and getMaximumRawMassIndex().
|
virtual |
get raw intensities without transformation from one scan it needs intensity normalization
Reimplemented in pappso::TimsFrame, and pappso::TimsFrameType1.
Definition at line 466 of file timsframebase.cpp.
Referenced by getIonMobilityTraceByMzIndexRange().
std::size_t pappso::TimsFrameBase::getScanNumFromOneOverK0 | ( | 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 347 of file timsframebase.cpp.
References m_timsC6, m_timsC7, m_timsDvStart, m_timsNdelay, m_timsSlope, and m_timsTtrans.
double pappso::TimsFrameBase::getTime | ( | ) | const |
|
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_scanNumber.
Referenced by pappso::BaseColorMapPlotWidget::addColorMap().
pappso::Trace pappso::TimsFrameBase::getTraceFromCumulatedScans | ( | TimsDataFastMap & | accumulated_scans | ) | const |
transform accumulation of raw scans into a real mass spectrum
Definition at line 374 of file timsframebase.cpp.
References getMzCalibrationInterfaceSPtr(), pappso::MzCalibrationInterface::getMzFromTofIndex(), m_accumulationTime, pappso::TimsDataFastMap::readIntensity(), pappso::Trace::sortX(), pappso::TimsDataFastMap::tofIndexList, 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 312 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 359 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::setAccumulationTime | ( | double | accumulation_time_ms | ) |
Definition at line 56 of file timsframebase.cpp.
References m_accumulationTime.
void pappso::TimsFrameBase::setMsMsType | ( | quint8 | type | ) |
Definition at line 254 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 421 of file timsframebase.cpp.
References msp_mzCalibration.
void pappso::TimsFrameBase::setTime | ( | double | time | ) |
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 281 of file timsframebase.cpp.
References m_timsC6, m_timsC7, m_timsDvStart, m_timsNdelay, m_timsSlope, m_timsTtrans, m_timsVmax, and m_timsVmin.
|
protected |
accumulation time in milliseconds
Definition at line 348 of file timsframebase.h.
Referenced by pappso::TimsFrame::cumulateScansToTrace(), pappso::TimsFrame::cumulateScansToTraceMzDownResolution(), pappso::TimsFrame::cumulateScansToTraceMzDownResolution2(), pappso::TimsFrame::cumulateSingleScanIntensities(), getDriftTime(), pappso::TimsFrame::getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), pappso::TimsFrame::getMobilityScan(), pappso::TimsFrame::getRawTraceSPtr(), pappso::TimsFrameType1::getRawTraceSPtr(), pappso::TimsFrameType1::getRawValuePairList(), getTraceFromCumulatedScans(), and setAccumulationTime().
|
protected |
Definition at line 350 of file timsframebase.h.
Referenced by getMsLevel(), and setMsMsType().
|
protected |
total number of scans contained in this frame
Definition at line 338 of file timsframebase.h.
Referenced by pappso::TimsFrame::TimsFrame(), TimsFrameBase(), pappso::TimsFrameType1::TimsFrameType1(), checkScanNum(), pappso::TimsFrameType1::copyAndLzfDecompress(), pappso::TimsFrame::extractTimsXicListInRtRange(), getDriftTime(), getIonMobilityTraceByMzIndexRange(), getMaximumRawMassIndex(), pappso::TimsFrame::getNbrPeaks(), and getTotalNumberOfScans().
|
protected |
retention time
Definition at line 354 of file timsframebase.h.
Referenced by pappso::TimsFrame::extractTimsXicListInRtRange(), getTime(), and setTime().
|
protected |
Definition at line 364 of file timsframebase.h.
Referenced by getOneOverK0Transformation(), getScanNumFromOneOverK0(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 365 of file timsframebase.h.
Referenced by getOneOverK0Transformation(), getScanNumFromOneOverK0(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 356 of file timsframebase.h.
Referenced by getScanNumFromOneOverK0(), getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Tims frame database id (the SQL identifier of this frame)
Definition at line 344 of file timsframebase.h.
Referenced by pappso::TimsFrame::TimsFrame(), TimsFrameBase(), pappso::TimsFrameType1::TimsFrameType1(), getId(), and pappso::TimsFrameType1::lzfDecompressScan().
|
protected |
Definition at line 361 of file timsframebase.h.
Referenced by getScanNumFromOneOverK0(), getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 357 of file timsframebase.h.
Referenced by getScanNumFromOneOverK0(), getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 360 of file timsframebase.h.
Referenced by getScanNumFromOneOverK0(), getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 363 of file timsframebase.h.
Referenced by getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 362 of file timsframebase.h.
Referenced by getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 367 of file timsframebase.h.
Referenced by pappso::TimsFrame::getMobilityScan(), getMzCalibrationInterfaceSPtr(), setMzCalibration(), and setMzCalibrationInterfaceSPtr().