libpappsomspp
Library for mass spectrometry
pappso::OboPsiModTerm Class Reference

#include <obopsimodterm.h>

Public Member Functions

 OboPsiModTerm ()=default
 
 ~OboPsiModTerm ()=default
 
 OboPsiModTerm (const OboPsiModTerm &)=default
 
OboPsiModTermoperator= (const OboPsiModTerm &)=default
 
bool isValid () const
 

Public Attributes

QString m_accession
 
QString m_name
 
QString m_definition
 
QString m_psiModLabel
 
QString m_psiMsLabel
 
QString m_diffFormula
 
QString m_origin
 
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 31 of file obopsimodterm.h.

Constructor & Destructor Documentation

◆ OboPsiModTerm() [1/2]

pappso::OboPsiModTerm::OboPsiModTerm ( )
default

◆ ~OboPsiModTerm()

pappso::OboPsiModTerm::~OboPsiModTerm ( )
default

◆ OboPsiModTerm() [2/2]

pappso::OboPsiModTerm::OboPsiModTerm ( const OboPsiModTerm )
default

Member Function Documentation

◆ clearTerm()

void pappso::OboPsiModTerm::clearTerm ( )
private

Definition at line 131 of file obopsimodterm.cpp.

132 {
133  m_accession = "";
134  m_name = "";
135  m_definition = "";
136  m_psiModLabel = "";
137  m_diffFormula = "";
138  m_diffMono = 0;
139  m_origin = "";
140 }

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

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

◆ isValid()

bool pappso::OboPsiModTerm::isValid ( ) const

Definition at line 51 of file obopsimodterm.cpp.

52 {
53  return (!m_accession.isEmpty());
54 }

References m_accession.

Referenced by pappso::OboTermForm::displayOboTerm().

◆ operator=()

OboPsiModTerm& pappso::OboPsiModTerm::operator= ( const OboPsiModTerm )
default

◆ parseLine()

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

Definition at line 57 of file obopsimodterm.cpp.

58 {
59  // qDebug() << "OboPsiModTerm::parseLine begin " << line;
60  // id: MOD:00007
61  if(m_firstParse.exactMatch(line))
62  {
63  QStringList pline = m_firstParse.capturedTexts();
64  // qDebug() << "OboPsiModTerm::parseLine match " << pline[0] << pline[1];
65  if(pline[1] == "id")
66  {
67  m_accession = pline[2].trimmed();
68  // qDebug() << "OboPsiModTerm::parseLine accession = " << m_accession;
69  }
70  else if(pline[1] == "name")
71  {
72  m_name = pline[2].trimmed();
73  // qDebug() << "OboPsiModTerm::parseLine accession = " << m_accession;
74  }
75  else if(pline[1] == "xref")
76  {
77  // xref: DiffMono: "1.007276"
78  if(m_firstParse.exactMatch(pline[2]))
79  {
80  QStringList psecond = m_firstParse.capturedTexts();
81  if(psecond[1] == "DiffMono")
82  {
83  m_diffMono = psecond[2].replace("\"", "").toDouble();
84  // qDebug() << "OboPsiModTerm::parseLine m_diffMono = " <<
85  // m_diffMono;
86  }
87  else if(psecond[1] == "DiffFormula")
88  {
89  m_diffFormula = psecond[2].trimmed().replace("\"", "");
90  // qDebug() << "OboPsiModTerm::parseLine m_diffFormula = |" <<
91  // m_diffFormula<<"|";
92  }
93  else if(psecond[1] == "Origin")
94  {
95  m_origin =
96  psecond[2].trimmed().replace("\"", "").replace(",", "");
97  // qDebug() << "OboPsiModTerm::parseLine m_diffFormula = |" <<
98  // m_diffFormula<<"|";
99  }
100  }
101  }
102  else if(pline[1] == "synonym")
103  {
104  // synonym: "Se(S)Res" EXACT PSI-MOD-label []
105  if(m_findExactPsiModLabel.exactMatch(pline[2]))
106  {
107  m_psiModLabel =
108  m_findExactPsiModLabel.capturedTexts()[1].trimmed().replace(
109  "\"", "");
110  // qDebug() << "OboPsiModTerm::parseLine m_psiModLabel = |" <<
111  // m_psiModLabel<<"|";
112  }
113  else if(m_findRelatedPsiMsLabel.exactMatch(pline[2]))
114  {
115  m_psiMsLabel =
116  m_findRelatedPsiMsLabel.capturedTexts()[1].trimmed().replace(
117  "\"", "");
118  // qDebug() << "OboPsiModTerm::parseLine m_psiModLabel = |" <<
119  // m_psiModLabel<<"|";
120  }
121  }
122  else if(pline[1] == "def")
123  {
124  // def: "A protein modification that modifies an L-asparagine
125  // residue." [PubMed:18688235]
126  m_definition = pline[2];
127  }
128  }
129 }
static QRegExp m_findExactPsiModLabel
Definition: obopsimodterm.h:59
static QRegExp m_firstParse
Definition: obopsimodterm.h:58
static QRegExp m_findRelatedPsiMsLabel
Definition: obopsimodterm.h:60

References m_accession, m_definition, 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_definition

QString pappso::OboPsiModTerm::m_definition

Definition at line 46 of file obopsimodterm.h.

Referenced by clearTerm(), pappso::OboTermForm::displayOboTerm(), and parseLine().

◆ m_diffFormula

QString pappso::OboPsiModTerm::m_diffFormula

◆ m_diffMono

◆ m_findExactPsiModLabel

QRegExp pappso::OboPsiModTerm::m_findExactPsiModLabel
staticprivate

Definition at line 59 of file obopsimodterm.h.

Referenced by parseLine().

◆ m_findRelatedPsiMsLabel

QRegExp pappso::OboPsiModTerm::m_findRelatedPsiMsLabel
staticprivate

Definition at line 60 of file obopsimodterm.h.

Referenced by parseLine().

◆ m_firstParse

QRegExp pappso::OboPsiModTerm::m_firstParse
staticprivate

Definition at line 58 of file obopsimodterm.h.

Referenced by parseLine().

◆ m_name

◆ m_origin

QString pappso::OboPsiModTerm::m_origin

◆ m_psiModLabel

QString pappso::OboPsiModTerm::m_psiModLabel

◆ m_psiMsLabel

QString pappso::OboPsiModTerm::m_psiMsLabel

◆ OboPsiMod

friend pappso::OboPsiModTerm::OboPsiMod
private

Definition at line 33 of file obopsimodterm.h.


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