libpappsomspp
Library for mass spectrometry
pappso::OboPsiModTerm Class Reference

#include <obopsimodterm.h>

Public Member Functions

 OboPsiModTerm ()
 
 ~OboPsiModTerm ()
 
 OboPsiModTerm (const OboPsiModTerm &)
 
OboPsiModTermoperator= (const OboPsiModTerm &)
 
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 ( )

Definition at line 51 of file obopsimodterm.cpp.

52 {
53 }

◆ ~OboPsiModTerm()

pappso::OboPsiModTerm::~OboPsiModTerm ( )

Definition at line 55 of file obopsimodterm.cpp.

56 {
57 }

◆ OboPsiModTerm() [2/2]

pappso::OboPsiModTerm::OboPsiModTerm ( const OboPsiModTerm other)

Definition at line 58 of file obopsimodterm.cpp.

59 {
60  m_accession = other.m_accession;
61  m_name = other.m_name;
62  m_definition = other.m_definition;
63  m_psiModLabel = other.m_psiModLabel;
64  m_psiMsLabel = other.m_psiMsLabel;
65  m_diffFormula = other.m_diffFormula;
66  m_origin = other.m_origin;
67 
68  m_diffMono = other.m_diffMono;
69 }

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

Member Function Documentation

◆ clearTerm()

void pappso::OboPsiModTerm::clearTerm ( )
private

Definition at line 175 of file obopsimodterm.cpp.

176 {
177  m_accession = "";
178  m_name = "";
179  m_definition = "";
180  m_psiModLabel = "";
181  m_diffFormula = "";
182  m_diffMono = 0;
183  m_origin = "";
184 }

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 88 of file obopsimodterm.cpp.

89 {
90  return (!m_accession.isEmpty());
91 }

References m_accession.

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

◆ operator=()

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

Definition at line 72 of file obopsimodterm.cpp.

73 {
74  m_accession = other.m_accession;
75  m_name = other.m_name;
76  m_definition = other.m_definition;
77  m_psiModLabel = other.m_psiModLabel;
78  m_psiMsLabel = other.m_psiMsLabel;
79  m_diffFormula = other.m_diffFormula;
80  m_origin = other.m_origin;
81 
82  m_diffMono = other.m_diffMono;
83  return *this;
84 }

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

◆ parseLine()

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

Definition at line 94 of file obopsimodterm.cpp.

95 {
96  // qDebug() << "OboPsiModTerm::parseLine begin " << line;
97  // id: MOD:00007
98  QRegularExpressionMatch match_line = m_firstParse.match(line);
99  if(match_line.hasMatch())
100  {
101  QStringList pline = match_line.capturedTexts();
102  // qDebug() << "OboPsiModTerm::parseLine match " << pline[0] << pline[1];
103  if(pline[1] == "id")
104  {
105  m_accession = pline[2].trimmed();
106  // qDebug() << "OboPsiModTerm::parseLine accession = " << m_accession;
107  }
108  else if(pline[1] == "name")
109  {
110  m_name = pline[2].trimmed();
111  // qDebug() << "OboPsiModTerm::parseLine accession = " << m_accession;
112  }
113  else if(pline[1] == "xref")
114  {
115  // xref: DiffMono: "1.007276"
116  QRegularExpressionMatch match_subline = m_firstParse.match(pline[2]);
117  if(match_subline.hasMatch())
118  {
119  QStringList psecond = match_subline.capturedTexts();
120  if(psecond[1] == "DiffMono")
121  {
122  m_diffMono = psecond[2].replace("\"", "").toDouble();
123  // qDebug() << "OboPsiModTerm::parseLine m_diffMono = " <<
124  // m_diffMono;
125  }
126  else if(psecond[1] == "DiffFormula")
127  {
128  m_diffFormula = psecond[2].trimmed().replace("\"", "");
129  // qDebug() << "OboPsiModTerm::parseLine m_diffFormula = |" <<
130  // m_diffFormula<<"|";
131  }
132  else if(psecond[1] == "Origin")
133  {
134  m_origin =
135  psecond[2].trimmed().replace("\"", "").replace(",", "");
136  // qDebug() << "OboPsiModTerm::parseLine m_diffFormula = |" <<
137  // m_diffFormula<<"|";
138  }
139  }
140  }
141  else if(pline[1] == "synonym")
142  {
143  // synonym: "Se(S)Res" EXACT PSI-MOD-label []
144  QRegularExpressionMatch match_exact_psimod =
145  m_findExactPsiModLabel.match(pline[2]);
146  if(match_exact_psimod.hasMatch())
147  {
148  m_psiModLabel =
149  match_exact_psimod.captured(1).trimmed().replace("\"", "");
150  // qDebug() << "OboPsiModTerm::parseLine m_psiModLabel = |" <<
151  // m_psiModLabel<<"|";
152  }
153  else
154  {
155  QRegularExpressionMatch match_related_psims =
156  m_findRelatedPsiMsLabel.match(pline[2]);
157  if(match_related_psims.hasMatch())
158  {
159  m_psiMsLabel =
160  match_related_psims.captured(1).trimmed().replace("\"", "");
161  // qDebug() << "OboPsiModTerm::parseLine m_psiModLabel = |" <<
162  // m_psiModLabel<<"|";
163  }
164  }
165  }
166  else if(pline[1] == "def")
167  {
168  // def: "A protein modification that modifies an L-asparagine
169  // residue." [PubMed:18688235]
170  m_definition = pline[2];
171  }
172  }
173 }
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

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