Loading...
Searching...
No Matches
pappso::TimsFrameBase Class Reference

`#include <timsframebase.h>`

Inheritance diagram for pappso::TimsFrameBase:

## Classes

struct | TofIndexIntensityPair

## Public Member Functions

| 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 | getScanPeakCount (std::size_t scanIndex) 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 scan_index) const
| get Mass spectrum with peaks for this scan index need the binary file
virtual pappso::MassSpectrumCstSPtr | getMassSpectrumCstSPtr (std::size_t scan_index) const final
| get the mass spectrum corresponding to a scan index
virtual Trace | cumulateScansToTrace (std::size_t scanIndexBegin, std::size_t scanIndexEnd) 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 | combineScansToTraceWithDowngradedMzResolution (std::size_t tof_index_merge_window, std::size_t scanIndexBegin, std::size_t scanIndexEnd, quint32 &minimum_tof_index_out, quint32 &maximum_tof_index_out) const
| cumulate spectrum given a scan index 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
| 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 scan_index, std::size_t tof_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 | combineScansInTofIndexIntensityMap (TimsDataFastMap &tof_index_intensity_map, std::size_t scan_index_begin, std::size_t scan_index_end) 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 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
| 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 | cumulateScanIntensities (std::size_t scan_index) const
virtual quint64 | cumulateScanRangeIntensities (std::size_t scan_index_begin, std::size_t scan_index_end) const
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 std::vector< quint32 > | getScanTofIndexList (std::size_t scan_index) const
| 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 scan_index) const
| get raw intensities without transformation from one scan it needs intensity normalization
virtual Trace | getIonMobilityTraceByTofIndexRange (std::size_t tof_index_begin, std::size_t tof_index_end, Enums::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

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

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

## Detailed Description

Todo
  write docs

Definition at line 49 of file timsframebase.h.

## Constructor & Destructor Documentation

## TimsFrameBase() [1/2]

pappso::TimsFrameBase::TimsFrameBase | ( | std::size_t | frameId,
|  | quint32 | scanCount )

constructor for binary independant tims frame

Parameters

  timsId | tims frame identifier in the database
  scanCount | the number of scans in this frame

Definition at line 39 of file timsframebase.cpp.

{
qDebug() << frame_id;
m_frameId = frame_id;
m_scanCount = scanCount;
}
pappso::TimsFrameBase::m_scanCount
quint32 m_scanCount
total number of scans contained in this frame
Definition timsframebase.h:384
pappso::TimsFrameBase::m_frameId
std::size_t m_frameId
Tims frame database id (the SQL identifier of this frame).
Definition timsframebase.h:390

References m_frameId, and m_scanCount.

Referenced by pappso::TimsFrame::TimsFrame(), pappso::TimsFrame::TimsFrame(), pappso::TimsFrame::TimsFrame(), TimsFrameBase(), and hasSameCalibrationData().

## TimsFrameBase() [2/2]

pappso::TimsFrameBase::TimsFrameBase | ( | const TimsFrameBase & | other | ) |

Copy constructor

Parameters

  other | TODO

Definition at line 47 of file timsframebase.cpp.

{
}

References TimsFrameBase().

## ~TimsFrameBase()

pappso::TimsFrameBase::~TimsFrameBase | ( |  | ) |

virtual

Destructor

Definition at line 51 of file timsframebase.cpp.

{
}

## Member Function Documentation

## checkScanNum()

bool pappso::TimsFrameBase::checkScanNum | ( | std::size_t | scanNum | ) | const

check that this scan number exists

Parameters

  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.

{
if(scanNum >= m_scanCount)
{
throw pappso::ExceptionOutOfRange(
QObject::tr("Invalid scan number : scanNum %1 > m_scanNumber %2")
.arg(scanNum)
.arg(m_scanCount));
}
return true;
}

References m_scanCount.

Referenced by pappso::TimsFrame::getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), pappso::TimsFrame::getScanIntensityList(), pappso::TimsFrameType1::getScanIntensityList(), pappso::TimsFrame::getScanPeakCount(), pappso::TimsFrame::getScanTofIndexList(), and pappso::TimsFrameType1::getScanTofIndexList().

## combineScansInTofIndexIntensityMap() [1/2]

void pappso::TimsFrameBase::combineScansInTofIndexIntensityMap | ( | TimsDataFastMap & | tof_index_intensity_map,
|  | std::size_t | scan_index_begin,
|  | std::size_t | scan_index_end ) const

virtual

cumulate scan list into a trace into a raw spectrum map The intensities are NOT normalized with respect to the frame accumulation time

Parameters

  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

Reimplemented in pappso::TimsFrame.

Definition at line 194 of file timsframebase.cpp.

{
throw PappsoException(
QObject::tr("ERROR unable to cumulateScansInRawMap in TimsFrameBase for scan "
"number begin %1 end %2")
.arg(scanNumBegin)
.arg(scanNumEnd));
}

## combineScansInTofIndexIntensityMap() [2/2]

void pappso::TimsFrameBase::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

virtual

cumulate scan list into a trace into a raw spectrum map The intensities are NOT normalized with respect to the frame accumulation time

Parameters

  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 in pappso::TimsFrame.

Definition at line 207 of file timsframebase.cpp.

{
throw PappsoException(
QObject::tr("ERROR unable to cumulateScansInRawMap in TimsFrameBase for scan "
"number begin %1 end %2, tof index begin %3, tof index end %4")
.arg(scanNumBegin)
.arg(scanNumEnd)
.arg(tof_index_begin)
.arg(tof_index_end));
}

## combineScansToTraceWithDowngradedMzResolution()

Trace pappso::TimsFrameBase::combineScansToTraceWithDowngradedMzResolution | ( | std::size_t | tof_index_merge_window,
|  | std::size_t | scanIndexBegin,
|  | std::size_t | scanIndexEnd,
|  | quint32 & | minimum_tof_index_out,
|  | quint32 & | maximum_tof_index_out ) const

virtual

cumulate spectrum given a scan index 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

Parameters

  tof_index_merge_window | width of the TOF index window used to merge all intensities into a single point. This results in faster computing.
  scanIndexBegin | scan index in the frame in the order it lies in binary file, from 0 to N-1
  scanIndexEnd | scan index in the frame in the order it lies in binary file, from 0 to N-1
  minimum_tof_index_out | report the minimum mz index contained in the resulting trace
  maximum_tof_index_out | report the maximum mz index contained in the resulting trace

Reimplemented in pappso::TimsFrame.

Definition at line 156 of file timsframebase.cpp.

{
throw PappsoException(
QObject::tr("Non implemented function %1 %2 %3").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__));
}

## combineScansToTraceWithDowngradedMzResolution2()

Trace pappso::TimsFrameBase::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

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

Parameters

  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 168 of file timsframebase.cpp.

{
throw PappsoException(
QObject::tr("Non implemented function %1 %2 %3").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__));
}

## cumulateScanIntensities()

quint64 pappso::TimsFrameBase::cumulateScanIntensities | ( | std::size_t | scan_index | ) | const

virtual

Reimplemented in pappso::TimsFrame.

Definition at line 223 of file timsframebase.cpp.

{
throw PappsoException(
QObject::tr("ERROR unable to cumulateSingleScanIntensities in TimsFrameBase for scan "
"number %1.")
.arg(scanNum));
return 0;
}

## cumulateScanRangeIntensities()

quint64 pappso::TimsFrameBase::cumulateScanRangeIntensities | ( | std::size_t | scan_index_begin,
|  | std::size_t | scan_index_end ) const

virtual

Reimplemented in pappso::TimsFrame.

Definition at line 235 of file timsframebase.cpp.

{
throw PappsoException(
QObject::tr("ERROR unable to cumulateScansInRawMap in TimsFrameBase for scan "
"number begin %1 end %2")
.arg(scanNumBegin)
.arg(scanNumEnd));
return 0;
}

## cumulateScansToTrace()

Trace pappso::TimsFrameBase::cumulateScansToTrace | ( | std::size_t | scanIndexBegin,
|  | std::size_t | scanIndexEnd ) const

virtual

cumulate spectrum given a scan number range need the binary file The intensities are normalized with respect to the frame accumulation time

Parameters

  scanIndexBegin | scan index in the frame in the order it lies in the frame in the binary file, from 0 to N-1
  scanIndexEnd | scan number in the frame in the order it lies in the frame in the binary file, from 0 to N-1

Reimplemented in pappso::TimsFrame.

Definition at line 147 of file timsframebase.cpp.

{
throw PappsoException(QObject::tr("ERROR unable to cumulateScanToTrace in TimsFrameBase for scan "
"number begin %1 end %2")
.arg(scanNumBegin)
.arg(scanNumEnd));
}

## downgradeResolutionOfTofIndexIntensityPairList()

std::vector< TimsFrameBase::TofIndexIntensityPair > & pappso::TimsFrameBase::downgradeResolutionOfTofIndexIntensityPairList | ( | std::size_t | tof_index_merge_window,
|  | std::vector< TofIndexIntensityPair > & | spectrum ) const

protected virtual

Downgrade the TOF index resolution to lower the number of real m/z computations.

    This function merges together into a single TOF index bin all the TOF

