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

#include <obopsimodterm.h>

Public Member Functions

 OboPsiModTerm ()
 
 ~OboPsiModTerm ()
 
 OboPsiModTerm (const OboPsiModTerm &)
 
OboPsiModTermoperator= (const OboPsiModTerm &)
 
bool isValid () const
 
bool isA (const QString &accession) const
 tells if this term "is_a" another accession
 

Public Attributes

QString m_accession
 
QString m_name
 
QString m_definition
 
QString m_psiModLabel
 
QString m_psiMsLabel
 
QString m_diffFormula
 
QString m_formula
 
QString m_origin
 
double m_diffMono
 
double m_massMono
 
QStringList m_isA
 

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_formula = other.m_formula;
67 m_origin = other.m_origin;
68
69 m_diffMono = other.m_diffMono;
70 m_massMono = other.m_massMono;
71 m_isA = other.m_isA;
72}

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

Member Function Documentation

◆ clearTerm()

void pappso::OboPsiModTerm::clearTerm ( )
private

Definition at line 212 of file obopsimodterm.cpp.

213{
214 m_accession = "";
215 m_name = "";
216 m_definition = "";
217 m_psiModLabel = "";
218 m_diffFormula = "";
219 m_diffMono = 0;
220 m_origin = "";
221 m_massMono = 0;
222 m_isA.clear();
223}

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

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

◆ isA()

bool pappso::OboPsiModTerm::isA ( const QString &  accession) const

tells if this term "is_a" another accession

Returns
bool if true

Definition at line 99 of file obopsimodterm.cpp.

100{
101 return m_isA.contains(accession);
102}

References m_isA.

Referenced by pappso::AaModification::createInstance().

◆ isValid()

bool pappso::OboPsiModTerm::isValid ( ) const

Definition at line 93 of file obopsimodterm.cpp.

94{
95 return (!m_accession.isEmpty());
96}

References m_accession.

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

◆ operator=()

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

Definition at line 75 of file obopsimodterm.cpp.

76{
77 m_accession = other.m_accession;
78 m_name = other.m_name;
79 m_definition = other.m_definition;
80 m_psiModLabel = other.m_psiModLabel;
81 m_psiMsLabel = other.m_psiMsLabel;
82 m_diffFormula = other.m_diffFormula;
83 m_origin = other.m_origin;
84
85 m_diffMono = other.m_diffMono;
86 m_massMono = other.m_massMono;
87 m_isA = other.m_isA;
88 return *this;
89}

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

◆ parseLine()

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

Definition at line 105 of file obopsimodterm.cpp.

