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>
32#include "../cborstreamwriter.h"
33#include "../cborstreamreader.h"
34
35
36namespace pappso::cbor::psm
37{
38
40{
41 std::shared_ptr<Protein> protein_sp = nullptr;
42 bool isTarget = true;
43 bool isContaminant = false;
44 QCborMap cborEval;
45};
46/**
47 * @todo write docs
48 */
50{
51 public:
52 /**
53 * Default constructor
54 */
56
57 /**
58 * Destructor
59 */
60 virtual ~PsmProteinMap();
61
62 std::pair<std::map<QString, pappso::cbor::psm::PsmProtein>::iterator, bool>
63 insert(const PsmProtein &psm_protein);
64
65 void writeMap(CborStreamWriter &writer) const;
66
67 void readMap(CborStreamReader &reader);
68
69 std::size_t size() const;
70
71 const pappso::cbor::psm::PsmProtein &getByAccession(const QString &accession) const;
72
73 private:
74 std::map<QString, PsmProtein> m_proteinMap;
75};
76} // namespace pappso::cbor::psm
std::map< QString, PsmProtein > m_proteinMap
const pappso::cbor::psm::PsmProtein & getByAccession(const QString &accession) const
std::pair< std::map< QString, pappso::cbor::psm::PsmProtein >::iterator, bool > insert(const PsmProtein &psm_protein)
void readMap(CborStreamReader &reader)
void writeMap(CborStreamWriter &writer) const
std::shared_ptr< Protein > protein_sp