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

#include <obounimod.h>

Public Member Functions

 OboUnimod (OboPsiModHandlerInterface &handler)
 
virtual ~OboUnimod ()
 

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 38 of file obounimod.h.

Constructor & Destructor Documentation

◆ OboUnimod()

pappso::OboUnimod::OboUnimod ( pappso::OboPsiModHandlerInterface & handler)

Definition at line 45 of file obounimod.cpp.

45 : m_handler(handler)
46{
47
48 qDebug();
50 parse();
51}
void parse()
starts reading obo file and reports each term with the callback function
Definition obounimod.cpp:59
OboPsiModHandlerInterface & m_handler
Definition obounimod.h:46
void initMyResource()
Definition obopsimod.cpp:32

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

◆ ~OboUnimod()

pappso::OboUnimod::~OboUnimod ( )
virtual

Definition at line 53 of file obounimod.cpp.

54{
55}

Member Function Documentation

◆ parse()

void pappso::OboUnimod::parse ( )
private

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

Definition at line 59 of file obounimod.cpp.

60{
61 // std::cout << "OboPsiMod::parse Begin parsing OBO file" << std::endl;
62 qDebug();
63 QFile obofile(":/obo/resources/obo/unimod.obo");
64 if(!obofile.exists())
65 {
66 throw PappsoException(
67 QObject::tr("UNIMOD OBO resource file : %1 not found").arg(obofile.fileName()));
68 }
69 obofile.open(QIODevice::ReadOnly);
70 QTextStream p_in(&obofile);
71
72 // Search accession conta
73 // QTextStream in(p_in);
74 QString line = p_in.readLine();
75 bool in_term = false;
76 while(!p_in.atEnd())
77 {
78 // qDebug() << "OboPsiMod::parse line "<< line;
79 if(line.startsWith("[Term]"))
80 {
81 in_term = true;
82 m_term.clearTerm();
83 }
84 else if(line.isEmpty())
85 {
86 if(in_term)
87 {
88 m_handler.setOboPsiModTerm(m_term);
89 in_term = false;
90 }
91 }
92 else
93 {
94 if(in_term)
95 m_term.parseLine(line);
96 // m_handler.setSequence(line);
97 }
98 line = p_in.readLine();
99 }
100 if(in_term)
101 {
102 m_handler.setOboPsiModTerm(m_term);
103 }
104 // p_in->close();
105
106 obofile.close();
107}
OboPsiModTerm m_term
Definition obounimod.h:45

References line, m_handler, and m_term.

Referenced by OboUnimod().

Member Data Documentation

◆ m_handler

OboPsiModHandlerInterface& pappso::OboUnimod::m_handler
private

Definition at line 46 of file obounimod.h.

Referenced by OboUnimod(), and parse().

◆ m_term

OboPsiModTerm pappso::OboUnimod::m_term
private

Definition at line 45 of file obounimod.h.

Referenced by parse().


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