Loading...
Searching...
No Matches
msrunreadconfig.h
Go to the documentation of this file.
/*******************************************************************************
* Copyright (c) 2023 Filippo Rusconi
*<filippo.rusconi@universite-paris-saclay.fr>.
*
* This file is part of the PAPPSOms++ library.
*
* PAPPSOms++ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PAPPSOms++ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include <map>
#include <QVariant>
#include "pappsomspp/export-import-config.h"
namespace pappso
{
/** \def MsRunReadConfigParameters specific parameters for MsRunReadConfig
*
*/
enum class MsRunReadConfigParameter
{
// Only process mobility scans contained in the
// scan index range below.
TimsFrameIonMobScanIndexBegin,
TimsFrameIonMobScanIndexEnd,
// Only process mobility scans contained in the
// inverse mobility range below.
TimsFrameIonMobOneOverK0Begin,
TimsFrameIonMobOneOverK0End,
// Only process mass spectra for m/z values contained
// in the following m/z range.
MzRangeBegin,
MzRangeEnd,
// Merge m/z (TOF, really) indices on the basis of this
// count of m/z (TOF, really) indices.
TimsFrameMzIndexMergeWindow,
};
// It is generally admitted that 11 is the max MS levels
// reachable using a Paul trap...
constexpr std::size_t MAX_MS_LEVELS = 12;
class PMSPP_LIB_DECL MsRunReadConfig
{
public:
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:
double m_retentionTimeStartSeconds = -1;
double m_retentionTimeEndSeconds = -1;
bool m_isPeakListNeeded = true;
// Initialize the ms levels to false.
// Each index in the array contains a bool value indicating, if true, a
// requested MS level.
bool m_msLevels[MAX_MS_LEVELS] = {false};
// Fixme: maybe we should initialize in the constructor the MS level 1 to
// true?
//! map containing any parameter value
std::map<MsRunReadConfigParameter, QVariant> m_paramsMap;
};
} // namespace pappso
pappso::MsRunReadConfig::needPeakList
bool needPeakList() const
Definition msrunreadconfig.cpp:167
pappso::MsRunReadConfig::getRetentionTimeEndInSeconds
double getRetentionTimeEndInSeconds() const
Definition msrunreadconfig.cpp:83
pappso::MsRunReadConfig::m_retentionTimeStartSeconds
double m_retentionTimeStartSeconds
Definition msrunreadconfig.h:97
pappso::MsRunReadConfig::m_msLevels
bool m_msLevels[MAX_MS_LEVELS]
Definition msrunreadconfig.h:105
pappso::MsRunReadConfig::operator=
MsRunReadConfig & operator=(const MsRunReadConfig &other)
Definition msrunreadconfig.cpp:49
pappso::MsRunReadConfig::toString
QString toString() const
Definition msrunreadconfig.cpp:225
pappso::MsRunReadConfig::m_retentionTimeEndSeconds
double m_retentionTimeEndSeconds
Definition msrunreadconfig.h:98
pappso::MsRunReadConfig::setNeedPeakList
void setNeedPeakList(bool need_peak_list)
Definition msrunreadconfig.cpp:173
pappso::MsRunReadConfig::setRetentionTimeStartInSeconds
void setRetentionTimeStartInSeconds(double retention_time_start_in_seconds)
Definition msrunreadconfig.cpp:65
pappso::MsRunReadConfig::getParameterValue
const QVariant getParameterValue(MsRunReadConfigParameter parameter) const
Definition msrunreadconfig.cpp:192
pappso::MsRunReadConfig::acceptMsLevel
bool acceptMsLevel(std::size_t ms_level) const
Definition msrunreadconfig.cpp:133
pappso::MsRunReadConfig::acceptRetentionTimeInSeconds
bool acceptRetentionTimeInSeconds(double retention_time_in_seconds) const
Definition msrunreadconfig.cpp:142
pappso::MsRunReadConfig::m_isPeakListNeeded
bool m_isPeakListNeeded
Definition msrunreadconfig.h:100
pappso::MsRunReadConfig::m_paramsMap
std::map< MsRunReadConfigParameter, QVariant > m_paramsMap
map containing any parameter value
Definition msrunreadconfig.h:110
pappso::MsRunReadConfig::reset
void reset()
Definition msrunreadconfig.cpp:207
pappso::MsRunReadConfig::getRetentionTimeStartInSeconds
double getRetentionTimeStartInSeconds() const
Definition msrunreadconfig.cpp:71
pappso::MsRunReadConfig::MsRunReadConfig
MsRunReadConfig()
Definition msrunreadconfig.cpp:28
pappso::MsRunReadConfig::setMsLevels
void setMsLevels(std::vector< std::size_t > ms_levels)
Definition msrunreadconfig.cpp:89
pappso::MsRunReadConfig::setRetentionTimeEndInSeconds
void setRetentionTimeEndInSeconds(double retention_time_end_in_seconds)
Definition msrunreadconfig.cpp:77
pappso::MsRunReadConfig::getMsLevelsAsString
QString getMsLevelsAsString() const
Definition msrunreadconfig.cpp:118
pappso::MsRunReadConfig::getMsLevels
const bool * getMsLevels() const
Definition msrunreadconfig.cpp:112
pappso::MsRunReadConfig::setParameterValue
void setParameterValue(MsRunReadConfigParameter parameter, const QVariant &value)
Definition msrunreadconfig.cpp:179
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::QualifiedMassSpectrumParameter::TimsFrameIonMobScanIndexBegin
@ TimsFrameIonMobScanIndexBegin
Definition qualifiedmassspectrum.h:55
pappso::QualifiedMassSpectrumParameter::TimsFrameIonMobScanIndexEnd
@ TimsFrameIonMobScanIndexEnd
Definition qualifiedmassspectrum.h:56
pappso::MAX_MS_LEVELS
constexpr std::size_t MAX_MS_LEVELS
Definition msrunreadconfig.h:59
pappso::MsRunReadConfigParameter
MsRunReadConfigParameter
Definition msrunreadconfig.h:36
pappso::MsRunReadConfigParameter::MzRangeBegin
@ MzRangeBegin
Definition msrunreadconfig.h:49
pappso::MsRunReadConfigParameter::TimsFrameIonMobOneOverK0Begin
@ TimsFrameIonMobOneOverK0Begin
Definition msrunreadconfig.h:44
pappso::MsRunReadConfigParameter::TimsFrameIonMobOneOverK0End
@ TimsFrameIonMobOneOverK0End
Definition msrunreadconfig.h:45
pappso::MsRunReadConfigParameter::TimsFrameMzIndexMergeWindow
@ TimsFrameMzIndexMergeWindow
Definition msrunreadconfig.h:54
pappso::MsRunReadConfigParameter::MzRangeEnd
@ MzRangeEnd
Definition msrunreadconfig.h:50