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

`#include <ionmobilitygrid.h>`

## Public Member Functions

| IonMobilityGrid ()
virtual | ~IonMobilityGrid ()
void | storeObservedIdentityBetween (const MsRunId &msrun_ida, const XicCoord *xic_coorda, const MsRunId &msrun_idb, const XicCoord *xic_coordb)
void | computeCorrections ()
pappso::XicCoordSPtr | translateXicCoordFromTo (const pappso::XicCoord &source_xic_coord, const MsRunId &source_msrunid, const MsRunId &target_msrunid) const
const std::map< QString, std::vector< qint64 > > & | getMapDiferrencesStart () const
const std::map< QString, long > & | getMapCorrectionsStart () const

## Private Attributes

std::map< QString, std::vector< qint64 > > | m_mapDiferrencesStart
std::map< QString, std::vector< qint64 > > | m_mapDiferrencesStop
std::map< QString, long > | m_mapCorrectionsStart
| scan num correction on start position stored for each msrun pair
std::map< QString, long > | m_mapCorrectionsStop
| scan num correction on start position stored for each msrun pair

## Detailed Description

Todo
  helper to align ion mobility ranges between MS runs

Definition at line 41 of file ionmobilitygrid.h.

## Constructor & Destructor Documentation

## IonMobilityGrid()

IonMobilityGrid::IonMobilityGrid | ( |  | ) |

Default constructor

Definition at line 37 of file ionmobilitygrid.cpp.

{
}

## ~IonMobilityGrid()

IonMobilityGrid::~IonMobilityGrid | ( |  | ) |

virtual

Destructor

Definition at line 41 of file ionmobilitygrid.cpp.

{
}

## Member Function Documentation

## computeCorrections()

void pappso::IonMobilityGrid::computeCorrections | ( |  | ) |

Definition at line 88 of file ionmobilitygrid.cpp.

{
for(auto pair_key_start_vector : m_mapDiferrencesStart)
{
if(pair_key_start_vector.second.size() > 5)
{
// median
const auto middleItr =
pair_key_start_vector.second.begin() + (pair_key_start_vector.second.size() / 2);
std::nth_element(
pair_key_start_vector.second.begin(), middleItr, pair_key_start_vector.second.end());
m_mapCorrectionsStart[pair_key_start_vector.first] = *middleItr;
}
else
{
m_mapCorrectionsStart[pair_key_start_vector.first] = 0;
}
}
m_mapDiferrencesStart.clear();
for(auto pair_key_stop_vector : m_mapDiferrencesStop)
{
if(pair_key_stop_vector.second.size() > 5)
{
// median
const auto middleItr =
pair_key_stop_vector.second.begin() + (pair_key_stop_vector.second.size() / 2);
std::nth_element(
pair_key_stop_vector.second.begin(), middleItr, pair_key_stop_vector.second.end());
m_mapCorrectionsStop[pair_key_stop_vector.first] = *middleItr;
}
else
{
m_mapCorrectionsStop[pair_key_stop_vector.first] = 0;
}
}
m_mapDiferrencesStop.clear();
}
pappso::IonMobilityGrid::m_mapCorrectionsStop
std::map< QString, long > m_mapCorrectionsStop
scan num correction on start position stored for each msrun pair
Definition ionmobilitygrid.h:81
pappso::IonMobilityGrid::m_mapDiferrencesStart
std::map< QString, std::vector< qint64 > > m_mapDiferrencesStart
Definition ionmobilitygrid.h:70
pappso::IonMobilityGrid::m_mapCorrectionsStart
std::map< QString, long > m_mapCorrectionsStart
scan num correction on start position stored for each msrun pair
Definition ionmobilitygrid.h:76
pappso::IonMobilityGrid::m_mapDiferrencesStop
std::map< QString, std::vector< qint64 > > m_mapDiferrencesStop
Definition ionmobilitygrid.h:71