indices contained in the tof_index_merge_window. Then the window is shifted and the operation is performed again. When all the list of \l{TofIndexIntensityPair}s has been gone through, the resolution of the data has effectively been downgrade by a factor corresponding to tof_index_merge_window.

     @param tof_index_merge_window width of the TOF index window used to merge

all intensities into a single point. This results in faster computing.

Parameters

  rawSpectrum | the spectrum to shrink

Definition at line 532 of file timsframebase.cpp.

{
qDebug() << rawSpectrum.size();
std::vector<TimsFrameBase::TofIndexIntensityPair> new_spectrum;
TimsFrameBase::TofIndexIntensityPair current_point;
current_point.intensity_index = 0;
current_point.tof_index = 0;
for(auto &pair_mz_intensity : rawSpectrum)
{
quint32 mzkey = (pair_mz_intensity.tof_index / mzindex_merge_window);
mzkey = (mzkey * mzindex_merge_window) + (mzindex_merge_window / 2);
if(current_point.tof_index != mzkey)
{
if(current_point.tof_index > 0)
{
new_spectrum.push_back(current_point);
}
current_point.intensity_index = pair_mz_intensity.intensity_index;
current_point.tof_index = mzkey;
}
else
{
current_point.intensity_index += pair_mz_intensity.intensity_index;
}
}
if(current_point.tof_index > 0)
{
new_spectrum.push_back(current_point);
}
rawSpectrum = new_spectrum;
qDebug() << rawSpectrum.size();
return rawSpectrum;
}

References downgradeResolutionOfTofIndexIntensityPairList(), pappso::TimsFrameBase::TofIndexIntensityPair::intensity_index, and pappso::TimsFrameBase::TofIndexIntensityPair::tof_index.

Referenced by downgradeResolutionOfTofIndexIntensityPairList(), and pappso::TimsFrame::getMobilityScan().

## getDriftTimeInMilliseconds()

double pappso::TimsFrameBase::getDriftTimeInMilliseconds | ( | std::size_t | scan_index | ) | const

get drift time of a scan number in milliseconds

Parameters

  scanNum | scan number in the frame in the order it lies in binary file, from 0 to N-1

Returns
  time in milliseconds of mobility delay (drift time)

Definition at line 335 of file timsframebase.cpp.

{
return (m_acqDurationInMilliseconds / (double)m_scanCount) * ((double)scanNum);
}
pappso::TimsFrameBase::m_acqDurationInMilliseconds
double m_acqDurationInMilliseconds
acquisition duration in milliseconds
Definition timsframebase.h:394

References m_acqDurationInMilliseconds, and m_scanCount.

Referenced by pappso::TimsFramesMsRunReader::readSpectrumCollection2(), and pappso::TimsMsRunReader::readSpectrumCollection2().

## getId()

std::size_t pappso::TimsFrameBase::getId | ( |  | ) | const

Definition at line 275 of file timsframebase.cpp.

{
return m_frameId;
}

References m_frameId.

Referenced by pappso::TimsFrameType1::getMassSpectrumSPtr(), pappso::TimsFrameType1::getScanIntensityList(), pappso::TimsFrameType1::getScanTofIndexList(), and pappso::TimsDirectXicExtractor::protectedExtractXicCoordSPtrList().

## getIonMobilityTraceByTofIndexRange()

Trace pappso::TimsFrameBase::getIonMobilityTraceByTofIndexRange | ( | std::size_t | tof_index_begin,
|  | std::size_t | tof_index_end,
|  | Enums::XicExtractMethod | method,
|  | std::size_t | scan_index_begin,
|  | std::size_t | scan_index_end ) const

virtual

get a mobility trace cumulating intensities inside the given mass index range

Parameters

  tof_index_begin | raw mass index lower bound
  tof_index_end | raw mass index upper bound
  method | max or sum intensities
  scan_index_begin | first mobility scan to integrate
  scan_index_end | last mobility scan to integrate

Definition at line 468 of file timsframebase.cpp.

