Loading...
Searching...
No Matches
sagefilereader.h
Go to the documentation of this file.
/**
* \file input/sage/sagefilereader.h
* \date 11/10/2024
* \author Olivier Langella
* \brief read data files from Sage output containin multiple samples
*/
/*******************************************************************************
* Copyright (c) 2024 Olivier Langella
*<Olivier.Langella@universite-paris-saclay.fr>.
*
* This file is part of i2MassChroQ.
*
* i2MassChroQ 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.
*
* i2MassChroQ 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 i2MassChroQ. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include "pappsomspp/export-import-config.h"
#include "pappsomspp/core/fasta/fastahandlerinterface.h"
#include "pappsomspp/core/processing/uimonitor/uimonitorinterface.h"
#include <QJsonDocument>
#include "pappsomspp/core/processing/cbor/cborstreamwriter.h"
#include <QFileInfo>
namespace pappso
{
namespace cbor
{
namespace psm
{
/**
* @todo write docs
*/
class PMSPP_LIB_DECL SageFileReader
{
public:
/** @brief main function to convert Sage results to CBOR output
*
* given the Sage JSON result file, this class reads the TSV output and convert the Sage PSMs to
* the PSMcbor format
* @param p_monitor pointer to monitor read progress
* @param p_output cbor output pointer
* @param sage_json_file Sage JSON result file
*/
SageFileReader(pappso::UiMonitorInterface *p_monitor,
pappso::cbor::CborStreamWriter *p_output,
const QFileInfo &sage_json_file);
/**
* Destructor
*/
virtual ~SageFileReader();
const QJsonDocument &getJsonDocument() const;
QString getMsRunSpWithFileName(const QString &msrun_filename) const;
private:
void readJson();
private:
const QFileInfo m_sageJsonFile;
QJsonDocument m_jsonData;
std::map<QString, QString> m_mapFilePath2MsRunSp;
QString m_sageVersion;
pappso::cbor::CborStreamWriter *mp_cborWriter;
QString m_decoyTag;
bool m_generateDecoy = false;
QStringList m_targetFastaFile;
};
} // namespace psm
} // namespace cbor
} // namespace pappso
cborstreamwriter.h
pappso::UiMonitorInterface
Definition uimonitorinterface.h:50
pappso::cbor::CborStreamWriter
overrides QCborStreamWriter base class to provide convenient functions
Definition cborstreamwriter.h:45
pappso::cbor::psm::SageFileReader::SageFileReader
SageFileReader(pappso::UiMonitorInterface *p_monitor, pappso::cbor::CborStreamWriter *p_output, const QFileInfo &sage_json_file)
main function to convert Sage results to CBOR output
Definition sagefilereader.cpp:46
pappso::cbor::psm::SageFileReader::m_mapFilePath2MsRunSp
std::map< QString, QString > m_mapFilePath2MsRunSp
Definition sagefilereader.h:77
pappso::cbor::psm::SageFileReader::mp_cborWriter
pappso::cbor::CborStreamWriter * mp_cborWriter
Definition sagefilereader.h:79
pappso::cbor::psm::SageFileReader::m_targetFastaFile
QStringList m_targetFastaFile
Definition sagefilereader.h:82
pappso::cbor::psm::SageFileReader::m_generateDecoy
bool m_generateDecoy
Definition sagefilereader.h:81
pappso::cbor::psm::SageFileReader::readJson
void readJson()
Definition sagefilereader.cpp:107
pappso::cbor::psm::SageFileReader::m_sageVersion
QString m_sageVersion
Definition sagefilereader.h:78
pappso::cbor::psm::SageFileReader::m_jsonData
QJsonDocument m_jsonData
Definition sagefilereader.h:75
pappso::cbor::psm::SageFileReader::m_decoyTag
QString m_decoyTag
Definition sagefilereader.h:80
pappso::cbor::psm::SageFileReader::getMsRunSpWithFileName
QString getMsRunSpWithFileName(const QString &msrun_filename) const
Definition sagefilereader.cpp:166
pappso::cbor::psm::SageFileReader::getJsonDocument
const QJsonDocument & getJsonDocument() const
Definition sagefilereader.cpp:159
pappso::cbor::psm::SageFileReader::m_sageJsonFile
const QFileInfo m_sageJsonFile
Definition sagefilereader.h:74
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
fastahandlerinterface.h
pappso::cbor::psm
Definition cborscanmapbase.h:40
pappso::cbor
Definition cborstreamreader.cpp:35
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
uimonitorinterface.h