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 | getNbrPeaks (std::size_t scanNum) const override |
get the number of peaks in this spectrum need the binary file More... | |
virtual Trace | cumulateScanToTrace (std::size_t scanNumBegin, std::size_t scanNumEnd) const override |
cumulate scan list into a trace More... | |
virtual void | cumulateScansInRawMap (std::map< quint32, quint32 > &rawSpectrum, std::size_t scanNumBegin, std::size_t scanNumEnd) const override |
cumulate scan list into a trace into a raw spectrum map More... | |
virtual quint64 | cumulateSingleScanIntensities (std::size_t scanNum) const override |
virtual quint64 | cumulateScansIntensities (std::size_t scanNumBegin, std::size_t scanNumEnd) const override |
... More... | |
virtual std::vector< quint32 > | getScanIndexList (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 More... | |
virtual std::vector< quint32 > | getScanIntensities (std::size_t scanNum) const override |
get raw intensities without transformation from one scan it needs intensity normalization More... | |
virtual pappso::MassSpectrumCstSPtr | getMassSpectrumCstSPtr (std::size_t scanNum) const |
get the mass spectrum corresponding to a scan number More... | |
virtual pappso::MassSpectrumSPtr | getMassSpectrumSPtr (std::size_t scanNum) const override |
get Mass spectrum with peaks for this scan number need the binary file More... | |
![]() | |
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 | 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... | |
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 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 Member Functions | |
TimsFrame (std::size_t timsId, quint32 scanNum) | |
constructor for binary independant tims frame More... | |
void | extractTimsXicListInRtRange (std::vector< XicCoordTims * >::iterator &itXicListbegin, std::vector< XicCoordTims * >::iterator &itXicListend, XicExtractMethod method) const |
virtual void | cumulateScan (std::size_t scanNum, std::map< quint32, quint32 > &accumulate_into) const |
cumulate a scan into a map More... | |
virtual pappso::TraceSPtr | getRawTraceSPtr (std::size_t scanNum) const |
get the raw index tof_index and intensities (normalized) More... | |
Protected Attributes | |
QByteArray | m_timsDataFrame |
![]() | |
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 |
Private Member Functions | |
void | unshufflePacket (const char *src) |
unshuffle data packet of tims compression type 2 More... | |
std::size_t | getScanOffset (std::size_t scanNum) const |
get offset for this spectrum in the binary file More... | |
Private Attributes | |
friend | TimsDirectXicExtractor |
Definition at line 51 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 62 of file timsframe.cpp.
References pappso::TimsFrameBase::m_scanNumber, m_timsDataFrame, pappso::TimsFrameBase::m_timsId, 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 56 of file timsframe.cpp.
|
protectedvirtual |
cumulate a scan into a map
scanNum | scan number 0 to (m_scanNumber-1) |
Reimplemented in pappso::TimsFrameType1.
Definition at line 306 of file timsframe.cpp.
References getNbrPeaks(), getScanOffset(), m_timsDataFrame, pappso::x, and pappso::y.
Referenced by cumulateScansInRawMap(), and cumulateScanToTrace().
|
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 404 of file timsframe.cpp.
References cumulateScan(), and m_timsDataFrame.
|
overridevirtual |
...
scanNumBegin | p_scanNumBegin:... |
scanNumEnd | p_scanNumEnd:... |
Reimplemented from pappso::TimsFrameBase.
Definition at line 268 of file timsframe.cpp.
References cumulateSingleScanIntensities(), and m_timsDataFrame.
|
overridevirtual |
cumulate scan list into a trace
scanNumBegin | first scan to cumulate |
scanNumEnd | last scan to cumulate |
Reimplemented from pappso::TimsFrameBase.
Definition at line 344 of file timsframe.cpp.
References cumulateScan(), pappso::TimsFrameBase::getMzCalibrationInterfaceSPtr(), pappso::MzCalibrationInterface::getMzFromTofIndex(), pappso::TimsFrameBase::m_accumulationTime, m_timsDataFrame, pappso::Trace::sortX(), pappso::DataPoint::x, and pappso::DataPoint::y.
|
overridevirtual |
Reimplemented from pappso::TimsFrameBase.
Definition at line 221 of file timsframe.cpp.
References getNbrPeaks(), getScanOffset(), pappso::TimsFrameBase::m_accumulationTime, m_timsDataFrame, pappso::x, and pappso::y.
Referenced by cumulateScansIntensities().
|
protected |
Definition at line 505 of file timsframe.cpp.
References getRawTraceSPtr(), pappso::TimsFrameBase::m_scanNumber, pappso::TimsFrameBase::m_time, and pappso::max.
|
virtual |
get the mass spectrum corresponding to a scan number
scanNum | the scan number to retrieve |
Definition at line 441 of file timsframe.cpp.
References getMassSpectrumSPtr().
|
overridevirtual |
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 from pappso::TimsFrameBase.
Reimplemented in pappso::TimsFrameType1.
Definition at line 449 of file timsframe.cpp.
References pappso::TimsFrameBase::checkScanNum(), pappso::TimsFrameBase::getMzCalibrationInterfaceSPtr(), pappso::MzCalibrationInterface::getMzFromTofIndex(), getNbrPeaks(), getScanOffset(), pappso::TimsFrameBase::m_accumulationTime, m_timsDataFrame, pappso::DataPoint::x, and pappso::DataPoint::y.
Referenced by getMassSpectrumCstSPtr().
|
overridevirtual |
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 from pappso::TimsFrameBase.
Reimplemented in pappso::TimsFrameType1.
Definition at line 130 of file timsframe.cpp.
References pappso::TimsFrameBase::checkScanNum(), pappso::TimsFrameBase::m_scanNumber, and m_timsDataFrame.
Referenced by cumulateScan(), cumulateSingleScanIntensities(), getMassSpectrumSPtr(), getRawTraceSPtr(), getScanIndexList(), and getScanIntensities().
|
protectedvirtual |
get the raw index tof_index and intensities (normalized)
scanNum | the scan number to extract |
Reimplemented in pappso::TimsFrameType1.
Definition at line 598 of file timsframe.cpp.
References getNbrPeaks(), getScanOffset(), pappso::TimsFrameBase::m_accumulationTime, m_timsDataFrame, pappso::DataPoint::x, and pappso::DataPoint::y.
Referenced by extractTimsXicListInRtRange().
|
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 172 of file timsframe.cpp.
References pappso::TimsFrameBase::checkScanNum(), getNbrPeaks(), getScanOffset(), and m_timsDataFrame.
Referenced by pappso::BaseColorMapPlotWidget::addColorMap().
|
overridevirtual |
get raw intensities without transformation from one scan it needs intensity normalization
Reimplemented from pappso::TimsFrameBase.
Reimplemented in pappso::TimsFrameType1.
Definition at line 197 of file timsframe.cpp.
References pappso::TimsFrameBase::checkScanNum(), getNbrPeaks(), getScanOffset(), and m_timsDataFrame.
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 160 of file timsframe.cpp.
References m_timsDataFrame.
Referenced by cumulateScan(), cumulateSingleScanIntensities(), getMassSpectrumSPtr(), getRawTraceSPtr(), getScanIndexList(), and getScanIntensities().
|
private |
unshuffle data packet of tims compression type 2
src | is a zstd decompressed buffer pointer |
Definition at line 103 of file timsframe.cpp.
References m_timsDataFrame.
Referenced by TimsFrame().
|
protected |
Definition at line 187 of file timsframe.h.
Referenced by TimsFrame(), pappso::TimsFrameType1::TimsFrameType1(), pappso::TimsFrameType1::copyAndLzfDecompress(), cumulateScan(), pappso::TimsFrameType1::cumulateScan(), cumulateScansInRawMap(), cumulateScansIntensities(), cumulateScanToTrace(), cumulateSingleScanIntensities(), getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), getNbrPeaks(), getRawTraceSPtr(), pappso::TimsFrameType1::getRawTraceSPtr(), getScanIndexList(), pappso::TimsFrameType1::getScanIndexList(), getScanIntensities(), pappso::TimsFrameType1::getScanIntensities(), getScanOffset(), pappso::TimsFrameType1::lzfDecompressScan(), and unshufflePacket().
|
private |
Definition at line 53 of file timsframe.h.