{
Trace im_trace;
DataPoint data_point;
if(scan_index_end > m_scanCount)
scan_index_end = m_scanCount;
for(quint32 i = scan_index_begin; i < (scan_index_end + 1); i++)
{
data_point.x = i;
data_point.y = 0;
qDebug() << "m_scanNumber=" << m_scanCount << " i=" << i;
std::vector<quint32> index_list = getScanTofIndexList(i);
auto it_lower =
std::find_if(index_list.begin(), index_list.end(), [tof_index_begin](quint32 to_compare) {
if(to_compare < tof_index_begin)
{
return false;
}
return true;
});
if(it_lower == index_list.end())
{
}
else
{
auto it_upper =
std::find_if(index_list.begin(), index_list.end(), [tof_index_end](quint32 to_compare) {
if(tof_index_end >= to_compare)
{
return false;
}
return true;
});
std::vector<quint32> intensity_list = getScanIntensityList(i);
for(int j = std::distance(index_list.begin(), it_lower);
j < std::distance(index_list.begin(), it_upper);
j++)
{
if(method == Enums::XicExtractMethod::sum)
{
data_point.y += intensity_list[j];
}
else
{
data_point.y = std::max((double)intensity_list[j], data_point.y);
}
}
}
im_trace.push_back(data_point);
}
qDebug();
return im_trace;
}
pappso::TimsFrameBase::getScanTofIndexList
virtual std::vector< quint32 > getScanTofIndexList(std::size_t scan_index) const
get raw index list for one given scan index are not TOF nor m/z, just index on digitizer
Definition timsframebase.cpp:451
pappso::TimsFrameBase::getScanIntensityList
virtual std::vector< quint32 > getScanIntensityList(std::size_t scan_index) const
get raw intensities without transformation from one scan it needs intensity normalization
Definition timsframebase.cpp:460
pappso::Enums::XicExtractMethod::sum
@ sum
sum of intensities
Definition types.h:279

References getScanIntensityList(), getScanTofIndexList(), m_scanCount, pappso::Enums::sum, pappso::DataPoint::x, and pappso::DataPoint::y.

## getMassSpectrumCstSPtr()

pappso::MassSpectrumCstSPtr pappso::TimsFrameBase::getMassSpectrumCstSPtr | ( | std::size_t | scan_index | ) | const

final virtual

get the mass spectrum corresponding to a scan index

Parameters

  scan_index | the scan index of the mass spectrum to retrieve

Definition at line 140 of file timsframebase.cpp.

{
// qDebug();
return getMassSpectrumSPtr(scanNum);
}
pappso::TimsFrameBase::getMassSpectrumSPtr
virtual MassSpectrumSPtr getMassSpectrumSPtr(std::size_t scan_index) const
get Mass spectrum with peaks for this scan index need the binary file
Definition timsframebase.cpp:131

References getMassSpectrumSPtr().

## getMassSpectrumSPtr()

MassSpectrumSPtr pappso::TimsFrameBase::getMassSpectrumSPtr | ( | std::size_t | scan_index | ) | const

virtual

get Mass spectrum with peaks for this scan index need the binary file

Parameters

  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 in pappso::TimsFrame, and pappso::TimsFrameType1.

Definition at line 131 of file timsframebase.cpp.

{
throw PappsoException(
QObject::tr("ERROR unable to getMassSpectrumSPtr in TimsFrameBase for scan number %1")
.arg(scanNum));
}

Referenced by getMassSpectrumCstSPtr().

## getMaximumRawMassIndex()

quint32 pappso::TimsFrameBase::getMaximumRawMassIndex | ( |  | ) | const

virtual

get the maximum raw mass index contained in this frame

Definition at line 434 of file timsframebase.cpp.

{
quint32 max_value = 0;
for(quint32 i = 0; i < m_scanCount; i++)
{
qDebug() << "m_scanNumber=" << m_scanCount << " i=" << i;
std::vector<quint32> index_list = getScanTofIndexList(i);
auto it = std::max_element(index_list.begin(), index_list.end());
if(it != index_list.end())
{
max_value = std::max(max_value, *it);
}
}
return max_value;
}

References getScanTofIndexList(), and m_scanCount.

## getMobilityScan()

Trace pappso::TimsFrameBase::getMobilityScan | ( | std::size_t | scan_index,
|  | std::size_t | tof_index_merge_window,
|  | double | mz_range_begin,
|  | double | mz_range_end,
|  | quint32 & | mz_minimum_index_out,
|  | quint32 & | mz_maximum_index_out ) const

virtual

get a single mobility scan m/z + intensities

Parameters

  scanIndex | scan number in the frame in the order it lies in binary file, from 0 to N-1
  tof_index_merge_window | width of the TOF index 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 182 of file timsframebase.cpp.

{
throw PappsoException(
QObject::tr("Non implemented function %1 %2 %3").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__));
}

## getMsLevel()

unsigned int pappso::TimsFrameBase::getMsLevel | ( |  | ) | const

Definition at line 261 of file timsframebase.cpp.

{
if(m_msMsType == 0)
return 1;
return 2;
}
pappso::TimsFrameBase::m_msMsType
quint8 m_msMsType
Definition timsframebase.h:396

References m_msMsType.

Referenced by pappso::TimsFramesMsRunReader::computeTicChromatogram(), pappso::TimsFramesMsRunReader::readSpectrumCollection2(), and pappso::TimsMsRunReader::readSpectrumCollection2().

