libpappsomspp
Library for mass spectrometry
pappso::OboPsiModTerm Class Reference

#include <obopsimod.h>

Public Member Functions

bool isValid () const
 

Public Attributes

QString m_accession
 
QString m_name
 
QString m_psiModLabel
 
QString m_psiMsLabel
 
QString m_diffFormula
 
QString m_origin
 
pappso_double m_diffMono
 

Private Member Functions

void parseLine (const QString &line)
 
void clearTerm ()
 

Private Attributes

friend OboPsiMod
 

Static Private Attributes

static QRegExp m_firstParse
 
static QRegExp m_findExactPsiModLabel
 
static QRegExp m_findRelatedPsiMsLabel
 

Detailed Description

Definition at line 35 of file obopsimod.h.

Member Function Documentation

◆ clearTerm()

void pappso::OboPsiModTerm::clearTerm ( )
private

Definition at line 119 of file obopsimod.cpp.

120 {
121  m_accession = "";
122  m_name = "";
123  m_psiModLabel = "";
124  m_diffFormula = "";
125  m_diffMono = 0;
126  m_origin = "";
127 }

References m_accession, m_diffFormula, m_diffMono, m_name, m_origin, and m_psiModLabel.

Referenced by pappso::OboPsiMod::parse().

◆ isValid()

bool pappso::OboPsiModTerm::isValid ( ) const
inline

Definition at line 58 of file obopsimod.h.

59  {
60  return (!m_accession.isEmpty());
61  };

◆ parseLine()

void pappso::OboPsiModTerm::parseLine ( const QString &  line)
private

Definition at line 51 of file obopsimod.cpp.

52 {
53  // qDebug() << "OboPsiModTerm::parseLine begin " << line;
54  // id: MOD:00007
55  if(m_firstParse.exactMatch(line))
56  {
57  QStringList pline = m_firstParse.capturedTexts();
58  // qDebug() << "OboPsiModTerm::parseLine match " << pline[0] << pline[1];
59  if(pline[1] == "id")
60  {
61  m_accession = pline[2].trimmed();
62  // qDebug() << "OboPsiModTerm::parseLine accession = " << m_accession;
63  }
64  else if(pline[1] == "name")
65  {
66  m_name = pline[2].trimmed();
67  // qDebug() << "OboPsiModTerm::parseLine accession = " << m_accession;
68  }
69  else if(pline[1] == "xref")
70  {
71  // xref: DiffMono: "1.007276"
72  if(m_firstParse.exactMatch(pline[2]))
73  {
74  QStringList psecond = m_firstParse.capturedTexts();
75  if(psecond[1] == "DiffMono")
76  {
77  m_diffMono = psecond[2].replace("\"", "").toDouble();
78  // qDebug() << "OboPsiModTerm::parseLine m_diffMono = " <<
79  // m_diffMono;
80  }
81  else if(psecond[1] == "DiffFormula")
82  {
83  m_diffFormula = psecond[2].trimmed().replace("\"", "");
84  // qDebug() << "OboPsiModTerm::parseLine m_diffFormula = |" <<
85  // m_diffFormula<<"|";
86  }
87  else if(psecond[1] == "Origin")
88  {
89  m_origin =
90  psecond[2].trimmed().replace("\"", "").replace(",", "");
91  // qDebug() << "OboPsiModTerm::parseLine m_diffFormula = |" <<
92  // m_diffFormula<<"|";
93  }
94  }
95  }
96  else if(pline[1] == "synonym")
97  {
98  // synonym: "Se(S)Res" EXACT PSI-MOD-label []
99  if(m_findExactPsiModLabel.exactMatch(pline[2]))
100  {
101  m_psiModLabel =
102  m_findExactPsiModLabel.capturedTexts()[1].trimmed().replace(
103  "\"", "");
104  // qDebug() << "OboPsiModTerm::parseLine m_psiModLabel = |" <<
105  // m_psiModLabel<<"|";
106  }
107  else if(m_findRelatedPsiMsLabel.exactMatch(pline[2]))
108  {
109  m_psiMsLabel =
110  m_findRelatedPsiMsLabel.capturedTexts()[1].trimmed().replace(
111  "\"", "");
112  // qDebug() << "OboPsiModTerm::parseLine m_psiModLabel = |" <<
113  // m_psiModLabel<<"|";
114  }
115  }
116  }
117 }

References m_accession, m_diffFormula, m_diffMono, m_findExactPsiModLabel, m_findRelatedPsiMsLabel, m_firstParse, m_name, m_origin, m_psiModLabel, and m_psiMsLabel.

Referenced by pappso::OboPsiMod::parse().

Member Data Documentation

◆ m_accession

◆ m_diffFormula

QString pappso::OboPsiModTerm::m_diffFormula

Definition at line 52 of file obopsimod.h.

Referenced by clearTerm(), pappso::AaModification::createInstance(), and parseLine().

◆ m_diffMono

◆ m_findExactPsiModLabel

QRegExp pappso::OboPsiModTerm::m_findExactPsiModLabel
staticprivate

Definition at line 44 of file obopsimod.h.

Referenced by parseLine().

◆ m_findRelatedPsiMsLabel

QRegExp pappso::OboPsiModTerm::m_findRelatedPsiMsLabel
staticprivate

Definition at line 45 of file obopsimod.h.

Referenced by parseLine().

◆ m_firstParse

QRegExp pappso::OboPsiModTerm::m_firstParse
staticprivate

Definition at line 43 of file obopsimod.h.

Referenced by parseLine().

◆ m_name

QString pappso::OboPsiModTerm::m_name

◆ m_origin

QString pappso::OboPsiModTerm::m_origin

Definition at line 53 of file obopsimod.h.

Referenced by clearTerm(), pappso::AaModification::createInstance(), and parseLine().

◆ m_psiModLabel

QString pappso::OboPsiModTerm::m_psiModLabel

◆ m_psiMsLabel

QString pappso::OboPsiModTerm::m_psiMsLabel

Definition at line 51 of file obopsimod.h.

Referenced by parseLine(), and pappso::FilterOboPsiModTermLabel::setOboPsiModTerm().

◆ OboPsiMod

friend pappso::OboPsiModTerm::OboPsiMod
private

Definition at line 37 of file obopsimod.h.


The documentation for this class was generated from the following files:
pappso::OboPsiModTerm::m_psiModLabel
QString m_psiModLabel
Definition: obopsimod.h:50
pappso::OboPsiModTerm::m_findExactPsiModLabel
static QRegExp m_findExactPsiModLabel
Definition: obopsimod.h:44
pappso::OboPsiModTerm::m_diffFormula
QString m_diffFormula
Definition: obopsimod.h:52
pappso::OboPsiModTerm::m_accession
QString m_accession
Definition: obopsimod.h:48
pappso::OboPsiModTerm::m_firstParse
static QRegExp m_firstParse
Definition: obopsimod.h:43
pappso::OboPsiModTerm::m_name
QString m_name
Definition: obopsimod.h:49
pappso::OboPsiModTerm::m_findRelatedPsiMsLabel
static QRegExp m_findRelatedPsiMsLabel
Definition: obopsimod.h:45
pappso::OboPsiModTerm::m_diffMono
pappso_double m_diffMono
Definition: obopsimod.h:55
pappso::OboPsiModTerm::m_psiMsLabel
QString m_psiMsLabel
Definition: obopsimod.h:51
pappso::OboPsiModTerm::m_origin
QString m_origin
Definition: obopsimod.h:53