libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
sagereader.h
Go to the documentation of this file.
1
/**
2
* \file input/sage/sagereader.h
3
* \date 21/08/2024
4
* \author Olivier Langella
5
* \brief read data files from Sage output
6
*/
7
8
/*******************************************************************************
9
* Copyright (c) 2024 Olivier Langella
10
*<Olivier.Langella@universite-paris-saclay.fr>.
11
*
12
* This file is part of i2MassChroQ.
13
*
14
* i2MassChroQ is free software: you can redistribute it and/or modify
15
* it under the terms of the GNU General Public License as published by
16
* the Free Software Foundation, either version 3 of the License, or
17
* (at your option) any later version.
18
*
19
* i2MassChroQ is distributed in the hope that it will be useful,
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
* GNU General Public License for more details.
23
*
24
* You should have received a copy of the GNU General Public License
25
* along with i2MassChroQ. If not, see <http://www.gnu.org/licenses/>.
26
*
27
******************************************************************************/
28
29
#pragma once
30
#include "
../../../../fasta/fastahandlerinterface.h
"
31
#include "
../../../../amino_acid/aamodification.h
"
32
#include "
pappsomspp/core/types.h
"
33
#include "
sagefilereader.h
"
34
#include "
../psmproteinmap.h
"
35
36
37
namespace
pappso::cbor::psm
38
{
39
/**
40
* @todo write docs
41
*/
42
class
SageReader
43
{
44
public
:
45
/**
46
* Default constructor
47
*/
48
SageReader
(
pappso::UiMonitorInterface
*p_monitor,
49
pappso::cbor::CborStreamWriter
*p_output,
50
const
SageFileReader
&sage_file_reader,
51
const
QString &sage_json_file);
52
53
void
read
();
54
/**
55
* Destructor
56
*/
57
virtual
~SageReader
();
58
59
60
struct
SageModification
61
{
62
SageModification
()
63
{
64
modification
=
nullptr
;
65
residue
= (
Enums::AminoAcidChar
)
' '
;
66
position
=
' '
;
67
strModification
=
""
;
68
};
69
SageModification
(
const
SageModification
&other)
70
{
71
modification
= other.
modification
;
72
position
= other.
position
;
73
residue
= other.
residue
;
74
strModification
= other.
strModification
;
75
};
76
pappso::AaModificationP
modification
;
77
QChar
position
;
//^, [,], $
78
Enums::AminoAcidChar
residue
;
79
QString
strModification
;
80
};
81
82
std::vector<SageModification>
getStaticModificationList
()
const
;
83
std::vector<SageModification>
getVariableModificationList
()
const
;
84
QString
getDecoyTag
()
const
;
85
86
const
SageFileReader
&
getSageFileReader
()
const
;
87
88
pappso::cbor::CborStreamWriter
&
getCborStreamWriter
()
const
;
89
90
const
QString &
getmJsonAbsoluteFilePath
()
const
;
91
92
const
QString &
getMzmlPath
(
const
QString &file_msrun)
const
;
93
94
private
:
95
void
readTsvFile
();
96
void
extractMzmlPathList
(
const
QJsonDocument &json_doc);
97
QString
getTsvFilePath
(
const
QJsonDocument &json_doc);
98
QString
getFastaFilePath
(
const
QJsonDocument &json_doc);
99
QString
convertToLocalFileOrDie
(
const
QString &file_str)
const
;
100
101
102
class
FastaSeq
:
public
pappso::FastaHandlerInterface
103
{
104
public
:
105
FastaSeq
(
SageReader
*self);
106
void
setSequence
(
const
QString &description_in,
const
QString &sequence_in)
override
;
107
108
private
:
109
SageReader
*
mp_self
;
110
QString
m_decoyTag
;
111
};
112
113
private
:
114
const
SageFileReader
&
m_sageFileReader
;
115
pappso::UiMonitorInterface
*
mp_monitor
;
116
pappso::cbor::CborStreamWriter
*
mp_cborWriter
;
117
PsmProteinMap
m_psmProteinMap
;
118
QString
m_jsonAbsoluteFilePath
;
119
QStringList
m_mzmlPathList
;
120
};
121
}
// 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:46
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:109
pappso::cbor::psm::SageReader::FastaSeq::setSequence
void setSequence(const QString &description_in, const QString &sequence_in) override
Definition
sagereader.cpp:82
pappso::cbor::psm::SageReader::FastaSeq::m_decoyTag
QString m_decoyTag
Definition
sagereader.h:110
pappso::cbor::psm::SageReader::FastaSeq::FastaSeq
FastaSeq(SageReader *self)
Definition
sagereader.cpp:75
pappso::cbor::psm::SageReader::m_psmProteinMap
PsmProteinMap m_psmProteinMap
Definition
sagereader.h:117
pappso::cbor::psm::SageReader::getMzmlPath
const QString & getMzmlPath(const QString &file_msrun) const
Definition
sagereader.cpp:192
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:47
pappso::cbor::psm::SageReader::getStaticModificationList
std::vector< SageModification > getStaticModificationList() const
Definition
sagereader.cpp:281
pappso::cbor::psm::SageReader::readTsvFile
void readTsvFile()
Definition
sagereader.cpp:122
pappso::cbor::psm::SageReader::m_mzmlPathList
QStringList m_mzmlPathList
Definition
sagereader.h:119
pappso::cbor::psm::SageReader::mp_cborWriter
pappso::cbor::CborStreamWriter * mp_cborWriter
Definition
sagereader.h:116
pappso::cbor::psm::SageReader::getmJsonAbsoluteFilePath
const QString & getmJsonAbsoluteFilePath() const
Definition
sagereader.cpp:63
pappso::cbor::psm::SageReader::extractMzmlPathList
void extractMzmlPathList(const QJsonDocument &json_doc)
Definition
sagereader.cpp:174
pappso::cbor::psm::SageReader::~SageReader
virtual ~SageReader()
Definition
sagereader.cpp:58
pappso::cbor::psm::SageReader::getCborStreamWriter
pappso::cbor::CborStreamWriter & getCborStreamWriter() const
Definition
sagereader.cpp:115
pappso::cbor::psm::SageReader::m_jsonAbsoluteFilePath
QString m_jsonAbsoluteFilePath
Definition
sagereader.h:118
pappso::cbor::psm::SageReader::m_sageFileReader
const SageFileReader & m_sageFileReader
Definition
sagereader.h:114
pappso::cbor::psm::SageReader::getVariableModificationList
std::vector< SageModification > getVariableModificationList() const
Definition
sagereader.cpp:322
pappso::cbor::psm::SageReader::getFastaFilePath
QString getFastaFilePath(const QJsonDocument &json_doc)
Definition
sagereader.cpp:234
pappso::cbor::psm::SageReader::getDecoyTag
QString getDecoyTag() const
Definition
sagereader.cpp:406
pappso::cbor::psm::SageReader::getSageFileReader
const SageFileReader & getSageFileReader() const
Definition
sagereader.cpp:424
pappso::cbor::psm::SageReader::getTsvFilePath
QString getTsvFilePath(const QJsonDocument &json_doc)
Definition
sagereader.cpp:205
pappso::cbor::psm::SageReader::mp_monitor
pappso::UiMonitorInterface * mp_monitor
Definition
sagereader.h:115
pappso::cbor::psm::SageReader::read
void read()
Definition
sagereader.cpp:70
pappso::cbor::psm::SageReader::convertToLocalFileOrDie
QString convertToLocalFileOrDie(const QString &file_str) const
Definition
sagereader.cpp:254
fastahandlerinterface.h
pappso::Enums::AminoAcidChar
AminoAcidChar
Definition
types.h:188
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::position
QChar position
Definition
sagereader.h:77
pappso::cbor::psm::SageReader::SageModification::SageModification
SageModification(const SageModification &other)
Definition
sagereader.h:69
pappso::cbor::psm::SageReader::SageModification::strModification
QString strModification
Definition
sagereader.h:79
pappso::cbor::psm::SageReader::SageModification::SageModification
SageModification()
Definition
sagereader.h:62
pappso::cbor::psm::SageReader::SageModification::modification
pappso::AaModificationP modification
Definition
sagereader.h:76
pappso::cbor::psm::SageReader::SageModification::residue
Enums::AminoAcidChar residue
Definition
sagereader.h:78
types.h
pappsomspp
core
processing
cbor
psm
sage
sagereader.h
Generated on
for libpappsomspp by
1.17.0