## getMzCalibrationInterfaceSPtr()

const MzCalibrationInterfaceSPtr & pappso::TimsFrameBase::getMzCalibrationInterfaceSPtr | ( |  | ) | const

final virtual

get the MzCalibration model to compute mz and TOF for this frame

Definition at line 404 of file timsframebase.cpp.

{
if(msp_mzCalibration == nullptr)
{
throw pappso::PappsoException(QObject::tr("ERROR in %1, %2, %3 msp_mzCalibration is null")
.arg(__FILE__)
.arg(__FUNCTION__)
.arg(__LINE__));
}
return msp_mzCalibration;
}
pappso::TimsFrameBase::msp_mzCalibration
MzCalibrationInterfaceSPtr msp_mzCalibration
Definition timsframebase.h:413

References msp_mzCalibration.

Referenced by pappso::TimsFrame::XicComputeStructure::XicComputeStructure(), pappso::TimsFrame::combineScansToTraceWithDowngradedMzResolution(), pappso::TimsFrame::combineScansToTraceWithDowngradedMzResolution2(), pappso::TimsFrame::cumulateScansToTrace(), pappso::TimsFrame::getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), and getTraceFromTofIndexIntensityMap().

## getOneOverK0Transformation()

double pappso::TimsFrameBase::getOneOverK0Transformation | ( | std::size_t | scan_index | ) | const

get 1/K0 value of a given scan (mobility value)

Parameters

  scanNum | scan number in the frame in the order it lies in binary file, from 0 to N-1

Definition at line 341 of file timsframebase.cpp.

{
return 1 / (m_timsC6 + (m_timsC7 / getVoltageTransformation(scanNum)));
}
pappso::TimsFrameBase::getVoltageTransformation
double getVoltageTransformation(std::size_t scanNum) const
get voltage for a given scan number
Definition timsframebase.cpp:310
pappso::TimsFrameBase::m_timsC6
double m_timsC6
Definition timsframebase.h:410
pappso::TimsFrameBase::m_timsC7
double m_timsC7
Definition timsframebase.h:411

References getVoltageTransformation(), m_timsC6, and m_timsC7.

Referenced by pappso::TimsFramesMsRunReader::readSpectrumCollection2(), and pappso::TimsMsRunReader::readSpectrumCollection2().

## getRtInSeconds()

double pappso::TimsFrameBase::getRtInSeconds | ( |  | ) | const

Definition at line 269 of file timsframebase.cpp.

{
return m_rtInSeconds;
}
pappso::TimsFrameBase::m_rtInSeconds
double m_rtInSeconds
retention time
Definition timsframebase.h:400

References m_rtInSeconds.

Referenced by pappso::TimsFramesMsRunReader::computeTicChromatogram(), pappso::TimsDirectXicExtractor::protectedExtractXicCoordSPtrList(), pappso::TimsFramesMsRunReader::readSpectrumCollection2(), and pappso::TimsMsRunReader::readSpectrumCollection2().

## getScanIndexFromOneOverK0()

std::size_t pappso::TimsFrameBase::getScanIndexFromOneOverK0 | ( | double | one_over_k0 | ) | const

get the scan number from a given 1/Ko mobility value

Parameters

  one_over_k0 | the mobility value to tranform

Returns
  integer the scan number in the frame in the order it lies in binary file, from 0 to N-1

Definition at line 348 of file timsframebase.cpp.

{
double temp = 1 / one_over_k0;
temp = temp - m_timsC6;
temp = temp / m_timsC7;
temp = 1 / temp;
temp = temp - m_timsDvStart;
temp = temp / m_timsSlope + m_timsTtrans + m_timsNdelay;
return (std::size_t)std::round(temp);
}
pappso::TimsFrameBase::m_timsSlope
double m_timsSlope
Definition timsframebase.h:403
pappso::TimsFrameBase::m_timsNdelay
double m_timsNdelay
Definition timsframebase.h:407
pappso::TimsFrameBase::m_timsTtrans
double m_timsTtrans
Definition timsframebase.h:406
pappso::TimsFrameBase::m_timsDvStart
double m_timsDvStart
Definition timsframebase.h:402

References m_timsC6, m_timsC7, m_timsDvStart, m_timsNdelay, m_timsSlope, and m_timsTtrans.

Referenced by pappso::TimsFramesMsRunReader::readSpectrumCollection2(), and pappso::TimsMsRunReader::readSpectrumCollection2().

## getScanIntensityList()

std::vector< quint32 > pappso::TimsFrameBase::getScanIntensityList | ( | std::size_t | scan_index | ) | const

virtual

get raw intensities without transformation from one scan it needs intensity normalization

