libpappsomspp
Library for mass spectrometry
filterobopsimodsink.cpp
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
3  *
4  * This file is part of the PAPPSOms++ library.
5  *
6  * PAPPSOms++ is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * PAPPSOms++ is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Contributors:
20  * Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
21  *implementation
22  ******************************************************************************/
23 
24 #include "filterobopsimodsink.h"
25 #include "../exception/exceptionnotfound.h"
26 
27 namespace pappso
28 {
30 {
31 }
32 
34 {
35 }
36 
37 const std::list<OboPsiModTerm> &
39 {
40  return m_oboPsiModTermList;
41 }
42 
43 void
45 {
46  m_oboPsiModTermList.push_back(term);
47 }
48 
49 const OboPsiModTerm &
51 {
52  if(m_oboPsiModTermList.size() == 1)
53  {
54  return *m_oboPsiModTermList.begin();
55  }
56  if(m_oboPsiModTermList.size() == 0)
57  {
58  throw ExceptionNotFound(QObject::tr("OBO term list is empty"));
59  }
60  else
61  {
62  throw ExceptionNotFound(
63  QObject::tr("Too much OBO terms in list (size = %1)")
64  .arg(m_oboPsiModTermList.size()));
65  }
66 }
67 
68 const OboPsiModTerm &
70 {
71  if(m_oboPsiModTermList.size() == 0)
72  {
73  throw ExceptionNotFound(QObject::tr("OBO term list is empty"));
74  }
75  else
76  {
77  return *m_oboPsiModTermList.begin();
78  }
79 }
80 } // namespace pappso
const std::list< OboPsiModTerm > & getOboPsiModTermList()
std::list< OboPsiModTerm > m_oboPsiModTermList
void setOboPsiModTerm(const OboPsiModTerm &term) override
triggered function on each obo term when parsing obo file
const OboPsiModTerm & getFirst()
const OboPsiModTerm & getOne()
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39