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")
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}
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: