Loading...
Searching...
No Matches
jsoninput.h
Go to the documentation of this file.
/**
* \file pappsomspp/masschroq/input/jsoninput.h
* \date 02/01/2025
* \author Olivier Langella
* \brief process json document input
*/
/*******************************************************************************
* Copyright (c) 2025 Olivier Langella
*<Olivier.Langella@universite-paris-saclay.fr>.
*
* This file is part of MassChroQ.
*
* MassChroQ 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.
*
* MassChroQ 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 MassChroQ. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include "pappsomspp/core/processing/uimonitor/uimonitorinterface.h"
#include "pappsomspp/core/processing/project/projectparameters.h"
#include <QJsonDocument>
#include "../output/cboroutputstream.h"
#include "../msrungroup.h"
#include "pappsomspp/export-import-config.h"
namespace pappso::masschroq
{
/**
* @todo write docs
*/
class PMSPP_LIB_DECL JsonInput
{
public:
/**
* Default constructor
*/
JsonInput(pappso::UiMonitorInterface &ui_monitor,
const QString &tmp_dir_name,
const QJsonDocument &json_doc);
/**
* Destructor
*/
~JsonInput();
void action(CborOutputStream &cbor_output);
private:
const QJsonValue documentFind(const QString &key1, const QString &key2) const;
void readMzDataFiles();
void readAlignmentMethodSp();
void readQuantificationMethodSp();
void readProjectParameters();
void read_protein_list();
void read_peptide_list();
void read_msrun_peptide_observations();
void readAction(CborOutputStream &cbor_output);
void computeIsotopologues(double ni_ratio);
private:
const QJsonDocument &m_jsonDocument;
const QString &m_tmpDirName;
pappso::UiMonitorInterface &m_uiMonitor;
std::map<QString, MsRunPeptideListSp> m_msfileList;
AlignmentMethodSp msp_alignmentMethod;
QuantificationMethodSp msp_quantificationMethod;
std::map<QString, ProteinSp> m_proteinMap;
std::vector<PeptideSp> m_peptideStore;
std::map<QString, PeptideSp> m_peptideMap;
std::map<QString, MsRunGroupSp> m_msRunGroupSpList;
std::shared_ptr<pappso::IonMobilityGrid> msp_ionMobilityGrid;
pappso::ProjectParameters m_projectParameters;
bool m_isMatchBetweenRun = true;
};
} // namespace pappso::masschroq
cboroutputstream.h
pappso::ProjectParameters
Definition projectparameters.h:66
pappso::UiMonitorInterface
Definition uimonitorinterface.h:50
pappso::masschroq::CborOutputStream
Definition cboroutputstream.h:51
pappso::masschroq::JsonInput::m_jsonDocument
const QJsonDocument & m_jsonDocument
Definition jsoninput.h:77
pappso::masschroq::JsonInput::readProjectParameters
void readProjectParameters()
Definition jsoninput.cpp:593
pappso::masschroq::JsonInput::m_peptideStore
std::vector< PeptideSp > m_peptideStore
Definition jsoninput.h:86
pappso::masschroq::JsonInput::m_msRunGroupSpList
std::map< QString, MsRunGroupSp > m_msRunGroupSpList
Definition jsoninput.h:88
pappso::masschroq::JsonInput::m_tmpDirName
const QString & m_tmpDirName
Definition jsoninput.h:78
pappso::masschroq::JsonInput::read_peptide_list
void read_peptide_list()
Definition jsoninput.cpp:304
pappso::masschroq::JsonInput::m_uiMonitor
pappso::UiMonitorInterface & m_uiMonitor
Definition jsoninput.h:79
pappso::masschroq::JsonInput::computeIsotopologues
void computeIsotopologues(double ni_ratio)
Definition jsoninput.cpp:468
pappso::masschroq::JsonInput::readQuantificationMethodSp
void readQuantificationMethodSp()
Definition jsoninput.cpp:247
pappso::masschroq::JsonInput::read_protein_list
void read_protein_list()
Definition jsoninput.cpp:271
pappso::masschroq::JsonInput::m_peptideMap
std::map< QString, PeptideSp > m_peptideMap
Definition jsoninput.h:87
pappso::masschroq::JsonInput::readAlignmentMethodSp
void readAlignmentMethodSp()
Definition jsoninput.cpp:238
pappso::masschroq::JsonInput::readAction
void readAction(CborOutputStream &cbor_output)
Definition jsoninput.cpp:493
pappso::masschroq::JsonInput::m_proteinMap
std::map< QString, ProteinSp > m_proteinMap
Definition jsoninput.h:85
pappso::masschroq::JsonInput::m_projectParameters
pappso::ProjectParameters m_projectParameters
Definition jsoninput.h:92
pappso::masschroq::JsonInput::JsonInput
JsonInput(pappso::UiMonitorInterface &ui_monitor, const QString &tmp_dir_name, const QJsonDocument &json_doc)
Definition jsoninput.cpp:40
pappso::masschroq::JsonInput::msp_alignmentMethod
AlignmentMethodSp msp_alignmentMethod
Definition jsoninput.h:83
pappso::masschroq::JsonInput::m_isMatchBetweenRun
bool m_isMatchBetweenRun
Definition jsoninput.h:94
pappso::masschroq::JsonInput::msp_quantificationMethod
QuantificationMethodSp msp_quantificationMethod
Definition jsoninput.h:84
pappso::masschroq::JsonInput::action
void action(CborOutputStream &cbor_output)
Definition jsoninput.cpp:52
pappso::masschroq::JsonInput::m_msfileList
std::map< QString, MsRunPeptideListSp > m_msfileList
Definition jsoninput.h:82
pappso::masschroq::JsonInput::documentFind
const QJsonValue documentFind(const QString &key1, const QString &key2) const
Definition jsoninput.cpp:109
pappso::masschroq::JsonInput::readMzDataFiles
void readMzDataFiles()
Definition jsoninput.cpp:135
pappso::masschroq::JsonInput::msp_ionMobilityGrid
std::shared_ptr< pappso::IonMobilityGrid > msp_ionMobilityGrid
Definition jsoninput.h:90
pappso::masschroq::JsonInput::read_msrun_peptide_observations
void read_msrun_peptide_observations()
Definition jsoninput.cpp:371
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
msrungroup.h
pappso::masschroq
Definition alignmentmethod.h:38
pappso::masschroq::QuantificationMethodSp
std::shared_ptr< QuantificationMethod > QuantificationMethodSp
Definition quantificationmethod.h:46
pappso::masschroq::AlignmentMethodSp
std::shared_ptr< AlignmentMethod > AlignmentMethodSp
Definition alignmentmethod.h:42
projectparameters.h
uimonitorinterface.h