libpappsomspp
Library for mass spectrometry
|
#include <timsframetype1.h>
Public Member Functions | |
TimsFrameType1 (std::size_t timsId, quint32 scanNum, char *p_bytes, std::size_t len) | |
TimsFrameType1 (const TimsFrameType1 &other) | |
virtual | ~TimsFrameType1 () |
virtual std::size_t | getNbrPeaks (std::size_t scanNum) const override |
get the number of peaks in this spectrum need the binary file | |
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 | |
virtual std::vector< quint32 > | getScanIntensities (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 the mass spectrum corresponding to a scan number | |
![]() | |
TimsFrame (std::size_t timsId, quint32 scanNum, char *p_bytes, std::size_t len) | |
TimsFrame (const TimsFrame &other) | |
virtual | ~TimsFrame () |
virtual Trace | cumulateScansToTrace (std::size_t scanNumBegin, std::size_t scanNumEnd) const override |
cumulate scan list into a trace | |
virtual Trace | cumulateScansToTraceMzDownResolution (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 | 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 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 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 | |
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 | cumulateSingleScanIntensities (std::size_t scanNum) const override |
virtual quint64 | cumulateScansIntensities (std::size_t scanNumBegin, std::size_t scanNumEnd) const override |
... | |
![]() | |
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 | 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 scanNum) const final |
get the mass spectrum corresponding to a scan number | |
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 (std::map< quint32, quint32 > &accumulated_scans) const |
transform accumulation of raw scans into a real mass spectrum | |
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 | |
virtual const MzCalibrationInterfaceSPtr & | getMzCalibrationInterfaceSPtr () const final |
get the MzCalibration model to compute mz and TOF for this frame | |
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 | |
Protected Member Functions | |
virtual void | cumulateScan (std::size_t scanNum, std::map< quint32, quint32 > &accumulate_into) const override |
cumulate a scan into a map | |
virtual void | cumulateScan2 (std::size_t scanNum, std::map< quint32, quint32 > &accumulate_into, quint32 accepted_tof_index_range_begin, quint32 accepted_tof_index_range_end) const override |
virtual pappso::TraceSPtr | getRawTraceSPtr (std::size_t scanNum) const override |
get the raw index tof_index and intensities (normalized) | |
virtual std::vector< RawValuePair > | getRawValuePairList (std::size_t scanNum, quint32 accepted_tof_index_range_begin, quint32 accepted_tof_index_range_end) const override |
get the raw index tof_index and intensities (normalized) | |
![]() | |
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 std::map< quint32, quint32 > & | downsizeMzRawMap (std::size_t mzindex_merge_window, std::map< quint32, quint32 > &rawSpectrum) const |
downsize mz resolution to lower the number of real mz computations | |
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 | |
Private Member Functions | |
void | copyAndLzfDecompress (const char *src, std::size_t len) |
copy buffer header and lzf decompress each scan for tims compression type 1 | |
unsigned int | lzfDecompressScan (const char *src, unsigned int src_len, char *dest, unsigned int dest_len) |
decompress a single LZF compressed scan buffer | |
Private Attributes | |
std::vector< std::size_t > | m_scanOffsetList |
std::vector< std::size_t > | m_scanSizeList |
Additional Inherited Members | |
![]() | |
QByteArray | m_timsDataFrame |
![]() | |
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 37 of file timsframetype1.h.
pappso::TimsFrameType1::TimsFrameType1 | ( | 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 41 of file timsframetype1.cpp.
References copyAndLzfDecompress(), pappso::TimsFrameBase::m_scanNumber, pappso::TimsFrame::m_timsDataFrame, and pappso::TimsFrameBase::m_timsId.
pappso::TimsFrameType1::TimsFrameType1 | ( | const TimsFrameType1 & | other | ) |
|
virtual |
|
private |
copy buffer header and lzf decompress each scan for tims compression type 1
src | raw data buffer containing scan offsets and LZF compressed scans |
len | length of the data buffer |
Definition at line 81 of file timsframetype1.cpp.
References lzfDecompressScan(), pappso::TimsFrameBase::m_scanNumber, m_scanOffsetList, m_scanSizeList, and pappso::TimsFrame::m_timsDataFrame.
Referenced by TimsFrameType1().
|
overrideprotectedvirtual |
cumulate a scan into a map
scanNum | scan number 0 to (m_scanNumber-1) |
Reimplemented from pappso::TimsFrame.
Definition at line 219 of file timsframetype1.cpp.
References m_scanOffsetList, m_scanSizeList, pappso::TimsFrame::m_timsDataFrame, pappso::x, and pappso::y.
|
overrideprotectedvirtual |
Reimplemented from pappso::TimsFrame.
Definition at line 264 of file timsframetype1.cpp.
References m_scanOffsetList, m_scanSizeList, pappso::TimsFrame::m_timsDataFrame, pappso::x, and pappso::y.
|
overridevirtual |
get the mass spectrum corresponding to a scan number
scanNum | the scan number to retrieve |
Reimplemented from pappso::TimsFrame.
Definition at line 440 of file timsframetype1.cpp.
References pappso::TimsFrameBase::checkScanNum(), pappso::TimsFrameBase::getId(), pappso::TimsFrameBase::getMzCalibrationInterfaceSPtr(), pappso::MzCalibrationInterface::getMzFromTofIndex(), pappso::TimsFrameBase::m_accumulationTime, m_scanOffsetList, m_scanSizeList, pappso::TimsFrame::m_timsDataFrame, pappso::PappsoException::qwhat(), pappso::DataPoint::x, and pappso::DataPoint::y.
Referenced by getNbrPeaks().
|
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::TimsFrame.
Definition at line 211 of file timsframetype1.cpp.
References getMassSpectrumSPtr().
|
overrideprotectedvirtual |
get the raw index tof_index and intensities (normalized)
scanNum | the scan number to extract |
Reimplemented from pappso::TimsFrame.
Definition at line 516 of file timsframetype1.cpp.
References pappso::TimsFrameBase::m_accumulationTime, m_scanOffsetList, m_scanSizeList, pappso::TimsFrame::m_timsDataFrame, pappso::DataPoint::x, and pappso::DataPoint::y.
|
overrideprotectedvirtual |
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 from pappso::TimsFrame.
Definition at line 572 of file timsframetype1.cpp.
References pappso::TimsFrameBase::RawValuePair::intensity_index, pappso::TimsFrameBase::m_accumulationTime, m_scanOffsetList, m_scanSizeList, pappso::TimsFrame::m_timsDataFrame, and pappso::TimsFrameBase::RawValuePair::mz_tof_index.
|
overridevirtual |
get raw index list for one given scan index are not TOF nor m/z, just index on digitizer
Reimplemented from pappso::TimsFrame.
Definition at line 320 of file timsframetype1.cpp.
References pappso::TimsFrameBase::checkScanNum(), pappso::TimsFrameBase::getId(), m_scanOffsetList, m_scanSizeList, pappso::TimsFrame::m_timsDataFrame, and pappso::PappsoException::qwhat().
|
overridevirtual |
get raw intensities without transformation from one scan it needs intensity normalization
Reimplemented from pappso::TimsFrame.
Definition at line 379 of file timsframetype1.cpp.
References pappso::TimsFrameBase::checkScanNum(), pappso::TimsFrameBase::getId(), m_scanOffsetList, m_scanSizeList, pappso::TimsFrame::m_timsDataFrame, and pappso::PappsoException::qwhat().
|
private |
decompress a single LZF compressed scan buffer
src | pointer on the LZF compressed buffer |
src_len | length of the source buffer |
dest | pointer to the destination buffer (in the qbyte array) |
dest_len | length of the destination buffer (max possible in the qbytearray) |
Definition at line 169 of file timsframetype1.cpp.
References pappso::TimsFrame::m_timsDataFrame, and pappso::TimsFrameBase::m_timsId.
Referenced by copyAndLzfDecompress().
|
private |
Definition at line 146 of file timsframetype1.h.
Referenced by copyAndLzfDecompress(), cumulateScan(), cumulateScan2(), getMassSpectrumSPtr(), getRawTraceSPtr(), getRawValuePairList(), getScanIndexList(), and getScanIntensities().
|
private |
Definition at line 147 of file timsframetype1.h.
Referenced by copyAndLzfDecompress(), cumulateScan(), cumulateScan2(), getMassSpectrumSPtr(), getRawTraceSPtr(), getRawValuePairList(), getScanIndexList(), and getScanIntensities().