libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
filterobopsimodmap.cpp
Go to the documentation of this file.
1/**
2 * \file pappsomspp/obo/obopsimodmap.cpp
3 * \date 2/10/2024
4 * \author Olivier Langella
5 * \brief map container for obo psi mod terms
6 **/
7
8/*******************************************************************************
9 * Copyright (c) 2024 Olivier Langella
10 *<Olivier.Langella@universite-paris-saclay.fr>.
11 *
12 * This file is part of the PAPPSOms++ library.
13 *
14 * PAPPSOms++ 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 * PAPPSOms++ 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 PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
26 *
27 ******************************************************************************/
28
29#include "filterobopsimodmap.h"
31
32
36
37
41
42void
47
50{
51 auto it = m_mapOboPsiModTerm.find(accession);
52 if(it == m_mapOboPsiModTerm.end())
53 {
55 QObject::tr("OBO term accession %1 not found").arg(accession));
56 }
57 return it->second;
58}
59
62{
63 for(auto &pair_term : m_mapOboPsiModTerm)
64 {
65 if(pair_term.second.m_name == name)
66 return pair_term.second;
67 }
68 throw pappso::ExceptionNotFound(QObject::tr("OBO term name %1 not found").arg(name));
69}
const OboPsiModTerm & getOboPsiModTermWithAccession(const QString &accession) const
const OboPsiModTerm & getOboPsiModTermWithName(const QString &name) const
get the first occurence of term with this name
std::map< QString, const OboPsiModTerm > m_mapOboPsiModTerm
virtual void setOboPsiModTerm(const OboPsiModTerm &term) override
triggered function on each obo term when parsing obo file
const QString & getAccession() const