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

`#include <timsframemobilitytraces.h>`

## Public Member Functions

| TimsFrameMobilityTraces ()
| TimsFrameMobilityTraces (const TimsFrameMobilityTraces &other)
| ~TimsFrameMobilityTraces ()
void | extractMobilityTraces (pappso::TimsFrameCstSPtr timsframe_sptr, std::size_t ion_mob_begin, std::size_t ion_mob_end, std::size_t max_traces)
const std::vector< pappso::TraceCstSPtr > & | getIonMobTraceList () const
const std::vector< std::size_t > & | getTofIndexList () const
const std::vector< std::size_t > & | getScanIndexList () const
const std::vector< double > | getMzList () const

## Private Attributes

pappso::TimsFrameCstSPtr | mcsp_timsFrameCstSPtr
std::vector< pappso::TraceCstSPtr > | m_ionMobTraceList
std::vector< std::size_t > | m_tofIndexList
std::vector< std::size_t > | m_scanIndexList

## Detailed Description

Todo:
  write docs

Definition at line 38 of file timsframemobilitytraces.h.

## Constructor & Destructor Documentation

## TimsFrameMobilityTraces() [1/2]

pappso::TimsFrameMobilityTraces::TimsFrameMobilityTraces | ( |  | ) |

Default constructor

Definition at line 34 of file timsframemobilitytraces.cpp.

{
}

## TimsFrameMobilityTraces() [2/2]

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

Copy constructor

Parameters

  other | TODO

Definition at line 38 of file timsframemobilitytraces.cpp.

{
}

## ~TimsFrameMobilityTraces()

pappso::TimsFrameMobilityTraces::~TimsFrameMobilityTraces | ( |  | ) |

Destructor

Definition at line 43 of file timsframemobilitytraces.cpp.

{
}

## Member Function Documentation

## extractMobilityTraces()

void pappso::TimsFrameMobilityTraces::extractMobilityTraces | ( | pappso::TimsFrameCstSPtr | timsframe_sptr,
|  | std::size_t | ion_mob_begin,
|  | std::size_t | ion_mob_end,
|  | std::size_t | max_traces
| ) |  |

Definition at line 47 of file timsframemobilitytraces.cpp.

{
m_tofIndexList.clear();
m_ionMobTraceList.clear();
m_scanIndexList.clear();
mcsp_timsFrameCstSPtr = timsframe_sptr;
pappso::TimsDataFastMap raw_spectrum =
pappso::TimsDataFastMap::getTimsDataFastMapInstance();
timsframe_sptr.get()->combineScansInTofIndexIntensityMap(
raw_spectrum, scan_index_begin, scan_index_end);
pappso::Trace total_spectrum;
for(auto index : raw_spectrum.getTofIndexList())
{
total_spectrum.push_back(
{(double)index, (double)raw_spectrum.readIntensity(index)});
}
total_spectrum.sortY(SortOrder::descending);
qDebug() << total_spectrum.size();
total_spectrum.sortY(pappso::SortOrder::descending);
for(std::size_t i = scan_index_begin; i < (scan_index_end + 1); i++)
{
m_scanIndexList.push_back(i);
}
for(auto &datapoint : total_spectrum)
{
pappso::Trace trace(
timsframe_sptr.get()->getIonMobilityTraceByTofIndexRange(
datapoint.x - 1,
datapoint.x + 1,
pappso::XicExtractMethod::sum,
scan_index_begin,
scan_index_end));
m_ionMobTraceList.push_back(trace.makeTraceSPtr());
m_tofIndexList.push_back(datapoint.x);
if(m_ionMobTraceList.size() >= max_traces)
break;
}
qDebug();
}
pappso::TimsDataFastMap
replacement for std::map
Definition timsdatafastmap.h:46
pappso::TimsDataFastMap::readIntensity
std::size_t readIntensity(quint32)
reads intensity for a tof_index
Definition timsdatafastmap.cpp:88
pappso::TimsDataFastMap::getTimsDataFastMapInstance
static TimsDataFastMap & getTimsDataFastMapInstance()
Definition timsdatafastmap.cpp:41
pappso::TimsFrameMobilityTraces::mcsp_timsFrameCstSPtr
pappso::TimsFrameCstSPtr mcsp_timsFrameCstSPtr
Definition timsframemobilitytraces.h:69
pappso::TimsFrameMobilityTraces::m_tofIndexList
std::vector< std::size_t > m_tofIndexList
Definition timsframemobilitytraces.h:72
pappso::TimsFrameMobilityTraces::m_ionMobTraceList
std::vector< pappso::TraceCstSPtr > m_ionMobTraceList
Definition timsframemobilitytraces.h:71
pappso::TimsFrameMobilityTraces::m_scanIndexList
std::vector< std::size_t > m_scanIndexList
Definition timsframemobilitytraces.h:73
pappso::TimsFrameMobilityTraces::getTofIndexList
const std::vector< std::size_t > & getTofIndexList() const
Definition timsframemobilitytraces.cpp:106
pappso::Trace
A simple container of DataPoint instances.
Definition trace.h:148
pappso::Trace::sortY
void sortY(SortOrder sort_order=SortOrder::ascending)
Definition trace.cpp:1100
pappso::XicExtractMethod::sum
@ sum
sum of intensities
pappso::SortOrder::descending
@ descending