Reimplemented in pappso::TimsFrame, and pappso::TimsFrameType1.

Definition at line 460 of file timsframebase.cpp.

{
throw PappsoException(
QObject::tr("ERROR unable to getScanIntensities in TimsFrameBase for scan number %1")
.arg(scanNum));
}

Referenced by getIonMobilityTraceByTofIndexRange().

## getScanPeakCount()

std::size_t pappso::TimsFrameBase::getScanPeakCount | ( | std::size_t | scanIndex | ) | const

virtual

get the number of peaks in this spectrum need the binary file

Parameters

  scanIndex | scan index in the frame in the order it lies in frame's binary data, from 0 to N-1

Reimplemented in pappso::TimsFrame, and pappso::TimsFrameType1.

Definition at line 117 of file timsframebase.cpp.

{
throw PappsoException(
QObject::tr("ERROR unable to get number of peaks in TimsFrameBase for scan number %1")
.arg(scanNum));
}

## getScanTofIndexList()

std::vector< quint32 > pappso::TimsFrameBase::getScanTofIndexList | ( | std::size_t | scan_index | ) | const

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 451 of file timsframebase.cpp.

{
throw PappsoException(
QObject::tr("ERROR unable to getScanIndexList in TimsFrameBase for scan number %1")
.arg(scanNum));
}

Referenced by getIonMobilityTraceByTofIndexRange(), and getMaximumRawMassIndex().

## getTotalNumberOfScans()

std::size_t pappso::TimsFrameBase::getTotalNumberOfScans | ( |  | ) | const

virtual

get the number of scans contained in this frame each scan represents an ion mobility slice

Definition at line 125 of file timsframebase.cpp.

{
return m_scanCount;
}

References m_scanCount.

Referenced by pappso::BaseColorMapPlotWidget::addColorMap(), pappso::TimsFramesMsRunReader::computeTicChromatogram(), pappso::TimsFramesMsRunReader::readSpectrumCollection2(), and pappso::TimsMsRunReader::readSpectrumCollection2().

## getTraceFromTofIndexIntensityMap()

pappso::Trace pappso::TimsFrameBase::getTraceFromTofIndexIntensityMap | ( | TimsDataFastMap & | accumulated_scans | ) | const

transform accumulation of raw scans into a real mass spectrum

Definition at line 374 of file timsframebase.cpp.

{
qDebug();
// qDebug();
// add flanking peaks
pappso::Trace local_trace;
MzCalibrationInterface *mz_calibration_p = getMzCalibrationInterfaceSPtr().get();
DataPoint element;
for(quint32 tof_index : accumulated_scans.getTofIndexList())
{
// intensity normalization
element.y =
((double)accumulated_scans.readIntensity(tof_index)) * 100.0 / m_acqDurationInMilliseconds;
// mz calibration
element.x = mz_calibration_p->getMzFromTofIndex(tof_index);
local_trace.push_back(element);
}
local_trace.sortX();
qDebug();
// qDebug();
return local_trace;
}
pappso::TimsFrameBase::getMzCalibrationInterfaceSPtr
virtual const MzCalibrationInterfaceSPtr & getMzCalibrationInterfaceSPtr() const final
get the MzCalibration model to compute mz and TOF for this frame
Definition timsframebase.cpp:404
pappso::Trace::sortX
void sortX(Enums::SortOrder sort_order=Enums::SortOrder::ascending)
Definition trace.cpp:1071

References getMzCalibrationInterfaceSPtr(), pappso::MzCalibrationInterface::getMzFromTofIndex(), pappso::TimsDataFastMap::getTofIndexList(), m_acqDurationInMilliseconds, pappso::TimsDataFastMap::readIntensity(), pappso::Trace::sortX(), pappso::DataPoint::x, and pappso::DataPoint::y.

## getVoltageTransformation()

double pappso::TimsFrameBase::getVoltageTransformation | ( | std::size_t | scanNum | ) | const

get voltage for a given scan number

Parameters

  scanNum | scan number in the frame in the order it lies in binary file, from 0 to N-1

Returns
  double volt measure

Definition at line 310 of file timsframebase.cpp.

{
double v = m_timsDvStart + m_timsSlope * ((double)scanNum - m_timsTtrans - m_timsNdelay);
if(v < m_timsVmin)
{
throw pappso::PappsoException(
QObject::tr("ERROR in TimsFrame::getVoltageTransformation invalid tims "
"calibration, v < m_timsVmin %1 < %2")
.arg(v)
.arg(m_timsVmin));
}
if(v > m_timsVmax)
{
throw pappso::PappsoException(
QObject::tr("ERROR in TimsFrame::getVoltageTransformation invalid tims "
"calibration, v > m_timsVmax %1 > %2")
.arg(v)
.arg(m_timsVmax));
}
return v;
}
pappso::TimsFrameBase::m_timsVmax
double m_timsVmax
Definition timsframebase.h:409
pappso::TimsFrameBase::m_timsVmin
double m_timsVmin
Definition timsframebase.h:408

