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

`#include <msrunreadconfig.h>`

## Public Member Functions

| MsRunReadConfig ()
| MsRunReadConfig (const MsRunReadConfig &other)
| ~MsRunReadConfig ()
MsRunReadConfig & | operator= (const MsRunReadConfig &other)
void | setRetentionTimeStartInSeconds (double retention_time_start_in_seconds)
double | getRetentionTimeStartInSeconds () const
void | setRetentionTimeEndInSeconds (double retention_time_end_in_seconds)
double | getRetentionTimeEndInSeconds () const
void | setMsLevels (std::vector< std::size_t > ms_levels)
const bool * | getMsLevels () const
QString | getMsLevelsAsString () const
void | setNeedPeakList (bool need_peak_list)
bool | needPeakList () const
void | setParameterValue (MsRunReadConfigParameter parameter, const QVariant &value)
const QVariant | getParameterValue (MsRunReadConfigParameter parameter) const
void | reset ()
QString | toString () const
bool | acceptMsLevel (std::size_t ms_level) const
bool | acceptRetentionTimeInSeconds (double retention_time_in_seconds) const

## Private Attributes

double | m_retentionTimeStartSeconds = -1
double | m_retentionTimeEndSeconds = -1
bool | m_isPeakListNeeded = true
bool | m_msLevels [MAX_MS_LEVELS] = {false}
std::map< MsRunReadConfigParameter, QVariant > | m_paramsMap
| map containing any parameter value

## Detailed Description

Definition at line 61 of file msrunreadconfig.h.

## Constructor & Destructor Documentation

## MsRunReadConfig() [1/2]

pappso::MsRunReadConfig::MsRunReadConfig | ( |  | ) |

Definition at line 28 of file msrunreadconfig.cpp.

{
// Set these two levels to true by default.
m_msLevels[1] = true;
m_msLevels[2] = true;
}
pappso::MsRunReadConfig::m_msLevels
bool m_msLevels[MAX_MS_LEVELS]
Definition msrunreadconfig.h:105

References m_msLevels.

## MsRunReadConfig() [2/2]

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

Definition at line 35 of file msrunreadconfig.cpp.

: m_retentionTimeStartSeconds(other.m_retentionTimeStartSeconds),
m_retentionTimeEndSeconds(other.m_retentionTimeEndSeconds),
m_paramsMap(other.m_paramsMap)
{
for(std::size_t index = 0; index < MAX_MS_LEVELS; ++index)
m_msLevels[index] = other.m_msLevels[index];
}
pappso::MsRunReadConfig::m_retentionTimeStartSeconds
double m_retentionTimeStartSeconds
Definition msrunreadconfig.h:97
pappso::MsRunReadConfig::m_retentionTimeEndSeconds
double m_retentionTimeEndSeconds
Definition msrunreadconfig.h:98
pappso::MsRunReadConfig::m_paramsMap
std::map< MsRunReadConfigParameter, QVariant > m_paramsMap
map containing any parameter value
Definition msrunreadconfig.h:110
pappso::MAX_MS_LEVELS
constexpr std::size_t MAX_MS_LEVELS
Definition msrunreadconfig.h:59

References m_msLevels, and pappso::MAX_MS_LEVELS.

## ~MsRunReadConfig()

pappso::MsRunReadConfig::~MsRunReadConfig | ( |  | ) |

Definition at line 44 of file msrunreadconfig.cpp.

{
}

## Member Function Documentation

## acceptMsLevel()

bool pappso::MsRunReadConfig::acceptMsLevel | ( | std::size_t | ms_level | ) | const

Definition at line 135 of file msrunreadconfig.cpp.

{
if(ms_level >= MAX_MS_LEVELS)
return false;
return m_msLevels[ms_level];
}

References m_msLevels, and pappso::MAX_MS_LEVELS.

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

## acceptRetentionTimeInSeconds()

bool pappso::MsRunReadConfig::acceptRetentionTimeInSeconds | ( | double | retention_time_in_seconds | ) | const

Definition at line 144 of file msrunreadconfig.cpp.

