libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
projectparameters.h
Go to the documentation of this file.
1/**
2 * \file pappsomspp/processing/project/projectparameters.h
3 * \date 16/03/2024
4 * \author Olivier Langella
5 * \brief simple structure to store project parameters (identification,
6 * filtering, quantification)
7 */
8
9/*******************************************************************************
10 * Copyright (c) 2022 Olivier Langella
11 *<Olivier.Langella@universite-paris-saclay.fr>.
12 *
13 * This file is part of i2MassChroQ.
14 *
15 * i2MassChroQ is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * i2MassChroQ is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with i2MassChroQ. If not, see <http://www.gnu.org/licenses/>.
27 *
28 ******************************************************************************/
29#pragma once
30
31#include <QString>
32#include <QVariant>
33#include <odsstream/calcwriterinterface.h>
34#include <QCborStreamWriter>
35#include <QJsonObject>
37
38
39namespace pappso
40{
41/** \def ProjectParamCategory parameter category
42 */
43enum class ProjectParamCategory : std::int8_t
44{
45 undefined = 0, ///< undefined
46 general = 1, ///< concerning the whole process
47 identification = 2, ///< concerning identification
48 filter = 3, ///< concerning filters (psm, peptide, protein validation)
49 quantification = 4, ///< quantification
50 instrument = 5, ///< information about instrument
51};
52
54{
55 QJsonObject toJsonObject() const;
56
58 QString name;
59 QVariant value;
60};
61
62/**
63 * @todo write docs
64 */
66{
67 public:
68 /**
69 * Default constructor
70 */
72
73 ProjectParameters(const QJsonObject &json_parameters);
74
75 /**
76 * Copy constructor
77 *
78 * @param other TODO
79 */
81
82 /**
83 * Destructor
84 */
86
88
89 void writeParameters(CalcWriterInterface &writer) const;
90
91 void writeParameters(QXmlStreamWriter &xml_writer) const;
92
93 void writeParameters(QCborStreamWriter &cbor_writer) const;
94
95
96 const QVariant getValue(ProjectParamCategory category, const QString &name) const;
97 void setProjectParam(const ProjectParam &param);
98 void merge(const ProjectParameters &parameters);
99
100 std::size_t size() const;
101
102
103 std::vector<ProjectParam> getProjectParamListByCategory(ProjectParamCategory category) const;
104
105 QJsonObject toJsonObject() const;
106
107 private:
108 void writeCellVariant(CalcWriterInterface &writer, const QVariant &var) const;
109
110 void writeXmlParameter(QXmlStreamWriter &writer, const ProjectParam &param) const;
111 void writeXmlVariant(QXmlStreamWriter &writer, const QVariant &var) const;
112
113
114 private:
115 std::map<QString, ProjectParam> m_mapGeneralParameters;
116 std::map<QString, ProjectParam> m_mapIdentificationParameters;
117 std::map<QString, ProjectParam> m_mapFilterParameters;
118 std::map<QString, ProjectParam> m_mapQuantificationParameters;
119 std::map<QString, ProjectParam> m_mapInstrumentParameters;
120};
121
122} // namespace pappso
void writeCellVariant(CalcWriterInterface &writer, const QVariant &var) const
std::map< QString, ProjectParam > m_mapQuantificationParameters
std::map< QString, ProjectParam > m_mapIdentificationParameters
ProjectParameters & operator=(const ProjectParameters &other)
std::map< QString, ProjectParam > m_mapGeneralParameters
void writeXmlVariant(QXmlStreamWriter &writer, const QVariant &var) const
void writeXmlParameter(QXmlStreamWriter &writer, const ProjectParam &param) const
std::map< QString, ProjectParam > m_mapFilterParameters
void setProjectParam(const ProjectParam &param)
std::map< QString, ProjectParam > m_mapInstrumentParameters
QJsonObject toJsonObject() const
std::vector< ProjectParam > getProjectParamListByCategory(ProjectParamCategory category) const
const QVariant getValue(ProjectParamCategory category, const QString &name) const
void merge(const ProjectParameters &parameters)
void writeParameters(CalcWriterInterface &writer) const
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
@ identification
concerning identification
@ instrument
information about instrument
@ general
concerning the whole process
@ filter
concerning filters (psm, peptide, protein validation)
ProjectParamCategory category
QJsonObject toJsonObject() const