References m_timsDvStart, m_timsNdelay, m_timsSlope, m_timsTtrans, m_timsVmax, and m_timsVmin.

Referenced by getOneOverK0Transformation().

## hasSameCalibrationData()

bool pappso::TimsFrameBase::hasSameCalibrationData | ( | const TimsFrameBase & | other | ) | const

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 360 of file timsframebase.cpp.

{
if((m_timsDvStart == other.m_timsDvStart) && (m_timsTtrans == other.m_timsTtrans) &&
(m_timsNdelay == other.m_timsNdelay) && (m_timsVmin == other.m_timsVmin) &&
(m_timsVmax == other.m_timsVmax) && (m_timsC6 == other.m_timsC6) &&
(m_timsC7 == other.m_timsC7) && (m_timsSlope == other.m_timsSlope))
{
return true;
}
return false;
}

References TimsFrameBase(), m_timsC6, m_timsC7, m_timsDvStart, m_timsNdelay, m_timsSlope, m_timsTtrans, m_timsVmax, and m_timsVmin.

## setAcqDurationInMilliseconds()

void pappso::TimsFrameBase::setAcqDurationInMilliseconds | ( | double | acquisition_duration_ms | ) |

Definition at line 56 of file timsframebase.cpp.

{
m_acqDurationInMilliseconds = acquisition_duration_ms;
}

References m_acqDurationInMilliseconds.

## setMsMsType()

void pappso::TimsFrameBase::setMsMsType | ( | quint8 | type | ) |

Definition at line 253 of file timsframebase.cpp.

{
qDebug() << " m_msMsType=" << type;
m_msMsType = type;
}

References m_msMsType.

## setMzCalibration()

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.

{
/* MzCalibrationModel1 mzCalibration(temperature_correction,
digitizerTimebase,
digitizerDelay,
C0,
C1,
C2,
C3,
C4);
*/
msp_mzCalibration = std::make_shared<MzCalibrationModel1>(T1_frame,
T2_frame,
digitizerTimebase,
digitizerDelay,
C0,
C1,
C2,
C3,
C4,
T1_ref,
T2_ref,
dC1,
dC2);
}

References msp_mzCalibration.

## setMzCalibrationInterfaceSPtr()

void pappso::TimsFrameBase::setMzCalibrationInterfaceSPtr | ( | MzCalibrationInterfaceSPtr | mzCalibration | ) |

Definition at line 418 of file timsframebase.cpp.

{
if(mzCalibration == nullptr)
{
throw pappso::PappsoException(QObject::tr("ERROR in %1, %2, %3 msp_mzCalibration is null")
.arg(__FILE__)
.arg(__FUNCTION__)
.arg(__LINE__));
}
msp_mzCalibration = mzCalibration;
}

References msp_mzCalibration.

## setRtInSeconds()

void pappso::TimsFrameBase::setRtInSeconds | ( | double | time | ) |

Definition at line 247 of file timsframebase.cpp.

{
m_rtInSeconds = time;
}

References m_rtInSeconds.

## setTimsCalibration()

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 280 of file timsframebase.cpp.

{
if(tims_model_type != 2)
{
throw pappso::PappsoException(
QObject::tr("ERROR in TimsFrame::setTimsCalibration tims_model_type != 2"));
}
m_timsDvStart = C2; // C2 from TimsCalibration
m_timsTtrans = C4; // C4 from TimsCalibration
m_timsNdelay = C0; // C0 from TimsCalibration
m_timsVmin = C8; // C8 from TimsCalibration
m_timsVmax = C9; // C9 from TimsCalibration
m_timsC6 = C6;
m_timsC7 = C7;
m_timsSlope = (C3 - m_timsDvStart) / C1; // //C3 from TimsCalibration // C2 from
// TimsCalibration // C1 from TimsCalibration
}

References m_timsC6, m_timsC7, m_timsDvStart, m_timsNdelay, m_timsSlope, m_timsTtrans, m_timsVmax, and m_timsVmin.

## Member Data Documentation

## m_acqDurationInMilliseconds

double pappso::TimsFrameBase::m_acqDurationInMilliseconds = 0

protected

acquisition duration in milliseconds

Definition at line 394 of file timsframebase.h.

