libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::OboPsiMod Class Reference

#include <obopsimod.h>

Public Member Functions

 OboPsiMod (OboPsiModHandlerInterface &handler)
virtual ~OboPsiMod ()

Private Member Functions

void parse ()
 starts reading obo file and reports each term with the callback function

Private Attributes

OboPsiModTerm m_term
OboPsiModHandlerInterfacem_handler

Detailed Description

Definition at line 34 of file obopsimod.h.

Constructor & Destructor Documentation

◆ OboPsiMod()

pappso::OboPsiMod::OboPsiMod ( OboPsiModHandlerInterface & handler)

Definition at line 41 of file obopsimod.cpp.

41 : m_handler(handler)
42{
43 qDebug();
45 parse();
46}
void parse()
starts reading obo file and reports each term with the callback function
Definition obopsimod.cpp:54
OboPsiModHandlerInterface & m_handler
Definition obopsimod.h:42
void initMyResource()
Definition obopsimod.cpp:32

References initMyResource(), m_handler, and parse().

◆ ~OboPsiMod()

pappso::OboPsiMod::~OboPsiMod ( )
virtual

Definition at line 48 of file obopsimod.cpp.

49{
50}

Member Function Documentation

◆ parse()

void pappso::OboPsiMod::parse ( )
private

starts reading obo file and reports each term with the callback function

Definition at line 54 of file obopsimod.cpp.

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").arg(obofile.fileName()));
63 }
64 obofile.open(QIODevice::ReadOnly);
65 QTextStream p_in(&obofile);
66
67 // Search accession conta
68 // QTextStream in(p_in);
69 QString line = p_in.readLine();
70 bool in_term = false;
71 while(!p_in.atEnd())
72 {
73 // qDebug() << "OboPsiMod::parse line "<< line;
74 if(line.startsWith("[Term]"))
75 {
76 in_term = true;
77 m_term.clearTerm();
78 }
79 else if(line.isEmpty())
80 {
81 if(in_term)
82 {
83 m_handler.setOboPsiModTerm(m_term);
84 in_term = false;
85 }
86 }
87 else
88 {
89 if(in_term)
90 m_term.parseLine(line);
91 // m_handler.setSequence(line);
92 }
93 line = p_in.readLine();
94 }
95 if(in_term)
96 {
97 m_handler.setOboPsiModTerm(m_term);
98 }
99 // p_in->close();
100
101 obofile.close();
102}
OboPsiModTerm m_term
Definition obopsimod.h:41

References line, m_handler, and m_term.

Referenced by OboPsiMod().

Member Data Documentation

◆ m_handler

OboPsiModHandlerInterface& pappso::OboPsiMod::m_handler
private

Definition at line 42 of file obopsimod.h.

Referenced by OboPsiMod(), and parse().

◆ m_term

OboPsiModTerm pappso::OboPsiMod::m_term
private

Definition at line 41 of file obopsimod.h.

Referenced by parse().


The documentation for this class was generated from the following files: