libpappsomspp
Library for mass spectrometry
|
#include <timsframe.h>
Classes | |
struct | XicComputeStructure |
Public Member Functions | |
TimsFrame (std::size_t timsId, quint32 scanNum, char *p_bytes, std::size_t len) | |
TimsFrame (const TimsFrame &other) | |
virtual | ~TimsFrame () |
virtual std::size_t | getScanPeakCount (std::size_t scanIndex) const override |
get the number of peaks in this spectrum need the binary file | |
virtual Trace | cumulateScansToTrace (std::size_t scanIndexBegin, std::size_t scanIndexEnd) const override |
cumulate scan list into a trace | |
virtual Trace | combineScansToTraceWithDowngradedMzResolution (std::size_t mzindex_merge_window, std::size_t scanNumBegin, std::size_t scanNumEnd, quint32 &mz_minimum_index, quint32 &mz_maximum_index) const override |
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 | 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 override |
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 | |
void | combineScansInTofIndexIntensityMap (TimsDataFastMap &rawSpectrum, std::size_t scan_index_begin, std::size_t scan_index_end) const override |
cumulate scan list into a trace into a raw spectrum map | |
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 override |
cumulate scan list into a trace into a raw spectrum map The intensities are NOT normalized with respect to the frame accumulation time | |
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 override |
get a single mobility scan m/z + intensities | |
virtual quint64 | cumulateScanIntensities (std::size_t scanNum) const override |
virtual quint64 | cumulateScanRangeIntensities (std::size_t scanNumBegin, std::size_t scanNumEnd) const override |
... | |
virtual std::vector< quint32 > | getScanTofIndexList (std::size_t scanNum) const override |
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 scanNum) const override |
get raw intensities without transformation from one scan it needs intensity normalization | |
virtual pappso::MassSpectrumSPtr | getMassSpectrumSPtr (std::size_t scanNum) const override |
get Mass spectrum with peaks for this scan index need the binary file | |
virtual std::vector< TofIndexIntensityPair > | getRawValuePairList (std::size_t scanNum, quint32 accepted_tof_index_range_begin, quint32 accepted_tof_index_range_end) const |
get the raw index tof_index and intensities (normalized) | |
![]() | |
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 | 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 pappso::MassSpectrumCstSPtr | getMassSpectrumCstSPtr (std::size_t scan_index) const final |
get the mass spectrum corresponding to a scan index | |
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 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 | |
TimsFrame (std::size_t timsId, quint32 scanNum) | |
constructor for binary independant tims frame | |
void | extractTimsXicListInRtRange (std::vector< XicCoordTims * >::iterator &itXicListbegin, std::vector< XicCoordTims * >::iterator &itXicListend, XicExtractMethod method) const |
virtual void | cumulateScan (std::size_t scanNum, TimsDataFastMap &accumulate_into) const |
cumulate a scan into a map | |
virtual void | cumulateScan2 (std::size_t scanNum, TimsDataFastMap &accumulate_into, quint32 accepted_tof_index_range_begin, quint32 accepted_tof_index_range_end) const |
virtual pappso::TraceSPtr | getRawTraceSPtr (std::size_t scanNum) const |
get the raw index tof_index and intensities (normalized) | |
![]() | |
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 | |
QByteArray | m_binaryData |
![]() | |
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 |
Private Member Functions | |
void | unshufflePacket (const char *src) |
unshuffle data packet of tims compression type 2 | |
std::size_t | getScanOffset (std::size_t scanNum) const |
get offset for this spectrum in the binary file | |
Private Attributes | |
friend | TimsDirectXicExtractor |
Definition at line 52 of file timsframe.h.
pappso::TimsFrame::TimsFrame | ( | std::size_t | timsId, |
quint32 | scanNum, | ||
char * | p_bytes, | ||
std::size_t | len | ||
) |
timsId | tims frame id |
scanNum | total number of scans in this frame |
p_bytes | pointer on the decompressed binary buffer |
len | size of the decompressed binary buffer |
Definition at line 60 of file timsframe.cpp.
References m_binaryData, pappso::TimsFrameBase::m_frameId, pappso::TimsFrameBase::m_scanCount, and unshufflePacket().
pappso::TimsFrame::TimsFrame | ( | const TimsFrame & | other | ) |
|
virtual |
|
protected |
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 54 of file timsframe.cpp.
|
overridevirtual |
cumulate scan list into a trace into a raw spectrum map
rawSpectrum | simple map of integers to cumulate raw counts |
scanNumBegin | first scan to cumulate |
scanNumEnd | last scan to cumulate |
Reimplemented from pappso::TimsFrameBase.
Definition at line 672 of file timsframe.cpp.
References cumulateScan(), and m_binaryData.
|
overridevirtual |
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 from pappso::TimsFrameBase.
Definition at line 710 of file timsframe.cpp.
References cumulateScan2(), pappso::TimsDataFastMap::getTofIndexList(), and m_binaryData.
|
overridevirtual |
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 from pappso::TimsFrameBase.
Definition at line 446 of file timsframe.cpp.
References pappso::TimsDataFastMap::clear(), cumulateScan(), pappso::TimsDataFastMap::downsizeMzRawMap(), pappso::TimsFrameBase::getMzCalibrationInterfaceSPtr(), pappso::MzCalibrationInterface::getMzFromTofIndex(), pappso::TimsDataFastMap::getTimsDataFastMapInstance(), pappso::TimsDataFastMap::getTofIndexList(), pappso::TimsFrameBase::m_acqDurationInMilliseconds, m_binaryData, pappso::TimsDataFastMap::readIntensity(), pappso::DataPoint::x, and pappso::DataPoint::y.
|
overridevirtual |
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 from pappso::TimsFrameBase.
Definition at line 550 of file timsframe.cpp.
References pappso::TimsDataFastMap::clear(), cumulateScan2(), pappso::TimsDataFastMap::downsizeMzRawMap(), pappso::TimsFrameBase::getMzCalibrationInterfaceSPtr(), pappso::MzCalibrationInterface::getMzFromTofIndex(), pappso::TimsDataFastMap::getTimsDataFastMapInstance(), pappso::TimsDataFastMap::getTofIndexList(), pappso::TimsFrameBase::m_acqDurationInMilliseconds, m_binaryData, pappso::TimsDataFastMap::readIntensity(), pappso::DataPoint::x, and pappso::DataPoint::y.
|
protectedvirtual |
cumulate a scan into a map
scanNum | scan number 0 to (m_scanNumber-1) |
Reimplemented in pappso::TimsFrameType1.
Definition at line 304 of file timsframe.cpp.
References pappso::TimsDataFastMap::accumulateIntensity(), getScanOffset(), getScanPeakCount(), m_binaryData, pappso::x, and pappso::y.
Referenced by combineScansInTofIndexIntensityMap(), combineScansToTraceWithDowngradedMzResolution(), and cumulateScansToTrace().
|
protectedvirtual |
Reimplemented in pappso::TimsFrameType1.
Definition at line 337 of file timsframe.cpp.
References pappso::TimsDataFastMap::accumulateIntensity(), getScanOffset(), getScanPeakCount(), m_binaryData, pappso::x, and pappso::y.
Referenced by combineScansInTofIndexIntensityMap(), and combineScansToTraceWithDowngradedMzResolution2().
|
overridevirtual |
Reimplemented from pappso::TimsFrameBase.
Definition at line 219 of file timsframe.cpp.
References getScanOffset(), getScanPeakCount(), pappso::TimsFrameBase::m_acqDurationInMilliseconds, m_binaryData, pappso::x, and pappso::y.
Referenced by cumulateScanRangeIntensities().
|
overridevirtual |
...
mobility_scan_begin | p_mobility_scan_begin:... |
mobility_scan_end | p_mobility_scan_end:... |
Reimplemented from pappso::TimsFrameBase.
Definition at line 266 of file timsframe.cpp.
References cumulateScanIntensities(), and m_binaryData.
|
overridevirtual |
cumulate scan list into a trace
scanNumBegin | first scan to cumulate |
scanNumEnd | last scan to cumulate |
Reimplemented from pappso::TimsFrameBase.
Definition at line 386 of file timsframe.cpp.
References pappso::TimsDataFastMap::clear(), cumulateScan(), pappso::TimsFrameBase::getMzCalibrationInterfaceSPtr(), pappso::MzCalibrationInterface::getMzFromTofIndex(), pappso::TimsDataFastMap::getTimsDataFastMapInstance(), pappso::TimsDataFastMap::getTofIndexList(), pappso::TimsFrameBase::m_acqDurationInMilliseconds, m_binaryData, pappso::TimsDataFastMap::readIntensity(), pappso::Trace::sortX(), pappso::DataPoint::x, and pappso::DataPoint::y.
|
protected |
Definition at line 867 of file timsframe.cpp.
References getRawTraceSPtr(), pappso::TimsFrameBase::m_rtInSeconds, pappso::TimsFrameBase::m_scanCount, and pappso::max.
|
overridevirtual |
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 from pappso::TimsFrameBase.
Reimplemented in pappso::TimsFrameType1.
Definition at line 750 of file timsframe.cpp.
References pappso::TimsFrameBase::checkScanNum(), pappso::TimsFrameBase::getMzCalibrationInterfaceSPtr(), pappso::MzCalibrationInterface::getMzFromTofIndex(), getScanOffset(), getScanPeakCount(), pappso::TimsFrameBase::m_acqDurationInMilliseconds, m_binaryData, pappso::DataPoint::x, and pappso::DataPoint::y.
|
overridevirtual |
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 from pappso::TimsFrameBase.
Definition at line 806 of file timsframe.cpp.
References pappso::TimsFrameBase::downgradeResolutionOfTofIndexIntensityPairList(), getRawValuePairList(), pappso::TimsFrameBase::m_acqDurationInMilliseconds, and pappso::TimsFrameBase::msp_mzCalibration.
|
protectedvirtual |
get the raw index tof_index and intensities (normalized)
scanNum | the scan number to extract |
Reimplemented in pappso::TimsFrameType1.
Definition at line 960 of file timsframe.cpp.
References getScanOffset(), getScanPeakCount(), pappso::TimsFrameBase::m_acqDurationInMilliseconds, m_binaryData, pappso::DataPoint::x, and pappso::DataPoint::y.
Referenced by extractTimsXicListInRtRange().
|
virtual |
get the raw index tof_index and intensities (normalized)
scanNum | the scan number to extract |
accepted_tof_index_range_begin | mz index begin |
accepted_tof_index_range_end | mz index end |
Reimplemented in pappso::TimsFrameType1.
Definition at line 997 of file timsframe.cpp.
References getScanOffset(), getScanPeakCount(), m_binaryData, and pappso::TimsFrameBase::TofIndexIntensityPair::tof_index.
Referenced by getMobilityScan().
|
overridevirtual |
get raw intensities without transformation from one scan it needs intensity normalization
Reimplemented from pappso::TimsFrameBase.
Reimplemented in pappso::TimsFrameType1.
Definition at line 195 of file timsframe.cpp.
References pappso::TimsFrameBase::checkScanNum(), getScanOffset(), getScanPeakCount(), and m_binaryData.
Referenced by pappso::BaseColorMapPlotWidget::addColorMap().
|
private |
get offset for this spectrum in the binary file
scanNum | scan number in the frame in the order it lies in binary file, from 0 to N-1 |
Definition at line 158 of file timsframe.cpp.
References m_binaryData.
Referenced by cumulateScan(), cumulateScan2(), cumulateScanIntensities(), getMassSpectrumSPtr(), getRawTraceSPtr(), getRawValuePairList(), getScanIntensityList(), and getScanTofIndexList().
|
overridevirtual |
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 from pappso::TimsFrameBase.
Reimplemented in pappso::TimsFrameType1.
Definition at line 128 of file timsframe.cpp.
References pappso::TimsFrameBase::checkScanNum(), m_binaryData, and pappso::TimsFrameBase::m_scanCount.
Referenced by cumulateScan(), cumulateScan2(), cumulateScanIntensities(), getMassSpectrumSPtr(), getRawTraceSPtr(), getRawValuePairList(), getScanIntensityList(), and getScanTofIndexList().
|
overridevirtual |
get raw index list for one given scan index are not TOF nor m/z, just index on digitizer
Reimplemented from pappso::TimsFrameBase.
Reimplemented in pappso::TimsFrameType1.
Definition at line 170 of file timsframe.cpp.
References pappso::TimsFrameBase::checkScanNum(), getScanOffset(), getScanPeakCount(), and m_binaryData.
Referenced by pappso::BaseColorMapPlotWidget::addColorMap().
|
private |
unshuffle data packet of tims compression type 2
src | is a zstd decompressed buffer pointer |
Definition at line 101 of file timsframe.cpp.
References m_binaryData.
Referenced by TimsFrame().
|
protected |
Definition at line 287 of file timsframe.h.
Referenced by TimsFrame(), pappso::TimsFrameType1::TimsFrameType1(), combineScansInTofIndexIntensityMap(), combineScansInTofIndexIntensityMap(), combineScansToTraceWithDowngradedMzResolution(), combineScansToTraceWithDowngradedMzResolution2(), pappso::TimsFrameType1::copyAndLzfDecompress(), cumulateScan(), pappso::TimsFrameType1::cumulateScan(), cumulateScan2(), pappso::TimsFrameType1::cumulateScan2(), cumulateScanIntensities(), cumulateScanRangeIntensities(), cumulateScansToTrace(), getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), getRawTraceSPtr(), pappso::TimsFrameType1::getRawTraceSPtr(), getRawValuePairList(), pappso::TimsFrameType1::getRawValuePairList(), getScanIntensityList(), pappso::TimsFrameType1::getScanIntensityList(), getScanOffset(), getScanPeakCount(), getScanTofIndexList(), pappso::TimsFrameType1::getScanTofIndexList(), pappso::TimsFrameType1::lzfDecompressScan(), and unshufflePacket().
|
private |
Definition at line 54 of file timsframe.h.