pappso::OboTermForm Class Reference

`#include <obotermform.h>`

Inheritance diagram for pappso::OboTermForm:

## Public Slots

void | displayOboTerm (OboPsiModTerm oboTerm)

## Public Member Functions

| OboTermForm (QWidget *parent=nullptr)
| ~OboTermForm ()
bool | isOboTerm () const
| tells if an OBO term is displayed More...
const OboPsiModTerm & | getOboPsiModTerm () const
| get the obo term or an exception More...

## Protected Member Functions

void | parseDefinitionLabel ()
| parse the definition label to extract external links More...

## Private Attributes

Ui::OboTermForm * | ui
OboPsiModTerm | m_oboPsiModTerm

## Static Private Attributes

static QRegExp | m_findExternalLinks

## Detailed Description

Definition at line 44 of file obotermform.h.

## Constructor & Destructor Documentation

## OboTermForm()

OboTermForm::OboTermForm | ( | QWidget * | parent = `nullptr` | ) |

explicit

Default constructor

Definition at line 43 of file obotermform.cpp.

: QWidget(parent), ui(new Ui::OboTermForm)
{
qDebug();
ui->setupUi(this);
OboPsiModTerm empty;
displayOboTerm(empty);
}
pappso::OboPsiModTerm
Definition: obopsimodterm.h:32
pappso::OboTermForm::displayOboTerm
void displayOboTerm(OboPsiModTerm oboTerm)
Definition: obotermform.cpp:59
pappso::OboTermForm::ui
Ui::OboTermForm * ui
Definition: obotermform.h:78

References displayOboTerm(), and ui.

## ~OboTermForm()

pappso::OboTermForm::~OboTermForm | ( |  | ) |

Destructor

Definition at line 53 of file obotermform.cpp.

{
delete ui;
}

## Member Function Documentation

## displayOboTerm

void pappso::OboTermForm::displayOboTerm | ( | pappso::OboPsiModTerm | oboTerm | ) |

slot

Definition at line 59 of file obotermform.cpp.

{
qDebug() << oboTerm.m_accession;
ui->accessionHttpButton->setText(oboTerm.m_accession);
ui->nameLabel->setText(oboTerm.m_name);
ui->definitionLabel->setText(oboTerm.m_definition);
ui->diffFormulaLabel->setText(oboTerm.m_diffFormula);
if(oboTerm.isValid())
{
ui->diffMonoLabel->setText(QString::number(oboTerm.m_diffMono, 'f', 4));
parseDefinitionLabel();
}
else
{
ui->diffMonoLabel->setText("");
}
ui->originLabel->setText(oboTerm.m_origin);
ui->psiModLabel->setText(oboTerm.m_psiModLabel);
m_oboPsiModTerm = oboTerm;
}
pappso::OboPsiModTerm::m_psiModLabel
QString m_psiModLabel
Definition: obopsimodterm.h:47
pappso::OboPsiModTerm::m_diffFormula
QString m_diffFormula
Definition: obopsimodterm.h:49
pappso::OboPsiModTerm::m_origin
QString m_origin
Definition: obopsimodterm.h:50
pappso::OboPsiModTerm::m_definition
QString m_definition
Definition: obopsimodterm.h:46
pappso::OboPsiModTerm::isValid
bool isValid() const
Definition: obopsimodterm.cpp:51
pappso::OboPsiModTerm::m_diffMono
double m_diffMono
Definition: obopsimodterm.h:52
pappso::OboPsiModTerm::m_accession
QString m_accession
Definition: obopsimodterm.h:44
pappso::OboPsiModTerm::m_name
QString m_name
Definition: obopsimodterm.h:45
pappso::OboTermForm::m_oboPsiModTerm
OboPsiModTerm m_oboPsiModTerm
Definition: obotermform.h:80
pappso::OboTermForm::parseDefinitionLabel
void parseDefinitionLabel()
parse the definition label to extract external links
Definition: obotermform.cpp:102

References pappso::OboPsiModTerm::isValid(), pappso::OboPsiModTerm::m_accession, pappso::OboPsiModTerm::m_definition, pappso::OboPsiModTerm::m_diffFormula, pappso::OboPsiModTerm::m_diffMono, pappso::OboPsiModTerm::m_name, pappso::OboPsiModTerm::m_origin, and pappso::OboPsiModTerm::m_psiModLabel.

Referenced by pappso::OboChooserWidget::OboChooserWidget(), and OboTermForm().

## getOboPsiModTerm()

const pappso::OboPsiModTerm & pappso::OboTermForm::getOboPsiModTerm | ( |  | ) | const

get the obo term or an exception

Definition at line 83 of file obotermform.cpp.

{
if(isOboTerm())
{
}
else
{
throw pappso::ExceptionNotFound(tr("OBO term not available"));
}
return m_oboPsiModTerm;
}
pappso::ExceptionNotFound
Definition: exceptionnotfound.h:32
pappso::OboTermForm::isOboTerm
bool isOboTerm() const
tells if an OBO term is displayed
Definition: obotermform.cpp:96

## isOboTerm()

bool pappso::OboTermForm::isOboTerm | ( |  | ) | const

tells if an OBO term is displayed

Definition at line 96 of file obotermform.cpp.

{
return m_oboPsiModTerm.isValid();
}

## parseDefinitionLabel()

void pappso::OboTermForm::parseDefinitionLabel | ( |  | ) |

protected

parse the definition label to extract external links

Definition at line 102 of file obotermform.cpp.

{
QString label = ui->definitionLabel->text();
//"Oxidation of methionine to methionine sulfoxide with neutral loss of
// CH3SOH." [PubMed:18688235, PubMed:9004526]
QLayoutItem *child;
while((child = ui->xrefScrollAreaLayout->takeAt(0)) != 0)
{
if(child->widget() != NULL)
{
delete(child->widget());
}
delete child;
}
ui->xrefScrollArea->hide();
if(m_findExternalLinks.exactMatch(label))
{
QStringList pline = m_findExternalLinks.capturedTexts();
ui->definitionLabel->setText(pline[1]);
QStringList list_xref = pline[2].split(",");
ui->xrefScrollArea->show();
for(auto xref : list_xref)
{
HttpButton *newButton = new HttpButton;
newButton->setText(xref.trimmed());
newButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
ui->xrefScrollAreaLayout->addWidget(newButton);
}
}
}
pappso::HttpButton
Definition: httpbutton.h:41
pappso::HttpButton::setText
void setText(const QString &text)
Definition: httpbutton.cpp:86
pappso::OboTermForm::m_findExternalLinks
static QRegExp m_findExternalLinks
Definition: obotermform.h:83

References pappso::HttpButton::setText().

## Member Data Documentation

## m_findExternalLinks

QRegExp OboTermForm::m_findExternalLinks

static private

Definition at line 83 of file obotermform.h.

## m_oboPsiModTerm

OboPsiModTerm pappso::OboTermForm::m_oboPsiModTerm

private

Definition at line 80 of file obotermform.h.

## ui

Ui::OboTermForm* pappso::OboTermForm::ui

private

Definition at line 78 of file obotermform.h.

Referenced by OboTermForm().

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

- pappsomspp/widget/obo/obotermform/obotermform.h
- pappsomspp/widget/obo/obotermform/obotermform.cpp