{
// qDebug() << "Requested retention_time_in_seconds:"
// << retention_time_in_seconds;
// Whatever the member datum below, if it is equal to -1
// then that means that RT is not a selection criterion.
if(m_retentionTimeStartSeconds == -1 || m_retentionTimeEndSeconds == -1)
{
return true;
}
// We use inclusive RT ranges.
if(retention_time_in_seconds >= m_retentionTimeStartSeconds)
{
if(retention_time_in_seconds <= m_retentionTimeEndSeconds)
{
return true;
}
}
return false;
}

References m_retentionTimeEndSeconds, and m_retentionTimeStartSeconds.

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

## getMsLevels()

const bool * pappso::MsRunReadConfig::getMsLevels | ( | void |  | ) | const

Definition at line 114 of file msrunreadconfig.cpp.

{
return m_msLevels;
}

References m_msLevels.

## getMsLevelsAsString()

QString pappso::MsRunReadConfig::getMsLevelsAsString | ( |  | ) | const

Definition at line 120 of file msrunreadconfig.cpp.

{
QString text = "";
for(std::size_t index = 0; index < MAX_MS_LEVELS; ++index)
{
if(m_msLevels[index] == true)
text += QString("%1 ").arg(index);
}
return text;
}

References m_msLevels, and pappso::MAX_MS_LEVELS.

## getParameterValue()

const QVariant pappso::MsRunReadConfig::getParameterValue | ( | pappso::MsRunReadConfigParameter | parameter | ) | const

Definition at line 196 of file msrunreadconfig.cpp.

{
auto it = m_paramsMap.find(parameter);
if(it == m_paramsMap.end())
{
return QVariant();
}
else
{
return it->second;
}
}

References m_paramsMap.

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

## getRetentionTimeEndInSeconds()

double pappso::MsRunReadConfig::getRetentionTimeEndInSeconds | ( |  | ) | const

Definition at line 85 of file msrunreadconfig.cpp.

{
return m_retentionTimeEndSeconds;
}

References m_retentionTimeEndSeconds.

## getRetentionTimeStartInSeconds()

double pappso::MsRunReadConfig::getRetentionTimeStartInSeconds | ( |  | ) | const

Definition at line 72 of file msrunreadconfig.cpp.

{
return m_retentionTimeStartSeconds;
}

References m_retentionTimeStartSeconds.

## needPeakList()

bool pappso::MsRunReadConfig::needPeakList | ( |  | ) | const

Definition at line 170 of file msrunreadconfig.cpp.

{
return m_isPeakListNeeded;
}
pappso::MsRunReadConfig::m_isPeakListNeeded
bool m_isPeakListNeeded
Definition msrunreadconfig.h:100

References m_isPeakListNeeded.

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

## operator=()

MsRunReadConfig & pappso::MsRunReadConfig::operator= | ( | const MsRunReadConfig & | other | ) |

Definition at line 49 of file msrunreadconfig.cpp.

{
if(&other == this)
return *this;
m_retentionTimeStartSeconds = other.m_retentionTimeStartSeconds;
m_retentionTimeEndSeconds = other.m_retentionTimeEndSeconds;
m_paramsMap = other.m_paramsMap;
for(std::size_t index = 0; index < MAX_MS_LEVELS; ++index)
m_msLevels[index] = other.m_msLevels[index];
return *this;
}

References m_msLevels, m_paramsMap, m_retentionTimeEndSeconds, m_retentionTimeStartSeconds, and pappso::MAX_MS_LEVELS.

## reset()

void pappso::MsRunReadConfig::reset | ( |  | ) |

Definition at line 212 of file msrunreadconfig.cpp.

{
m_retentionTimeStartSeconds = -1;
m_retentionTimeEndSeconds = -1;
m_isPeakListNeeded = true;
for(std::size_t index = 0; index < MAX_MS_LEVELS; ++index)
{
m_msLevels[index] = false;
}
// Set these two levels to true by default.
m_msLevels[1] = true;
m_msLevels[2] = true;
m_paramsMap.clear();
}

References m_isPeakListNeeded, m_msLevels, m_paramsMap, m_retentionTimeEndSeconds, m_retentionTimeStartSeconds, and pappso::MAX_MS_LEVELS.

## setMsLevels()

