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 <map>
30#include <QString>
34
35
36namespace pappso
37{
38namespace cbor
39{
40namespace psm
41{
42
43
45{
46 std::shared_ptr<Protein> protein_sp = nullptr;
47 bool isTarget = true;
48 bool isContaminant = false;
49 QCborMap cborEval;
50};
51/** @brief store PsmProtein in a map with accession as key
52 *
53 */
55{
56 public:
57 /**
58 * Default constructor
59 */
61
62 /**
63 * Destructor
64 */
65 virtual ~PsmProteinMap();
66
67
68 /** @brief standard map insert of a PsmProtein (accession is the key)
69 *
70 * @return standard C++ insert iterator on a map
71 */
72 std::pair<std::map<QString, PsmProtein>::iterator, bool> insert(const PsmProtein &psm_protein);
73
74 /** @brief writes the protein map in a cbor output stream
75 * this output a CborMap structure directly in the output stream
76 *
77 * @param writer the cbor output stream
78 */
79 void writeMap(CborStreamWriter &writer) const;
80
81
82 /** @brief reads the protein map from a cbor input stream
83 *
84 * @param reader the cbor intput stream
85 */
86 void readMap(CborStreamReader &reader);
87
88 /** @brief get protein map size
89 */
90 std::size_t size() const;
91
92
93 /** @brief retrieve a PsmProtein with its accession
94 * @return PsmProtein const reference
95 */
96 const pappso::cbor::psm::PsmProtein &getByAccession(const QString &accession) const;
97
98
99 /** @brief merge with other protein map
100 */
101 void merge(const PsmProteinMap &other_protein_map);
102
103 /** @brief reduce to protein accessions listed in input
104 */
105 void reduce(const QStringList &accession_list);
106
107 std::map<QString, PsmProtein> &getProteinMap();
108
109 private:
110 std::map<QString, PsmProtein> m_proteinMap;
111};
112} // namespace psm
113} // namespace cbor
114} // namespace pappso
store PsmProtein in a map with accession as key
void reduce(const QStringList &accession_list)
reduce to protein accessions listed in input
std::size_t size() const
get protein map size
void merge(const PsmProteinMap &other_protein_map)
merge with other protein map
std::map< QString, PsmProtein > m_proteinMap
const pappso::cbor::psm::PsmProtein & getByAccession(const QString &accession) const
retrieve a PsmProtein with its accession
std::map< QString, PsmProtein > & getProteinMap()
std::pair< std::map< QString, PsmProtein >::iterator, bool > insert(const PsmProtein &psm_protein)
standard map insert of a PsmProtein (accession is the key)
void readMap(CborStreamReader &reader)
reads the protein map from a cbor input stream
void writeMap(CborStreamWriter &writer) const
writes the protein map in a cbor output stream this output a CborMap structure directly in the output...
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
std::shared_ptr< Protein > protein_sp