libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::MsRunReadConfig Class Reference

#include <msrunreadconfig.h>

Public Member Functions

 MsRunReadConfig ()
 MsRunReadConfig (const MsRunReadConfig &other)
 ~MsRunReadConfig ()
MsRunReadConfigoperator= (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.

29{
30 // Set these two levels to true by default.
31 m_msLevels[1] = true;
32 m_msLevels[2] = true;
33}
bool m_msLevels[MAX_MS_LEVELS]

References m_msLevels.

Referenced by MsRunReadConfig(), and operator=().

◆ MsRunReadConfig() [2/2]

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

Definition at line 35 of file msrunreadconfig.cpp.

36 : m_retentionTimeStartSeconds(other.m_retentionTimeStartSeconds),
37 m_retentionTimeEndSeconds(other.m_retentionTimeEndSeconds),
38 m_paramsMap(other.m_paramsMap)
39{
40 for(std::size_t index = 0; index < MAX_MS_LEVELS; ++index)
41 m_msLevels[index] = other.m_msLevels[index];
42}
std::map< MsRunReadConfigParameter, QVariant > m_paramsMap
map containing any parameter value
constexpr std::size_t MAX_MS_LEVELS

References MsRunReadConfig(), m_msLevels, m_paramsMap, m_retentionTimeEndSeconds, m_retentionTimeStartSeconds, and pappso::MAX_MS_LEVELS.

◆ ~MsRunReadConfig()

pappso::MsRunReadConfig::~MsRunReadConfig ( )

Definition at line 44 of file msrunreadconfig.cpp.

45{
46}

Member Function Documentation

◆ acceptMsLevel()

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

◆ acceptRetentionTimeInSeconds()

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

Definition at line 142 of file msrunreadconfig.cpp.

143{
144 // qDebug() << "Requested retention_time_in_seconds:"
145 // << retention_time_in_seconds;
146
147 // Whatever the member datum below, if it is equal to -1
148 // then that means that RT is not a selection criterion.
150 {
151 return true;
152 }
153
154 // We use inclusive RT ranges.
155 if(retention_time_in_seconds >= m_retentionTimeStartSeconds)
156 {
157 if(retention_time_in_seconds <= m_retentionTimeEndSeconds)
158 {
159 return true;
160 }
161 }
162
163 return false;
164}

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 112 of file msrunreadconfig.cpp.

113{
114 return m_msLevels;
115}

References m_msLevels.

◆ getMsLevelsAsString()

QString pappso::MsRunReadConfig::getMsLevelsAsString ( ) const

Definition at line 118 of file msrunreadconfig.cpp.

119{
120 QString text = "";
121
122 for(std::size_t index = 0; index < MAX_MS_LEVELS; ++index)
123 {
124 if(m_msLevels[index] == true)
125 text += QString("%1 ").arg(index);
126 }
127
128 return text;
129}

References m_msLevels, and pappso::MAX_MS_LEVELS.

◆ getParameterValue()

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

Definition at line 192 of file msrunreadconfig.cpp.

193{
194 auto it = m_paramsMap.find(parameter);
195 if(it == m_paramsMap.end())
196 {
197 return QVariant();
198 }
199 else
200 {
201 return it->second;
202 }
203}

References m_paramsMap.

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

◆ getRetentionTimeEndInSeconds()

double pappso::MsRunReadConfig::getRetentionTimeEndInSeconds ( ) const

Definition at line 83 of file msrunreadconfig.cpp.

84{
86}

References m_retentionTimeEndSeconds.

◆ getRetentionTimeStartInSeconds()

double pappso::MsRunReadConfig::getRetentionTimeStartInSeconds ( ) const

Definition at line 71 of file msrunreadconfig.cpp.

72{
74}

References m_retentionTimeStartSeconds.

◆ needPeakList()

◆ operator=()

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

Definition at line 49 of file msrunreadconfig.cpp.

50{
51 if(&other == this)
52 return *this;
53
54 m_retentionTimeStartSeconds = other.m_retentionTimeStartSeconds;
55 m_retentionTimeEndSeconds = other.m_retentionTimeEndSeconds;
56 m_paramsMap = other.m_paramsMap;
57
58 for(std::size_t index = 0; index < MAX_MS_LEVELS; ++index)
59 m_msLevels[index] = other.m_msLevels[index];
60
61 return *this;
62}

References MsRunReadConfig(), m_msLevels, m_paramsMap, m_retentionTimeEndSeconds, m_retentionTimeStartSeconds, and pappso::MAX_MS_LEVELS.

◆ reset()

void pappso::MsRunReadConfig::reset ( )

Definition at line 207 of file msrunreadconfig.cpp.

208{
211 m_isPeakListNeeded = true;
212
213 for(std::size_t index = 0; index < MAX_MS_LEVELS; ++index)
214 {
215 m_msLevels[index] = false;
216 }
217 // Set these two levels to true by default.
218 m_msLevels[1] = true;
219 m_msLevels[2] = true;
220
221 m_paramsMap.clear();
222}

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 89 of file msrunreadconfig.cpp.

90{
91 // First reset all the levels to false, this time, since we'll fill the array
92 // with explicit values.
93 for(std::size_t index = 0; index < MAX_MS_LEVELS; ++index)
94 m_msLevels[index] = false;
95
96 // And now actually fill with true values the proper array cells.
97 for(auto ms_level : ms_levels)
98 {
99 if(ms_level >= MAX_MS_LEVELS)
100 {
101 qDebug() << "The passed vector of MS levels holds a value that is "
102 "not correct:"
103 << ms_level << ": skipping it.";
104
105 continue;
106 }
107 m_msLevels[ms_level] = true;
108 }
109}

References m_msLevels, and pappso::MAX_MS_LEVELS.

Referenced by pappso::masschroq::MsRun::MsRun(), pappso::MsRunXicExtractor::MsRunXicExtractor(), pappso::MsRunReader::getRetentionTimeLine(), pappso::MsRunReader::getTicChromatogram(), pappso::MzcborMsRunReader::readSpectrumCollection(), pappso::MzcborMsRunReader::readSpectrumCollectionByMsLevel(), pappso::MsRunReader::scanNumber2SpectrumIndex(), and pappso::MzxmlOutput::write().

◆ setNeedPeakList()

◆ setParameterValue()

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

Definition at line 179 of file msrunreadconfig.cpp.

181{
182
183 auto ret = m_paramsMap.insert(std::pair<MsRunReadConfigParameter, QVariant>(parameter, value));
184
185 if(ret.second == false)
186 {
187 ret.first->second = value;
188 }
189}

References m_paramsMap.

◆ setRetentionTimeEndInSeconds()

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

Definition at line 77 of file msrunreadconfig.cpp.

78{
79 m_retentionTimeEndSeconds = retention_time_end_in_seconds;
80}

References m_retentionTimeEndSeconds.

◆ setRetentionTimeStartInSeconds()

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

Definition at line 65 of file msrunreadconfig.cpp.

66{
67 m_retentionTimeStartSeconds = retention_time_start_in_seconds;
68}

References m_retentionTimeStartSeconds.

◆ toString()

QString pappso::MsRunReadConfig::toString ( ) const

Definition at line 225 of file msrunreadconfig.cpp.

226{
227 QString text = QString("MsRunReadConfig\n: RT start: %1, RT end: %2\n")
230
231 text += "MS level(s): ";
232
233 for(std::size_t index = 0; index < MAX_MS_LEVELS; ++index)
234 {
235 if(m_msLevels[index] == true)
236 text += QString("%1 ").arg(index);
237 }
238
239 text += " \n";
240
242 {
243 text +=
244 QString("Mobility index range: [%1-%2]\n")
247 }
248
250 {
251 text +=
252 QString("Mobility 1/K0 range: [%1-%2]\n")
253 .arg(
256 }
257
259 {
260 text += QString("m/z range: [%1-%2]\n")
263 }
264
266 {
267 text +=
268 QString("m/z merge window %1\n")
270 }
271
272 return text;
273}
const QVariant getParameterValue(MsRunReadConfigParameter parameter) const

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

◆ 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 MsRunReadConfig(), getParameterValue(), operator=(), reset(), and setParameterValue().

◆ m_retentionTimeEndSeconds

double pappso::MsRunReadConfig::m_retentionTimeEndSeconds = -1
private

◆ m_retentionTimeStartSeconds

double pappso::MsRunReadConfig::m_retentionTimeStartSeconds = -1
private

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