void pappso::MsRunReadConfig::setMsLevels | ( | std::vector< std::size_t > | ms_levels | ) |

Definition at line 91 of file msrunreadconfig.cpp.

{
// First reset all the levels to false, this time, since we'll fill the array
// with explicit values.
for(std::size_t index = 0; index < MAX_MS_LEVELS; ++index)
m_msLevels[index] = false;
// And now actually fill with true values the proper array cells.
for(auto ms_level : ms_levels)
{
if(ms_level >= MAX_MS_LEVELS)
{
qDebug() << "The passed vector of MS levels holds a value that is "
"not correct:"
<< ms_level << ": skipping it.";
continue;
}
m_msLevels[ms_level] = true;
}
}

References m_msLevels, and pappso::MAX_MS_LEVELS.

Referenced by pappso::MsRunReader::getRetentionTimeLine().

## setNeedPeakList()

void pappso::MsRunReadConfig::setNeedPeakList | ( | bool | need_peak_list | ) |

Definition at line 176 of file msrunreadconfig.cpp.

{
m_isPeakListNeeded = need_peak_list;
}

References m_isPeakListNeeded.

Referenced by pappso::MsRunReader::getRetentionTimeLine().

## setParameterValue()

void pappso::MsRunReadConfig::setParameterValue | ( | pappso::MsRunReadConfigParameter | parameter,
|  | const QVariant & | value
| ) |  |

Definition at line 182 of file msrunreadconfig.cpp.

{
auto ret = m_paramsMap.insert(
std::pair<MsRunReadConfigParameter, QVariant>(parameter, value));
if(ret.second == false)
{
ret.first->second = value;
}
}

References m_paramsMap.

## setRetentionTimeEndInSeconds()

void pappso::MsRunReadConfig::setRetentionTimeEndInSeconds | ( | double | retention_time_end_in_seconds | ) |

Definition at line 78 of file msrunreadconfig.cpp.

{
m_retentionTimeEndSeconds = retention_time_end_in_seconds;
}

References m_retentionTimeEndSeconds.

## setRetentionTimeStartInSeconds()

void pappso::MsRunReadConfig::setRetentionTimeStartInSeconds | ( | double | retention_time_start_in_seconds | ) |

Definition at line 65 of file msrunreadconfig.cpp.

{
m_retentionTimeStartSeconds = retention_time_start_in_seconds;
}

References m_retentionTimeStartSeconds.

## toString()

QString pappso::MsRunReadConfig::toString | ( |  | ) | const

Definition at line 230 of file msrunreadconfig.cpp.

