Loading...
Searching...
No Matches
sagereader.h
Go to the documentation of this file.
/**
* \file input/sage/sagereader.h
* \date 21/08/2024
* \author Olivier Langella
* \brief read data files from Sage output
*/
/*******************************************************************************
* 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 "../../../../fasta/fastahandlerinterface.h"
#include "../../../../amino_acid/aamodification.h"
#include "sagefilereader.h"
#include "../psmproteinmap.h"
namespace pappso::cbor::psm
{
/**
* @todo write docs
*/
class SageReader
{
public:
/**
* Default constructor
*/
SageReader(pappso::UiMonitorInterface *p_monitor,
pappso::cbor::CborStreamWriter *p_output,
const SageFileReader &sage_file_reader,
const QString &sage_json_file);
void read();
/**
* Destructor
*/
virtual ~SageReader();
struct SageModification
{
pappso::AaModificationP modification;
QChar residue;
QString strModification;
};
std::vector<SageModification> getStaticModificationList() const;
std::vector<SageModification> getVariableModificationList() const;
QString getDecoyTag() const;
const SageFileReader &getSageFileReader() const;
pappso::cbor::CborStreamWriter &getCborStreamWriter() const;
const QString &getmJsonAbsoluteFilePath() const;
const QString &getMzmlPath(const QString &file_msrun) const;
private:
void readTsvFile();
void extractMzmlPathList(const QJsonDocument &json_doc);
QString getTsvFilePath(const QJsonDocument &json_doc);
QString getFastaFilePath(const QJsonDocument &json_doc);
QString convertToLocalFileOrDie(const QString &file_str) const;
class FastaSeq : public pappso::FastaHandlerInterface
{
public:
FastaSeq(SageReader *self);
void setSequence(const QString &description_in, const QString &sequence_in) override;
private:
SageReader *mp_self;
QString m_decoyTag;
};
private:
const SageFileReader &m_sageFileReader;
pappso::UiMonitorInterface *mp_monitor;
pappso::cbor::CborStreamWriter *mp_cborWriter;
PsmProteinMap m_psmProteinMap;
QString m_jsonAbsoluteFilePath;
QStringList m_mzmlPathList;
};
} // namespace pappso::cbor::psm
aamodification.h
pappso::FastaHandlerInterface
Definition fastahandlerinterface.h:32
pappso::UiMonitorInterface
Definition uimonitorinterface.h:50
pappso::cbor::CborStreamWriter
overrides QCborStreamWriter base class to provide convenient functions
Definition cborstreamwriter.h:45
pappso::cbor::psm::PsmProteinMap
store PsmProtein in a map with accession as key
Definition psmproteinmap.h:56
pappso::cbor::psm::SageFileReader
Definition sagefilereader.h:48
pappso::cbor::psm::SageReader::FastaSeq::mp_self
SageReader * mp_self
Definition sagereader.h:93
pappso::cbor::psm::SageReader::FastaSeq::setSequence
void setSequence(const QString &description_in, const QString &sequence_in) override
Definition sagereader.cpp:80
pappso::cbor::psm::SageReader::FastaSeq::m_decoyTag
QString m_decoyTag
Definition sagereader.h:94
pappso::cbor::psm::SageReader::FastaSeq::FastaSeq
FastaSeq(SageReader *self)
Definition sagereader.cpp:73
pappso::cbor::psm::SageReader::m_psmProteinMap
PsmProteinMap m_psmProteinMap
Definition sagereader.h:101
pappso::cbor::psm::SageReader::getMzmlPath
const QString & getMzmlPath(const QString &file_msrun) const
Definition sagereader.cpp:190
pappso::cbor::psm::SageReader::SageReader
SageReader(pappso::UiMonitorInterface *p_monitor, pappso::cbor::CborStreamWriter *p_output, const SageFileReader &sage_file_reader, const QString &sage_json_file)
Definition sagereader.cpp:45
pappso::cbor::psm::SageReader::getStaticModificationList
std::vector< SageModification > getStaticModificationList() const
Definition sagereader.cpp:279
pappso::cbor::psm::SageReader::readTsvFile
void readTsvFile()
Definition sagereader.cpp:120
pappso::cbor::psm::SageReader::m_mzmlPathList
QStringList m_mzmlPathList
Definition sagereader.h:103
pappso::cbor::psm::SageReader::mp_cborWriter
pappso::cbor::CborStreamWriter * mp_cborWriter
Definition sagereader.h:100
pappso::cbor::psm::SageReader::getmJsonAbsoluteFilePath
const QString & getmJsonAbsoluteFilePath() const
Definition sagereader.cpp:61
pappso::cbor::psm::SageReader::extractMzmlPathList
void extractMzmlPathList(const QJsonDocument &json_doc)
Definition sagereader.cpp:172
pappso::cbor::psm::SageReader::~SageReader
virtual ~SageReader()
Definition sagereader.cpp:56
pappso::cbor::psm::SageReader::getCborStreamWriter
pappso::cbor::CborStreamWriter & getCborStreamWriter() const
Definition sagereader.cpp:113
pappso::cbor::psm::SageReader::m_jsonAbsoluteFilePath
QString m_jsonAbsoluteFilePath
Definition sagereader.h:102
pappso::cbor::psm::SageReader::m_sageFileReader
const SageFileReader & m_sageFileReader
Definition sagereader.h:98
pappso::cbor::psm::SageReader::getVariableModificationList
std::vector< SageModification > getVariableModificationList() const
Definition sagereader.cpp:321
pappso::cbor::psm::SageReader::getFastaFilePath
QString getFastaFilePath(const QJsonDocument &json_doc)
Definition sagereader.cpp:232
pappso::cbor::psm::SageReader::getDecoyTag
QString getDecoyTag() const
Definition sagereader.cpp:364
pappso::cbor::psm::SageReader::getSageFileReader
const SageFileReader & getSageFileReader() const
Definition sagereader.cpp:382
pappso::cbor::psm::SageReader::getTsvFilePath
QString getTsvFilePath(const QJsonDocument &json_doc)
Definition sagereader.cpp:203
pappso::cbor::psm::SageReader::mp_monitor
pappso::UiMonitorInterface * mp_monitor
Definition sagereader.h:99
pappso::cbor::psm::SageReader::read
void read()
Definition sagereader.cpp:68
pappso::cbor::psm::SageReader::convertToLocalFileOrDie
QString convertToLocalFileOrDie(const QString &file_str) const
Definition sagereader.cpp:252
fastahandlerinterface.h
pappso::cbor::psm
Definition cborscanmapbase.h:40
pappso::AaModificationP
const AaModification * AaModificationP
Definition aamodification.h:52
psmproteinmap.h
sagefilereader.h
pappso::cbor::psm::SageReader::SageModification
Definition sagereader.h:60
pappso::cbor::psm::SageReader::SageModification::residue
QChar residue
Definition sagereader.h:62
pappso::cbor::psm::SageReader::SageModification::strModification
QString strModification
Definition sagereader.h:63
pappso::cbor::psm::SageReader::SageModification::modification
pappso::AaModificationP modification
Definition sagereader.h:61