106{
107 // qDebug() << "OboPsiModTerm::parseLine begin " << line;
108 // id: MOD:00007
109 // is_a: MOD:01441 ! natural, standard, encoded residue
110 QRegularExpressionMatch match_line = m_firstParse.match(line);
111 if(match_line.hasMatch())
112 {
113 QStringList pline = match_line.capturedTexts();
114 // qDebug() << "OboPsiModTerm::parseLine match " << pline[0] << pline[1];
115 if(pline[1] == "id")
116 {
117 m_accession = pline[2].trimmed();
118 // qDebug() << "OboPsiModTerm::parseLine accession = " << m_accession;
119 }
120 else if(pline[1] == "name")
121 {
122 m_name = pline[2].trimmed();
123 // qDebug() << "OboPsiModTerm::parseLine accession = " << m_accession;
124 }
125 else if(pline[1] == "is_a")
126 {
127 m_isA << pline[2].section(" ", 0, 0);
128 // qDebug() << "OboPsiModTerm::parseLine is_a = " << m_isA.join(" ");
129 }
130 else if(pline[1] == "xref")
131 {
132 // xref: DiffMono: "1.007276"
133 QRegularExpressionMatch match_subline = m_firstParse.match(pline[2]);
134 if(match_subline.hasMatch())
135 {
136 QStringList psecond = match_subline.capturedTexts();
137 if(psecond[1] == "DiffMono")
138 {
139 m_diffMono = psecond[2].replace("\"", "").toDouble();
140 // qDebug() << "OboPsiModTerm::parseLine m_diffMono = " <<
141 // m_diffMono;
142 }
143 else if(psecond[1] == "DiffFormula")
144 {
145 m_diffFormula = psecond[2].trimmed().replace("\"", "");
146 // qDebug() << "OboPsiModTerm::parseLine m_diffFormula = |" <<
147 // m_diffFormula<<"|";
148 }
149 else if(psecond[1] == "Formula")
150 {
151 m_formula = psecond[2].trimmed().replace("\"", "");
152 // qDebug() << "OboPsiModTerm::parseLine m_diffFormula = |" <<
153 // m_diffFormula<<"|";
154 }
155 else if(psecond[1] == "Origin")
156 {
157 m_origin =
158 psecond[2].trimmed().replace("\"", "").replace(",", "");
159 // qDebug() << "OboPsiModTerm::parseLine m_diffFormula = |" <<
160 // m_diffFormula<<"|";
161 }
162 // xref: MassMono: "71.037114"
163
164 else if(psecond[1] == "MassMono")
165 {
166 bool is_ok = false;
167 double mass_mono =
168 psecond[2].replace("\"", "").toDouble(&is_ok);
169 if(is_ok)
170 m_massMono = mass_mono;
171 else
172 m_massMono = 0;
173 // qDebug() << "OboPsiModTerm::parseLine m_diffFormula = |" <<
174 // m_diffFormula<<"|";
175 }
176 }
177 }
178 else if(pline[1] == "synonym")
179 {
180 // synonym: "Se(S)Res" EXACT PSI-MOD-label []
181 QRegularExpressionMatch match_exact_psimod =
182 m_findExactPsiModLabel.match(pline[2]);
183 if(match_exact_psimod.hasMatch())
184 {
186 match_exact_psimod.captured(1).trimmed().replace("\"", "");
187 // qDebug() << "OboPsiModTerm::parseLine m_psiModLabel = |" <<
188 // m_psiModLabel<<"|";
189 }
190 else
191 {
192 QRegularExpressionMatch match_related_psims =
193 m_findRelatedPsiMsLabel.match(pline[2]);
194 if(match_related_psims.hasMatch())
195 {
197 match_related_psims.captured(1).trimmed().replace("\"", "");
198 // qDebug() << "OboPsiModTerm::parseLine m_psiModLabel = |" <<
199 // m_psiModLabel<<"|";
200 }
201 }
202 }
203 else if(pline[1] == "def")
204 {
205 // def: "A protein modification that modifies an L-asparagine
206 // residue." [PubMed:18688235]
207 m_definition = pline[2];
208 }
209 }
210}
static QRegularExpression m_firstParse
static QRegularExpression m_findRelatedPsiMsLabel
static QRegularExpression m_findExactPsiModLabel

References line, m_accession, m_definition, m_diffFormula, m_diffMono, m_findExactPsiModLabel, m_findRelatedPsiMsLabel, m_firstParse, m_formula, m_isA, m_massMono, 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

◆ m_diffMono

◆ m_findExactPsiModLabel

QRegularExpression pappso::OboPsiModTerm::m_findExactPsiModLabel
staticprivate

Definition at line 67 of file obopsimodterm.h.

Referenced by parseLine().

◆ m_findRelatedPsiMsLabel

QRegularExpression pappso::OboPsiModTerm::m_findRelatedPsiMsLabel
staticprivate

Definition at line 68 of file obopsimodterm.h.

Referenced by parseLine().

◆ m_firstParse

QRegularExpression pappso::OboPsiModTerm::m_firstParse
staticprivate

Definition at line 66 of file obopsimodterm.h.

Referenced by parseLine().

◆ m_formula

QString pappso::OboPsiModTerm::m_formula

◆ m_isA

QStringList pappso::OboPsiModTerm::m_isA

◆ m_massMono

double pappso::OboPsiModTerm::m_massMono

Definition at line 58 of file obopsimodterm.h.

Referenced by OboPsiModTerm(), clearTerm(), operator=(), and 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: