libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
obopsimod.cpp
Go to the documentation of this file.
1
2
/*******************************************************************************
3
* Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
4
*
5
* This file is part of the PAPPSOms++ library.
6
*
7
* PAPPSOms++ is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*
12
* PAPPSOms++ is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
19
*
20
* Contributors:
21
* Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
22
*implementation
23
******************************************************************************/
24
25
#include <QDir>
26
#include <QDebug>
27
#include "
obopsimod.h
"
28
#include "
pappsomspp/core/pappsoexception.h
"
29
#include <iostream>
30
31
inline
void
32
initMyResource
()
33
{
34
Q_INIT_RESOURCE(libpappsomspp_core_resources);
35
}
36
37
38
namespace
pappso
39
{
40
41
OboPsiMod::OboPsiMod
(
OboPsiModHandlerInterface
&handler) :
m_handler
(handler)
42
{
43
qDebug();
44
initMyResource
();
45
parse
();
46
}
47
48
OboPsiMod::~OboPsiMod
()
49
{
50
}
51
52
53
void
54
OboPsiMod::parse
()
55
{
56
// std::cout << "OboPsiMod::parse Begin parsing OBO file" << std::endl;
57
qDebug() <<
"OboPsiMod::parse Begin parsing OBO file"
;
58
QFile obofile(
":/obo/resources/obo/PSI-MOD.obo"
);
59
if
(!obofile.exists())
60
{
61
throw
PappsoException
(
62
QObject::tr(
"PSI-MOD OBO resource file : %1 not found"
)
63
.arg(obofile.fileName()));
64
}
65
obofile.open(QIODevice::ReadOnly);
66
QTextStream p_in(&obofile);
67
68
// Search accession conta
69
// QTextStream in(p_in);
70
QString
line
= p_in.readLine();
71
bool
in_term =
false
;
72
while
(!p_in.atEnd())
73
{
74
// qDebug() << "OboPsiMod::parse line "<< line;
75
if
(
line
.startsWith(
"[Term]"
))
76
{
77
in_term =
true
;
78
m_term
.clearTerm();
79
}
80
else
if
(
line
.isEmpty())
81
{
82
if
(in_term)
83
{
84
m_handler
.setOboPsiModTerm(
m_term
);
85
in_term =
false
;
86
}
87
}
88
else
89
{
90
if
(in_term)
91
m_term
.parseLine(
line
);
92
// m_handler.setSequence(line);
93
}
94
line
= p_in.readLine();
95
}
96
if
(in_term)
97
{
98
m_handler
.setOboPsiModTerm(
m_term
);
99
}
100
// p_in->close();
101
102
obofile.close();
103
}
104
105
}
// namespace pappso
CardanoResultCase::line
@ line
Definition
cardano.h:42
pappso::OboPsiModHandlerInterface
Definition
obopsimodhandlerinterface.h:31
pappso::OboPsiMod::OboPsiMod
OboPsiMod(OboPsiModHandlerInterface &handler)
Definition
obopsimod.cpp:41
pappso::OboPsiMod::~OboPsiMod
virtual ~OboPsiMod()
Definition
obopsimod.cpp:48
pappso::OboPsiMod::parse
void parse()
starts reading obo file and reports each term with the callback function
Definition
obopsimod.cpp:54
pappso::OboPsiMod::m_term
OboPsiModTerm m_term
Definition
obopsimod.h:41
pappso::OboPsiMod::m_handler
OboPsiModHandlerInterface & m_handler
Definition
obopsimod.h:42
pappso::PappsoException
Definition
pappsoexception.h:42
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
initMyResource
void initMyResource()
Definition
obopsimod.cpp:32
obopsimod.h
pappsoexception.h
pappsomspp
core
obo
obopsimod.cpp
Generated on Tue Sep 23 2025 09:36:35 for libpappsomspp by
1.13.2