References pappso::descending, pappso::TimsDataFastMap::getTimsDataFastMapInstance(), pappso::TimsDataFastMap::getTofIndexList(), m_ionMobTraceList, m_scanIndexList, m_tofIndexList, pappso::Trace::makeTraceSPtr(), mcsp_timsFrameCstSPtr, pappso::TimsDataFastMap::readIntensity(), pappso::Trace::sortY(), and pappso::sum.

## getIonMobTraceList()

const std::vector< pappso::TraceCstSPtr > & pappso::TimsFrameMobilityTraces::getIonMobTraceList | ( |  | ) | const

Definition at line 101 of file timsframemobilitytraces.cpp.

{
return m_ionMobTraceList;
}

References m_ionMobTraceList.

## getMzList()

const std::vector< double > pappso::TimsFrameMobilityTraces::getMzList | ( |  | ) | const

Definition at line 111 of file timsframemobilitytraces.cpp.

{
MzCalibrationInterface *mz_calibration_p =
mcsp_timsFrameCstSPtr.get()->getMzCalibrationInterfaceSPtr().get();
if(mz_calibration_p == nullptr)
{
throw pappso::ExceptionNotFound(
QObject::tr("mz calibration pointer not found"));
}
std::vector<double> mz_list;
for(std::size_t tof : m_tofIndexList)
{
mz_list.push_back(mz_calibration_p->getMzFromTofIndex((quint32)tof));
}
return mz_list;
}
pappso::ExceptionNotFound
Definition exceptionnotfound.h:32

References pappso::MzCalibrationInterface::getMzFromTofIndex(), m_tofIndexList, and mcsp_timsFrameCstSPtr.

## getScanIndexList()

const std::vector< std::size_t > & pappso::TimsFrameMobilityTraces::getScanIndexList | ( |  | ) | const

Definition at line 128 of file timsframemobilitytraces.cpp.

{
return m_scanIndexList;
}

References m_scanIndexList.

## getTofIndexList()

const std::vector< std::size_t > & pappso::TimsFrameMobilityTraces::getTofIndexList | ( |  | ) | const

Definition at line 106 of file timsframemobilitytraces.cpp.

{
return m_tofIndexList;
}

References m_tofIndexList.

## Member Data Documentation

## m_ionMobTraceList

std::vector<pappso::TraceCstSPtr> pappso::TimsFrameMobilityTraces::m_ionMobTraceList

private

Definition at line 71 of file timsframemobilitytraces.h.

Referenced by extractMobilityTraces(), and getIonMobTraceList().

## m_scanIndexList

std::vector<std::size_t> pappso::TimsFrameMobilityTraces::m_scanIndexList

private

Definition at line 73 of file timsframemobilitytraces.h.

Referenced by extractMobilityTraces(), and getScanIndexList().

## m_tofIndexList

std::vector<std::size_t> pappso::TimsFrameMobilityTraces::m_tofIndexList

private

Definition at line 72 of file timsframemobilitytraces.h.

Referenced by extractMobilityTraces(), getMzList(), and getTofIndexList().

## mcsp_timsFrameCstSPtr

pappso::TimsFrameCstSPtr pappso::TimsFrameMobilityTraces::mcsp_timsFrameCstSPtr

private

Definition at line 69 of file timsframemobilitytraces.h.

Referenced by extractMobilityTraces(), and getMzList().

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

- pappsomspp/vendors/tims/mobilitytraces/timsframemobilitytraces.h
- pappsomspp/vendors/tims/mobilitytraces/timsframemobilitytraces.cpp