References m_mapCorrectionsStart, m_mapCorrectionsStop, m_mapDiferrencesStart, and m_mapDiferrencesStop.

## getMapCorrectionsStart()

const std::map< QString, long > & pappso::IonMobilityGrid::getMapCorrectionsStart | ( |  | ) | const

Definition at line 184 of file ionmobilitygrid.cpp.

{
return m_mapCorrectionsStart;
}

References m_mapCorrectionsStart.

## getMapDiferrencesStart()

const std::map< QString, std::vector< qint64 > > & pappso::IonMobilityGrid::getMapDiferrencesStart | ( |  | ) | const

Definition at line 178 of file ionmobilitygrid.cpp.

{
return m_mapDiferrencesStart;
}

References m_mapDiferrencesStart.

## storeObservedIdentityBetween()

void pappso::IonMobilityGrid::storeObservedIdentityBetween | ( | const MsRunId & | msrun_ida,
|  | const XicCoord * | xic_coorda,
|  | const MsRunId & | msrun_idb,
|  | const XicCoord * | xic_coordb )

Definition at line 46 of file ionmobilitygrid.cpp.

{
if(msrun_ida == msrun_idb)
return;
QString msrun_key(QString("%1-%2").arg(msrun_ida.getXmlId()).arg(msrun_idb.getXmlId()));
if(msrun_ida.getXmlId() > msrun_idb.getXmlId())
{
msrun_key = QString("%1-%2").arg(msrun_idb.getXmlId()).arg(msrun_ida.getXmlId());
std::swap(xic_coorda, xic_coordb);
}
auto it_start = m_mapDiferrencesStart.insert({msrun_key, std::vector<qint64>()});
const QVariant &ref_variantb =
xic_coordb->getParam(XicCoordParam::TimsTofIonMobilityScanNumberStart);
if(ref_variantb.isNull())
{
throw pappso::ExceptionNotPossible(QObject::tr(
"XicCoordParam::TimsTofIonMobilityScanNumberStart QVariant is null for xic_coordb"));
}
const QVariant &ref_varianta =
xic_coorda->getParam(XicCoordParam::TimsTofIonMobilityScanNumberStart);
if(ref_varianta.isNull())
{
throw pappso::ExceptionNotPossible(QObject::tr(
"XicCoordParam::TimsTofIonMobilityScanNumberStart QVariant is null for xic_coorda"));
}
it_start.first->second.push_back(ref_variantb.toLongLong() - ref_varianta.toLongLong());
auto it_stop = m_mapDiferrencesStop.insert({msrun_key, std::vector<qint64>()});
it_stop.first->second.push_back(
xic_coordb->getParam(XicCoordParam::TimsTofIonMobilityScanNumberStop).toLongLong() -
xic_coorda->getParam(XicCoordParam::TimsTofIonMobilityScanNumberStop).toLongLong());
}
pappso::MsRunId::getXmlId
const QString & getXmlId() const
Definition msrunid.cpp:154
pappso::XicCoordParam::TimsTofIonMobilityScanNumberStart
@ TimsTofIonMobilityScanNumberStart
Definition xiccoord.h:52
pappso::XicCoordParam::TimsTofIonMobilityScanNumberStop
@ TimsTofIonMobilityScanNumberStop
Definition xiccoord.h:54
pappso::XicCoord::getParam
virtual const QVariant getParam(XicCoordParam param) const
get a specific XIC coordinate parameter
Definition xiccoord.cpp:121

References pappso::XicCoord::getParam(), pappso::MsRunId::getXmlId(), m_mapDiferrencesStart, m_mapDiferrencesStop, pappso::TimsTofIonMobilityScanNumberStart, and pappso::TimsTofIonMobilityScanNumberStop.

Referenced by pappso::masschroq::Peptide::populateIonMobilityGrid().

## translateXicCoordFromTo()