Referenced by pappso::TimsFrame::combineScansToTraceWithDowngradedMzResolution(), pappso::TimsFrame::combineScansToTraceWithDowngradedMzResolution2(), pappso::TimsFrame::cumulateScanIntensities(), pappso::TimsFrame::cumulateScansToTrace(), getDriftTimeInMilliseconds(), pappso::TimsFrame::getMassSpectrumSPtr(), pappso::TimsFrameType1::getMassSpectrumSPtr(), pappso::TimsFrame::getMobilityScan(), pappso::TimsFrame::getRawTraceSPtr(), pappso::TimsFrameType1::getRawTraceSPtr(), pappso::TimsFrameType1::getRawValuePairList(), getTraceFromTofIndexIntensityMap(), and setAcqDurationInMilliseconds().

## m_frameId

std::size_t pappso::TimsFrameBase::m_frameId

protected

Tims frame database id (the SQL identifier of this frame).

Warning
  in sqlite, there is another field called TimsId : this is not that, because it is in fact an offset in bytes in the binary file.

Definition at line 390 of file timsframebase.h.

Referenced by pappso::TimsFrame::TimsFrame(), TimsFrameBase(), pappso::TimsFrameType1::TimsFrameType1(), getId(), and pappso::TimsFrameType1::lzfDecompressScan().

## m_msMsType

quint8 pappso::TimsFrameBase::m_msMsType = 0

protected

Definition at line 396 of file timsframebase.h.

Referenced by getMsLevel(), and setMsMsType().

## m_rtInSeconds

double pappso::TimsFrameBase::m_rtInSeconds = 0

protected

retention time

Definition at line 400 of file timsframebase.h.

Referenced by pappso::TimsFrame::extractTimsXicListInRtRange(), getRtInSeconds(), and setRtInSeconds().

## m_scanCount

quint32 pappso::TimsFrameBase::m_scanCount

protected

total number of scans contained in this frame

Definition at line 384 of file timsframebase.h.

Referenced by pappso::TimsFrame::TimsFrame(), TimsFrameBase(), pappso::TimsFrameType1::TimsFrameType1(), checkScanNum(), pappso::TimsFrameType1::copyAndLzfDecompress(), pappso::TimsFrame::extractTimsXicListInRtRange(), getDriftTimeInMilliseconds(), getIonMobilityTraceByTofIndexRange(), getMaximumRawMassIndex(), pappso::TimsFrame::getScanPeakCount(), and getTotalNumberOfScans().

## m_timsC6

double pappso::TimsFrameBase::m_timsC6 = 0

protected

Definition at line 410 of file timsframebase.h.

Referenced by getOneOverK0Transformation(), getScanIndexFromOneOverK0(), hasSameCalibrationData(), and setTimsCalibration().

## m_timsC7

double pappso::TimsFrameBase::m_timsC7 = 0

protected

Definition at line 411 of file timsframebase.h.

Referenced by getOneOverK0Transformation(), getScanIndexFromOneOverK0(), hasSameCalibrationData(), and setTimsCalibration().

## m_timsDvStart

double pappso::TimsFrameBase::m_timsDvStart = 0

protected

Definition at line 402 of file timsframebase.h.

Referenced by getScanIndexFromOneOverK0(), getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().

## m_timsNdelay

double pappso::TimsFrameBase::m_timsNdelay = 0

protected

Definition at line 407 of file timsframebase.h.

Referenced by getScanIndexFromOneOverK0(), getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().

## m_timsSlope

double pappso::TimsFrameBase::m_timsSlope

protected

Initial value:
=
0

Definition at line 403 of file timsframebase.h.

Referenced by getScanIndexFromOneOverK0(), getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().

## m_timsTtrans

double pappso::TimsFrameBase::m_timsTtrans = 0

protected

Definition at line 406 of file timsframebase.h.

Referenced by getScanIndexFromOneOverK0(), getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().

## m_timsVmax

double pappso::TimsFrameBase::m_timsVmax = 0

protected

Definition at line 409 of file timsframebase.h.

Referenced by getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().

## m_timsVmin

double pappso::TimsFrameBase::m_timsVmin = 0

protected

Definition at line 408 of file timsframebase.h.

Referenced by getVoltageTransformation(), hasSameCalibrationData(), and setTimsCalibration().

## msp_mzCalibration

MzCalibrationInterfaceSPtr pappso::TimsFrameBase::msp_mzCalibration = nullptr

protected

Definition at line 413 of file timsframebase.h.

Referenced by pappso::TimsFrame::getMobilityScan(), getMzCalibrationInterfaceSPtr(), setMzCalibration(), and setMzCalibrationInterfaceSPtr().

The documentation for this class was generated from the following files:

- pappsomspp/core/vendors/tims/timsframebase.h
- pappsomspp/core/vendors/tims/timsframebase.cpp