Newer
Older
/*******************************************************************************
* Copyright (c) 2017 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and implementation
******************************************************************************/
#include "proteinwindow.h"
#include "../project_view/projectwindow.h"
#include "ui_protein_detail_view.h"
#include <pappsomspp/pappsoexception.h>
#include <QMessageBox>
ProteinWindow::ProteinWindow(ProjectWindow *parent):
QMainWindow(parent),
ui(new Ui::ProteinDetailView)
{
ui->setupUi(this);
/*
*/
#if QT_VERSION >= 0x050000
// Qt5 code
/*
connect(&workerThread, &QThread::finished, worker, &QObject::deleteLater);
connect(this, &PtSpectrumViewer::operateMsDataFile, worker, &PwizLoaderThread::doMsDataFileLoad);
connect(worker, &PwizLoaderThread::msDataReady, this, &PtSpectrumViewer::handleMsDataFile);
*/
#else
// Qt4 code
//connect(_protein_table_model_p, SIGNAL(layoutChanged()), this, SLOT(updateStatusBar()));
#endif
}
ProteinWindow::~ProteinWindow()
{
void ProteinWindow::setProteinMatch(ProteinMatch * p_protein_match) {
try {
ui->descriptionLabel->setText(p_protein_match->getProteinXtpSp().get()->getAccession());
//ui->sequenceLabel->setText(p_protein_match->getProteinXtpSp().get()->getSequence());
ui->sequenceTextEdit->setText(p_protein_match->getHtmlSequence());
ui->coverage_label->setText(QString("%1 %").arg(p_protein_match->getCoverage()*100));
pappso::Peptide peptide(p_protein_match->getProteinXtpSp().get()->getSequence());
ui->mw_label->setText(QString("%1 kDa").arg(peptide.getMass()/1000));
ui->evalue_label->setText(QString("%1 (log10: %2)").arg(p_protein_match->getEvalue()).arg(std::log10(p_protein_match->getEvalue())));
}
catch (pappso::PappsoException exception_pappso) {
QMessageBox::warning(this,
tr("Unable to display protein details :"), exception_pappso.qwhat());
}
catch (std::exception exception_std) {
QMessageBox::warning(this,
tr("Unable to display protein details :"), exception_std.what());
}