{
QString text = QString("MsRunReadConfig\n: RT start: %1, RT end: %2\n")
.arg(m_retentionTimeStartSeconds)
.arg(m_retentionTimeEndSeconds);
text += "MS level(s): ";
for(std::size_t index = 0; index < MAX_MS_LEVELS; ++index)
{
if(m_msLevels[index] == true)
text += QString("%1 ").arg(index);
}
text += " \n";
if(!getParameterValue(
MsRunReadConfigParameter::TimsFrameIonMobScanIndexBegin)
.isNull())
{
text +=
QString("Mobility index range: [%1-%2]\n")
.arg(getParameterValue(MsRunReadConfigParameter::
TimsFrameIonMobScanIndexBegin)
.toUInt())
.arg(getParameterValue(MsRunReadConfigParameter::
TimsFrameIonMobScanIndexEnd)
.toUInt());
}
if(!getParameterValue(MsRunReadConfigParameter::
TimsFrameIonMobOneOverK0Begin)
.isNull())
{
text += QString("Mobility 1/K0 range: [%1-%2]\n")
.arg(getParameterValue(
MsRunReadConfigParameter::
TimsFrameIonMobOneOverK0Begin)
.toDouble())
.arg(getParameterValue(
MsRunReadConfigParameter::
TimsFrameIonMobOneOverK0End)
.toDouble());
}
if(!getParameterValue(
MsRunReadConfigParameter::MzRangeBegin)
.isNull())
{
text += QString("m/z range: [%1-%2]\n")
.arg(getParameterValue(
MsRunReadConfigParameter::MzRangeBegin)
.toDouble())
.arg(getParameterValue(
MsRunReadConfigParameter::MzRangeEnd)
.toDouble());
}
if(!getParameterValue(
MsRunReadConfigParameter::TimsFrameMzIndexMergeWindow)
.isNull())
{
text +=
QString("m/z merge window %1\n")
.arg(getParameterValue(MsRunReadConfigParameter::
TimsFrameMzIndexMergeWindow)
.toUInt());
}
return text;
}
pappso::MsRunReadConfig::getParameterValue
const QVariant getParameterValue(MsRunReadConfigParameter parameter) const
Definition msrunreadconfig.cpp:196
pappso::QualifiedMassSpectrumParameter::TimsFrameIonMobScanIndexBegin
@ TimsFrameIonMobScanIndexBegin
pappso::QualifiedMassSpectrumParameter::TimsFrameIonMobScanIndexEnd
@ TimsFrameIonMobScanIndexEnd
pappso::MsRunReadConfigParameter
MsRunReadConfigParameter
Definition msrunreadconfig.h:36
pappso::MsRunReadConfigParameter::MzRangeBegin
@ MzRangeBegin
pappso::MsRunReadConfigParameter::TimsFrameIonMobOneOverK0Begin
@ TimsFrameIonMobOneOverK0Begin
pappso::MsRunReadConfigParameter::TimsFrameIonMobOneOverK0End
@ TimsFrameIonMobOneOverK0End
pappso::MsRunReadConfigParameter::TimsFrameIonMobScanIndexBegin
@ TimsFrameIonMobScanIndexBegin
pappso::MsRunReadConfigParameter::TimsFrameMzIndexMergeWindow
@ TimsFrameMzIndexMergeWindow
pappso::MsRunReadConfigParameter::MzRangeEnd
@ MzRangeEnd

References getParameterValue(), m_msLevels, m_retentionTimeEndSeconds, m_retentionTimeStartSeconds, pappso::MAX_MS_LEVELS, pappso::MzRangeBegin, pappso::MzRangeEnd, pappso::TimsFrameIonMobOneOverK0Begin, pappso::TimsFrameIonMobOneOverK0End, pappso::TimsFrameIonMobScanIndexBegin, pappso::TimsFrameIonMobScanIndexEnd, and pappso::TimsFrameMzIndexMergeWindow.

Referenced by pappso::TimsMsRunReader::readSpectrumCollection2().

## Member Data Documentation

## m_isPeakListNeeded

bool pappso::MsRunReadConfig::m_isPeakListNeeded = true

private

Definition at line 100 of file msrunreadconfig.h.

Referenced by needPeakList(), reset(), and setNeedPeakList().

## m_msLevels

bool pappso::MsRunReadConfig::m_msLevels[MAX_MS_LEVELS] = {false}

private

Definition at line 105 of file msrunreadconfig.h.

{false};

Referenced by MsRunReadConfig(), MsRunReadConfig(), acceptMsLevel(), getMsLevels(), getMsLevelsAsString(), operator=(), reset(), setMsLevels(), and toString().

## m_paramsMap

std::map<MsRunReadConfigParameter, QVariant> pappso::MsRunReadConfig::m_paramsMap

private

map containing any parameter value

Definition at line 110 of file msrunreadconfig.h.

Referenced by getParameterValue(), operator=(), reset(), and setParameterValue().

## m_retentionTimeEndSeconds

double pappso::MsRunReadConfig::m_retentionTimeEndSeconds = -1

private

Definition at line 98 of file msrunreadconfig.h.

Referenced by acceptRetentionTimeInSeconds(), getRetentionTimeEndInSeconds(), operator=(), reset(), setRetentionTimeEndInSeconds(), and toString().

## m_retentionTimeStartSeconds

double pappso::MsRunReadConfig::m_retentionTimeStartSeconds = -1

private

Definition at line 97 of file msrunreadconfig.h.

Referenced by acceptRetentionTimeInSeconds(), getRetentionTimeStartInSeconds(), operator=(), reset(), setRetentionTimeStartInSeconds(), and toString().

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

- pappsomspp/msrun/msrunreadconfig.h
- pappsomspp/msrun/msrunreadconfig.cpp