libpappsomspp
Library for mass spectrometry
|
#include <timsframebase.h>
Public Member Functions | |
TimsFrameBase (std::size_t timsId, quint32 scanNum) | |
constructor for binary independant tims frame More... | |
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 More... | |
virtual std::size_t | getNbrPeaks (std::size_t scanNum) const |
get the number of peaks in this spectrum need the binary file More... | |
virtual std::size_t | getTotalNumberOfScans () const |
get the number of scans contained in this frame each scan represents an ion mobility slice More... | |
virtual quint32 | getMaximumRawMassIndex () const |
get the maximum raw mass index contained in this frame More... | |
virtual MassSpectrumSPtr | getMassSpectrumSPtr (std::size_t scanNum) const |
get Mass spectrum with peaks for this scan number need the binary file More... | |
virtual Trace | cumulateScanToTrace (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 More... | |
virtual void | cumulateScansInRawMap (std::map< quint32, quint32 > &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 More... | |
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 More... | |
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 More... | |
double | getOneOverK0Transformation (std::size_t scanNum) const |
get 1/K0 value of a given scan (mobility value) More... | |
std::size_t | getScanNumFromOneOverK0 (double one_over_k0) const |
get the scan number from a given 1/Ko mobility value More... | |
double | getVoltageTransformation (std::size_t scanNum) const |
get voltage for a given scan number More... | |
pappso::Trace | getTraceFromCumulatedScans (std::map< quint32, quint32 > &accumulated_scans) const |
transform accumulation of raw scans into a real mass spectrum More... | |
pappso::Trace | getTraceFromCumulatedScansBuiltinCentroid (std::map< quint32, quint32 > &accumulated_scans) const |
transform accumulation of raw scans into a real mass spectrum with a simple centroid on raw integers More... | |
virtual const MzCalibrationInterfaceSPtr & | getMzCalibrationInterfaceSPtr () const final |
get the MzCalibration model to compute mz and TOF for this frame More... | |
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 More... | |
virtual std::vector< quint32 > | getScanIntensities (std::size_t scanNum) const |
get raw intensities without transformation from one scan it needs intensity normalization More... | |
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 More... | |
Protected Attributes | |
quint32 | m_scanNumber |
total number of scans contained in this frame More... | |
std::size_t | m_timsId |
Tims frame database id (the SQL identifier of this frame) More... | |
double | m_accumulationTime = 0 |
accumulation time in milliseconds More... | |
quint8 | m_msMsType = 0 |
double | m_time = 0 |
retention time More... | |
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 47 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 | ) |
Copy constructor
other | TODO |
|
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 151 of file timsframebase.cpp.
|
virtual |
Reimplemented in pappso::TimsFrame.
Definition at line 178 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 140 of file timsframebase.cpp.
|
virtual |
Reimplemented in pappso::TimsFrame.
Definition at line 166 of file timsframebase.cpp.
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 278 of file timsframebase.cpp.
References m_accumulationTime, and m_scanNumber.
std::size_t pappso::TimsFrameBase::getId | ( | ) | const |
Definition at line 220 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 527 of file timsframebase.cpp.
References getScanIndexList(), getScanIntensities(), m_scanNumber, pappso::sum, pappso::DataPoint::x, and pappso::DataPoint::y.
|
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 |
Reimplemented in pappso::TimsFrameType1, and pappso::TimsFrame.
Definition at line 132 of file timsframebase.cpp.
|
virtual |
get the maximum raw mass index contained in this frame
Definition at line 491 of file timsframebase.cpp.
References getScanIndexList(), and m_scanNumber.
unsigned int pappso::TimsFrameBase::getMsLevel | ( | ) | const |
|
finalvirtual |
get the MzCalibration model to compute mz and TOF for this frame
Definition at line 458 of file timsframebase.cpp.
References msp_mzCalibration.
Referenced by pappso::TimsFrame::XicComputeStructure::XicComputeStructure(), pappso::TimsFrame::cumulateScanToTrace(), pappso::TimsFrame::getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), getTraceFromCumulatedScans(), and getTraceFromCumulatedScansBuiltinCentroid().
|
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::TimsFrameType1, and pappso::TimsFrame.
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 284 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::TimsFrameType1, and pappso::TimsFrame.
Definition at line 508 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::TimsFrameType1, and pappso::TimsFrame.
Definition at line 518 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 291 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 | ( | std::map< quint32, quint32 > & | accumulated_scans | ) | const |
transform accumulation of raw scans into a real mass spectrum
Definition at line 318 of file timsframebase.cpp.
References getMzCalibrationInterfaceSPtr(), pappso::MzCalibrationInterface::getMzFromTofIndex(), m_accumulationTime, pappso::Trace::sortX(), pappso::DataPoint::x, and pappso::DataPoint::y.
pappso::Trace pappso::TimsFrameBase::getTraceFromCumulatedScansBuiltinCentroid | ( | std::map< quint32, quint32 > & | accumulated_scans | ) | const |
transform accumulation of raw scans into a real mass spectrum with a simple centroid on raw integers
Definition at line 349 of file timsframebase.cpp.
References getMzCalibrationInterfaceSPtr(), pappso::MzCalibrationInterface::getMzFromTofIndex(), m_accumulationTime, 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 256 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 303 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 198 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 | ||
) |
void pappso::TimsFrameBase::setMzCalibrationInterfaceSPtr | ( | MzCalibrationInterfaceSPtr | 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 225 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 251 of file timsframebase.h.
Referenced by pappso::TimsFrame::cumulateScanToTrace(), pappso::TimsFrame::cumulateSingleScanIntensities(), getDriftTime(), pappso::TimsFrame::getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), pappso::TimsFrame::getRawTraceSPtr(), pappso::TimsFrameType1::getRawTraceSPtr(), getTraceFromCumulatedScans(), getTraceFromCumulatedScansBuiltinCentroid(), and setAccumulationTime().
|
protected |
Definition at line 253 of file timsframebase.h.
Referenced by getMsLevel(), and setMsMsType().
|
protected |
total number of scans contained in this frame
Definition at line 241 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 257 of file timsframebase.h.
Referenced by pappso::TimsFrame::extractTimsXicListInRtRange(), getTime(), and setTime().
|
protected |
Definition at line 267 of file timsframebase.h.
Referenced by getOneOverK0Transformation(), getScanNumFromOneOverK0(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 268 of file timsframebase.h.
Referenced by getOneOverK0Transformation(), getScanNumFromOneOverK0(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 259 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 247 of file timsframebase.h.
Referenced by pappso::TimsFrame::TimsFrame(), TimsFrameBase(), pappso::TimsFrameType1::TimsFrameType1(), getId(), and pappso::TimsFrameType1::lzfDecompressScan().
|
protected |
Definition at line 264 of file timsframebase.h.
Referenced by getScanNumFromOneOverK0(), getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 260 of file timsframebase.h.
Referenced by getScanNumFromOneOverK0(), getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 263 of file timsframebase.h.
Referenced by getScanNumFromOneOverK0(), getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 266 of file timsframebase.h.
Referenced by getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 265 of file timsframebase.h.
Referenced by getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().
|
protected |
Definition at line 270 of file timsframebase.h.
Referenced by getMzCalibrationInterfaceSPtr(), setMzCalibration(), and setMzCalibrationInterfaceSPtr().