pappso::XicCoordSPtr pappso::IonMobilityGrid::translateXicCoordFromTo | ( | const pappso::XicCoord & | source_xic_coord,
|  | const MsRunId & | source_msrunid,
|  | const MsRunId & | target_msrunid ) const

Definition at line 129 of file ionmobilitygrid.cpp.

{
if(m_mapCorrectionsStop.size() == 0)
{
return source_xic_coord.initializeAndClone();
}
bool opposed = false;
QString msrun_key(QString("%1-%2").arg(source_msrunid.getXmlId()).arg(target_msrunid.getXmlId()));
if(source_msrunid.getXmlId() > target_msrunid.getXmlId())
{
msrun_key = QString("%1-%2").arg(target_msrunid.getXmlId()).arg(source_msrunid.getXmlId());
opposed = true;
}
auto itstart = m_mapCorrectionsStart.find(msrun_key);
long start_dev = 0;
if(itstart != m_mapCorrectionsStart.end())
{
start_dev = itstart->second;
if(opposed)
{
start_dev *= -1;
}
}
auto itstop = m_mapCorrectionsStop.find(msrun_key);
long stop_dev = 0;
if(itstop != m_mapCorrectionsStop.end())
{
stop_dev = itstop->second;
if(opposed)
{
stop_dev *= -1;
}
}
pappso::XicCoordSPtr result_xic_coord_sp = source_xic_coord.initializeAndClone();
XicCoordTims *tims_coord = static_cast<XicCoordTims *>(result_xic_coord_sp.get());
tims_coord->scanNumBeginRangeCorrection(start_dev, stop_dev);
return result_xic_coord_sp;
}
pappso::XicCoordSPtr
std::shared_ptr< XicCoord > XicCoordSPtr
Definition xiccoord.h:44
pappso::XicCoordTims::scanNumBeginRangeCorrection
void scanNumBeginRangeCorrection(long start_dev, long stop_dev)
apply scan num correction on xic coordinate
Definition xiccoordtims.cpp:161
pappso::XicCoord::initializeAndClone
virtual XicCoordSPtr initializeAndClone() const
intialize the XIC and make a deep copy of object
Definition xiccoord.cpp:52

References pappso::MsRunId::getXmlId(), pappso::XicCoord::initializeAndClone(), m_mapCorrectionsStart, m_mapCorrectionsStop, and pappso::XicCoordTims::scanNumBeginRangeCorrection().

Referenced by pappso::masschroq::Peptide::getBestIonMobilityXicCoordToExtractOverallMsRunGroup().

## Member Data Documentation

## m_mapCorrectionsStart

std::map<QString, long> pappso::IonMobilityGrid::m_mapCorrectionsStart

private

scan num correction on start position stored for each msrun pair

Definition at line 76 of file ionmobilitygrid.h.

Referenced by computeCorrections(), getMapCorrectionsStart(), and translateXicCoordFromTo().

## m_mapCorrectionsStop

std::map<QString, long> pappso::IonMobilityGrid::m_mapCorrectionsStop

private

scan num correction on start position stored for each msrun pair

Definition at line 81 of file ionmobilitygrid.h.

Referenced by computeCorrections(), and translateXicCoordFromTo().

## m_mapDiferrencesStart

std::map<QString, std::vector<qint64> > pappso::IonMobilityGrid::m_mapDiferrencesStart

private

Definition at line 70 of file ionmobilitygrid.h.

Referenced by computeCorrections(), getMapDiferrencesStart(), and storeObservedIdentityBetween().

## m_mapDiferrencesStop

std::map<QString, std::vector<qint64> > pappso::IonMobilityGrid::m_mapDiferrencesStop

private

Definition at line 71 of file ionmobilitygrid.h.

Referenced by computeCorrections(), and storeObservedIdentityBetween().

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

- pappsomspp/core/msrun/xiccoord/ionmobilitygrid.h
- pappsomspp/core/msrun/xiccoord/ionmobilitygrid.cpp