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 QRegularExpression m_firstParse
 
static QRegularExpression m_findExactPsiModLabel
 
static QRegularExpression 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 138 of file obopsimodterm.cpp.

139 {
140  m_accession = "";
141  m_name = "";
142  m_definition = "";
143  m_psiModLabel = "";
144  m_diffFormula = "";
145  m_diffMono = 0;
146  m_origin = "";
147 }

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

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

QRegularExpression pappso::OboPsiModTerm::m_findExactPsiModLabel
staticprivate

Definition at line 59 of file obopsimodterm.h.

Referenced by parseLine().

◆ m_findRelatedPsiMsLabel

QRegularExpression pappso::OboPsiModTerm::m_findRelatedPsiMsLabel
staticprivate

Definition at line 60 of file obopsimodterm.h.

Referenced by parseLine().

◆ m_firstParse

QRegularExpression 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: