libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
psmproteinmap.h
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/processing/cbor/psm/psmproteinmap.h
3
* \date 05/07/2025
4
* \author Olivier Langella
5
* \brief PAPPSO CBOR protein map
6
*/
7
8
/*******************************************************************************
9
* Copyright (c) 2025 Olivier Langella <Olivier.Langella@universite-paris-saclay.fr>.
10
*
11
* This file is part of PAPPSOms-tools.
12
*
13
* PAPPSOms-tools is free software: you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation, either version 3 of the License, or
16
* (at your option) any later version.
17
*
18
* PAPPSOms-tools is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
22
*
23
* You should have received a copy of the GNU General Public License
24
* along with PAPPSOms-tools. If not, see <http://www.gnu.org/licenses/>.
25
*
26
******************************************************************************/
27
#pragma once
28
29
#include "
pappsomspp/export-import-config.h
"
30
#include <map>
31
#include <QString>
32
#include "
pappsomspp/core/protein/protein.h
"
33
#include "
pappsomspp/core/processing/cbor/cborstreamwriter.h
"
34
#include "
pappsomspp/core/processing/cbor/cborstreamreader.h
"
35
36
37
namespace
pappso
38
{
39
namespace
cbor
40
{
41
namespace
psm
42
{
43
44
45
struct
PsmProtein
46
{
47
std::shared_ptr<Protein>
protein_sp
=
nullptr
;
48
bool
isTarget
=
true
;
49
bool
isContaminant
=
false
;
50
QCborMap
cborEval
;
51
};
52
/** @brief store PsmProtein in a map with accession as key
53
*
54
*/
55
class
PMSPP_LIB_DECL
PsmProteinMap
56
{
57
public
:
58
/**
59
* Default constructor
60
*/
61
PsmProteinMap
();
62
63
/**
64
* Destructor
65
*/
66
virtual
~PsmProteinMap
();
67
68
69
/** @brief standard map insert of a PsmProtein (accession is the key)
70
*
71
* @return standard C++ insert iterator on a map
72
*/
73
std::pair<std::map<QString, PsmProtein>::iterator,
bool
> insert(
const
PsmProtein
&psm_protein);
74
75
/** @brief writes the protein map in a cbor output stream
76
* this output a CborMap structure directly in the output stream
77
*
78
* @param writer the cbor output stream
79
*/
80
void
writeMap(
CborStreamWriter
&writer)
const
;
81
82
83
/** @brief reads the protein map from a cbor input stream
84
*
85
* @param reader the cbor intput stream
86
*/
87
void
readMap(
CborStreamReader
&reader);
88
89
/** @brief get protein map size
90
*/
91
std::size_t size()
const
;
92
93
94
/** @brief retrieve a PsmProtein with its accession
95
* @return PsmProtein const reference
96
*/
97
const
pappso::cbor::psm::PsmProtein
&getByAccession(
const
QString &accession)
const
;
98
99
100
/** @brief merge with other protein map
101
*/
102
void
merge(
const
PsmProteinMap
&other_protein_map);
103
104
/** @brief reduce to protein accessions listed in input
105
*/
106
void
reduce(
const
QStringList &accession_list);
107
108
std::map<QString, PsmProtein> &getProteinMap();
109
110
private
:
111
std::map<QString, PsmProtein>
m_proteinMap
;
112
};
113
}
// namespace psm
114
}
// namespace cbor
115
}
// namespace pappso
cborstreamreader.h
cborstreamwriter.h
pappso::cbor::CborStreamReader
simple override of the raw QCborStreamReader This adds convenient functions to put CBOR data into C++...
Definition
cborstreamreader.h:46
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::PsmProteinMap::m_proteinMap
std::map< QString, PsmProtein > m_proteinMap
Definition
psmproteinmap.h:111
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
protein.h
pappso::cbor::psm::PsmProtein
Definition
psmproteinmap.h:46
pappso::cbor::psm::PsmProtein::cborEval
QCborMap cborEval
Definition
psmproteinmap.h:50
pappso::cbor::psm::PsmProtein::isTarget
bool isTarget
Definition
psmproteinmap.h:48
pappso::cbor::psm::PsmProtein::isContaminant
bool isContaminant
Definition
psmproteinmap.h:49
pappso::cbor::psm::PsmProtein::protein_sp
std::shared_ptr< Protein > protein_sp
Definition
psmproteinmap.h:47
pappsomspp
core
processing
cbor
psm
psmproteinmap.h
Generated on Tue May 19 2026 12:52:14 for libpappsomspp by
1.9.8