Skip to content
Snippets Groups Projects
Commit 4af832a3 authored by Olivier Langella's avatar Olivier Langella
Browse files

windows connection OK

parent 07f36413
No related branches found
No related tags found
No related merge requests found
...@@ -102,6 +102,7 @@ std::size_t IdentificationGroup::countSubGroup()const { ...@@ -102,6 +102,7 @@ std::size_t IdentificationGroup::countSubGroup()const {
void IdentificationGroup::startGrouping (const GroupingType & grouping_type) { void IdentificationGroup::startGrouping (const GroupingType & grouping_type) {
qDebug() << "IdentificationGroup::startGrouping begin ";
if (_p_grp_experiment != nullptr) { if (_p_grp_experiment != nullptr) {
delete _p_grp_experiment; delete _p_grp_experiment;
} }
...@@ -116,4 +117,5 @@ void IdentificationGroup::startGrouping (const GroupingType & grouping_type) { ...@@ -116,4 +117,5 @@ void IdentificationGroup::startGrouping (const GroupingType & grouping_type) {
p_protein_match->setGroupInstance(_group_store); p_protein_match->setGroupInstance(_group_store);
} }
qDebug() << "IdentificationGroup::startGrouping end ";
} }
...@@ -228,7 +228,7 @@ pappso::pappso_double ProteinMatch::getEvalue(const pappso::MsRunIdSp & sp_msrun ...@@ -228,7 +228,7 @@ pappso::pappso_double ProteinMatch::getEvalue(const pappso::MsRunIdSp & sp_msrun
if (p_peptide_match->getMsRunIdSp().get() == sp_msrun_id.get()) { if (p_peptide_match->getMsRunIdSp().get() == sp_msrun_id.get()) {
auto ret = map_sequence_evalue.insert(std::pair<QString, pappso::pappso_double>(sequence, evalue)); auto ret = map_sequence_evalue.insert(std::pair<QString, pappso::pappso_double>(sequence, evalue));
if (ret.second == false) { if (ret.second == false) {
if (ret.first->second < evalue) {//get best evalue for sequence if (ret.first->second > evalue) {//get best evalue for sequence
ret.first->second = evalue; ret.first->second = evalue;
} }
} }
...@@ -238,7 +238,7 @@ pappso::pappso_double ProteinMatch::getEvalue(const pappso::MsRunIdSp & sp_msrun ...@@ -238,7 +238,7 @@ pappso::pappso_double ProteinMatch::getEvalue(const pappso::MsRunIdSp & sp_msrun
//overall samples //overall samples
auto ret = map_sequence_evalue.insert(std::pair<QString, pappso::pappso_double>(sequence, evalue)); auto ret = map_sequence_evalue.insert(std::pair<QString, pappso::pappso_double>(sequence, evalue));
if (ret.second == false) { if (ret.second == false) {
if (ret.first->second < evalue) {//get best evalue for sequence if (ret.first->second > evalue) {//get best evalue for sequence
ret.first->second = evalue; ret.first->second = evalue;
} }
} }
......
...@@ -45,8 +45,8 @@ PeptideListWindow::PeptideListWindow(ProjectWindow *parent): ...@@ -45,8 +45,8 @@ PeptideListWindow::PeptideListWindow(ProjectWindow *parent):
ui->tableView->setSortingEnabled(true); ui->tableView->setSortingEnabled(true);
//connect(ui->tableView, SIGNAL(clicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableClicked(const QModelIndex &))); //connect(ui->tableView, SIGNAL(clicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableClicked(const QModelIndex &)));
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
// Qt5 code // Qt5 code
/* /*
...@@ -56,7 +56,12 @@ PeptideListWindow::PeptideListWindow(ProjectWindow *parent): ...@@ -56,7 +56,12 @@ PeptideListWindow::PeptideListWindow(ProjectWindow *parent):
*/ */
#else #else
// Qt4 code // Qt4 code
connect (this, SIGNAL(peptideDataChanged()), _peptide_table_model_p, SLOT(onPeptideDataChanged())); connect (_project_window, SIGNAL(identificationGroupGrouped(IdentificationGroup *)), this,SLOT(doIdentificationGroupGrouped(IdentificationGroup *)));
connect (this, SIGNAL(peptideDataChanged()), _peptide_table_model_p, SLOT(onPeptideDataChanged()));
connect(ui->tableView, SIGNAL(clicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableClicked(const QModelIndex &)));
/* /*
connect(&workerThread, SIGNAL(finished()), worker, SLOT(deleteLater())); connect(&workerThread, SIGNAL(finished()), worker, SLOT(deleteLater()));
connect(this, SIGNAL(operateMsDataFile(QString)), worker,SLOT(doMsDataFileLoad(QString))); connect(this, SIGNAL(operateMsDataFile(QString)), worker,SLOT(doMsDataFileLoad(QString)));
...@@ -79,10 +84,11 @@ PeptideListWindow::~PeptideListWindow() ...@@ -79,10 +84,11 @@ PeptideListWindow::~PeptideListWindow()
void PeptideListWindow::doIdentificationGroupGrouped(IdentificationGroup * p_identification_group) { void PeptideListWindow::doIdentificationGroupGrouped(IdentificationGroup * p_identification_group) {
} }
void PeptideListWindow::setProteinMatch(Project * p_project, ProteinMatch * p_protein_match) { void PeptideListWindow::setProteinMatch(IdentificationGroup * p_identification_group, ProteinMatch * p_protein_match) {
if (_p_protein_match != p_protein_match) { if (_p_protein_match != p_protein_match) {
_p_identification_group = p_identification_group;
_p_protein_match = p_protein_match; _p_protein_match = p_protein_match;
_peptide_table_model_p->setProteinMatch(p_project, p_protein_match); _peptide_table_model_p->setProteinMatch( p_protein_match);
_p_proxy_model->setSourceModel(_peptide_table_model_p); _p_proxy_model->setSourceModel(_peptide_table_model_p);
ui->proteinLabel->setText(p_protein_match->getProteinXtpSp().get()->getDescription()); ui->proteinLabel->setText(p_protein_match->getProteinXtpSp().get()->getDescription());
} }
......
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
explicit PeptideListWindow(ProjectWindow * parent = 0); explicit PeptideListWindow(ProjectWindow * parent = 0);
~PeptideListWindow(); ~PeptideListWindow();
void setProteinMatch(Project * p_project, ProteinMatch * p_protein_match); void setProteinMatch(IdentificationGroup * p_identification_group, ProteinMatch * p_protein_match);
void edited(); void edited();
public slots: public slots:
......
...@@ -39,9 +39,8 @@ PeptideTableModel::PeptideTableModel(QObject *parent) ...@@ -39,9 +39,8 @@ PeptideTableModel::PeptideTableModel(QObject *parent)
} }
void PeptideTableModel::setProteinMatch(Project * p_project, ProteinMatch * p_protein_match) { void PeptideTableModel::setProteinMatch(ProteinMatch * p_protein_match) {
qDebug() << "PeptideTableModel::setProteinMatch begin " ; qDebug() << "PeptideTableModel::setProteinMatch begin " ;
_p_project = p_project;
_p_protein_match = p_protein_match; _p_protein_match = p_protein_match;
QModelIndex topLeft = createIndex(0,0); QModelIndex topLeft = createIndex(0,0);
......
...@@ -39,7 +39,7 @@ public: ...@@ -39,7 +39,7 @@ public:
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
void setProteinMatch(Project * p_project, ProteinMatch * p_protein_match); void setProteinMatch(ProteinMatch * p_protein_match);
ProteinMatch * getProteinMatch(); ProteinMatch * getProteinMatch();
signals: signals:
void peptideMatchClicked(PeptideMatch * p_peptide_match); void peptideMatchClicked(PeptideMatch * p_peptide_match);
...@@ -50,7 +50,6 @@ public slots: ...@@ -50,7 +50,6 @@ public slots:
void onTableClicked(const QModelIndex &index); void onTableClicked(const QModelIndex &index);
private : private :
Project * _p_project;
ProteinMatch * _p_protein_match= nullptr; ProteinMatch * _p_protein_match= nullptr;
}; };
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#include "gui/protein_list_view/proteinlistwindow.h" #include "gui/protein_list_view/proteinlistwindow.h"
#include <QDebug> #include <QDebug>
#include <QApplication> #include <QApplication>
#include <QMessageBox>
#include <pappsomspp/pappsoexception.h>
ProjectWindow::ProjectWindow(MainWindow *parent): ProjectWindow::ProjectWindow(MainWindow *parent):
...@@ -74,20 +76,6 @@ void ProjectWindow::connectNewProteinListWindow() { ...@@ -74,20 +76,6 @@ void ProjectWindow::connectNewProteinListWindow() {
_p_current_protein_list_window = new ProteinListWindow(this); _p_current_protein_list_window = new ProteinListWindow(this);
_protein_list_window_collection.push_back(_p_current_protein_list_window); _protein_list_window_collection.push_back(_p_current_protein_list_window);
#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 (_p_current_protein_list_window, SIGNAL(proteinMatchDoubleClicked(ProteinMatch *)), this,SLOT(doViewProteinDetail(ProteinMatch *)));
connect (this, SIGNAL(identificationGroupGrouped(IdentificationGroup *)), _p_current_protein_list_window,SLOT(doIdentificationGroupGrouped(IdentificationGroup *)));
#endif
qDebug() << "ProjectWindow::connectNewProteinListWindow end"; qDebug() << "ProjectWindow::connectNewProteinListWindow end";
} }
...@@ -97,19 +85,6 @@ void ProjectWindow::connectNewProteinDetailWindow() { ...@@ -97,19 +85,6 @@ void ProjectWindow::connectNewProteinDetailWindow() {
_p_current_protein_detail_window = new ProteinWindow(this); _p_current_protein_detail_window = new ProteinWindow(this);
_protein_detail_window_collection.push_back(_p_current_protein_detail_window); _protein_detail_window_collection.push_back(_p_current_protein_detail_window);
#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 (_p_current_peptide_list_window, SIGNAL(proteinMatchClicked(ProteinMatch *)), this,SLOT(doViewPeptideList(ProteinMatch *)));
#endif
qDebug() << "ProjectWindow::connectNewProteinDetailWindow end"; qDebug() << "ProjectWindow::connectNewProteinDetailWindow end";
} }
...@@ -119,47 +94,62 @@ void ProjectWindow::connectNewPeptideListWindow() { ...@@ -119,47 +94,62 @@ void ProjectWindow::connectNewPeptideListWindow() {
_p_current_peptide_list_window = new PeptideListWindow(this); _p_current_peptide_list_window = new PeptideListWindow(this);
_peptide_list_window_collection.push_back(_p_current_peptide_list_window); _peptide_list_window_collection.push_back(_p_current_peptide_list_window);
#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 (_p_current_peptide_list_window, SIGNAL(proteinMatchClicked(ProteinMatch *)), this,SLOT(doViewPeptideList(ProteinMatch *)));
//connect (_p_current_peptide_list_window, SIGNAL(identificationGroupEdited(IdentificationGroup *)), this,SLOT(doIdentificationGroupEdited(IdentificationGroup *)));
// connect (this, SIGNAL(identificationGroupGrouped(IdentificationGroup *)), _p_current_peptide_list_window,SLOT(doIdentificationGroupGrouped(IdentificationGroup *)));
#endif
qDebug() << "ProjectWindow::connectNewPeptideListWindow end"; qDebug() << "ProjectWindow::connectNewPeptideListWindow end";
} }
void ProjectWindow::refreshGroup(IdentificationGroup * p_ident_group) { void ProjectWindow::refreshGroup(IdentificationGroup * p_ident_group) {
qDebug() << "ProjectWindow::refreshGroup begin"; qDebug() << "ProjectWindow::refreshGroup begin";
vector< MsRunIdSp > ms_run_list = p_ident_group->getMsRunIdSpList(); if (p_ident_group == nullptr) {
ui->sample_number_display->setText(QString("%1").arg(ms_run_list.size())); qDebug() << "ProjectWindow::refreshGroup p_ident_group == nullptr";
}
ui->group_number_display->setText(QString("%1").arg(p_ident_group->countGroup())); else {
ui->subgroup_number_display->setText(QString("%1").arg(p_ident_group->countSubGroup())); try {
ui->protein_number_display->setText(QString("%1").arg(p_ident_group->countGrouped())); vector< MsRunIdSp > ms_run_list = p_ident_group->getMsRunIdSpList();
emit identificationGroupGrouped(p_ident_group); ui->sample_number_display->setText(QString("%1").arg(ms_run_list.size()));
ui->group_number_display->setText(QString("%1").arg(p_ident_group->countGroup()));
ui->subgroup_number_display->setText(QString("%1").arg(p_ident_group->countSubGroup()));
ui->protein_number_display->setText(QString("%1").arg(p_ident_group->countGrouped()));
emit identificationGroupGrouped(p_ident_group);
}
catch (pappso::PappsoException exception_pappso) {
QMessageBox::warning(this,
tr("Unable to display project :"), exception_pappso.qwhat());
}
catch (std::exception exception_std) {
QMessageBox::warning(this,
tr("Unable to display project :"), exception_std.what());
}
}
qDebug() << "ProjectWindow::refreshGroup end"; qDebug() << "ProjectWindow::refreshGroup end";
} }
void ProjectWindow::doIdentificationGroupEdited(IdentificationGroup * p_ident_group) { void ProjectWindow::doIdentificationGroupEdited(IdentificationGroup * p_ident_group) {
qDebug() << "ProjectWindow::doIdentificationGroupEdited begin"; qDebug() << "ProjectWindow::doIdentificationGroupEdited begin " << p_ident_group;
p_ident_group->startGrouping(_project_sp.get()->getGroupingType()); if (p_ident_group == nullptr) {
qDebug() << "ProjectWindow::doIdentificationGroupEdited p_ident_group == nullptr";
}
refreshGroup(p_ident_group); else {
try {
p_ident_group->startGrouping(_project_sp.get()->getGroupingType());
}
catch (pappso::PappsoException exception_pappso) {
QMessageBox::warning(this,
tr("Error grouping project :"), exception_pappso.qwhat());
}
catch (std::exception exception_std) {
QMessageBox::warning(this,
tr("Error grouping project :"), exception_std.what());
}
refreshGroup(p_ident_group);
}
qDebug() << "ProjectWindow::doIdentificationGroupEdited end"; qDebug() << "ProjectWindow::doIdentificationGroupEdited end";
} }
void ProjectWindow::doViewPeptideList(ProteinMatch * protein_match) { void ProjectWindow::doViewPeptideList(IdentificationGroup * p_ident_group, ProteinMatch * protein_match) {
qDebug() << "ProjectWindow::doViewPeptideList begin"; qDebug() << "ProjectWindow::doViewPeptideList begin";
...@@ -172,7 +162,7 @@ void ProjectWindow::doViewPeptideList(ProteinMatch * protein_match) { ...@@ -172,7 +162,7 @@ void ProjectWindow::doViewPeptideList(ProteinMatch * protein_match) {
} }
_p_current_peptide_list_window->setProteinMatch(_project_sp.get(), protein_match); _p_current_peptide_list_window->setProteinMatch(p_ident_group, protein_match);
_p_current_peptide_list_window->show(); _p_current_peptide_list_window->show();
qDebug() << "ProjectWindow::doViewPeptideList end"; qDebug() << "ProjectWindow::doViewPeptideList end";
} }
......
...@@ -58,7 +58,7 @@ signals: ...@@ -58,7 +58,7 @@ signals:
//void peptideChanged(pappso::PeptideSp peptide); //void peptideChanged(pappso::PeptideSp peptide);
protected : protected :
void doViewPeptideList(ProteinMatch * protein_match); void doViewPeptideList(IdentificationGroup * p_ident_group, ProteinMatch * protein_match);
void doViewProteinDetail(ProteinMatch * protein_match); void doViewProteinDetail(ProteinMatch * protein_match);
void doViewPeptideDetail(PeptideMatch * peptide_match); void doViewPeptideDetail(PeptideMatch * peptide_match);
void doIdentificationGroupEdited(IdentificationGroup * p_identification_group); void doIdentificationGroupEdited(IdentificationGroup * p_identification_group);
......
...@@ -72,6 +72,8 @@ ProteinListWindow::ProteinListWindow(ProjectWindow *parent): ...@@ -72,6 +72,8 @@ ProteinListWindow::ProteinListWindow(ProjectWindow *parent):
*/ */
#else #else
// Qt4 code // Qt4 code
connect (_project_window, SIGNAL(identificationGroupGrouped(IdentificationGroup *)), this,SLOT(doIdentificationGroupGrouped(IdentificationGroup *)));
connect (this, SIGNAL(proteinDataChanged()), _protein_table_model_p, SLOT(onProteinDataChanged())); connect (this, SIGNAL(proteinDataChanged()), _protein_table_model_p, SLOT(onProteinDataChanged()));
connect(ui->tableView, SIGNAL(clicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableClicked(const QModelIndex &))); connect(ui->tableView, SIGNAL(clicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableClicked(const QModelIndex &)));
//connect(ui->tableView, SIGNAL(doubleClicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableDoubleClicked(const QModelIndex &))); //connect(ui->tableView, SIGNAL(doubleClicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableDoubleClicked(const QModelIndex &)));
...@@ -106,7 +108,7 @@ void ProteinListWindow::showAccessionColumn(bool show) { ...@@ -106,7 +108,7 @@ void ProteinListWindow::showAccessionColumn(bool show) {
void ProteinListWindow::askPeptideListView(ProteinMatch * p_protein_match) { void ProteinListWindow::askPeptideListView(ProteinMatch * p_protein_match) {
qDebug() << "ProteinListWindow::askPeptideListView begin"; qDebug() << "ProteinListWindow::askPeptideListView begin";
_project_window->doViewPeptideList(p_protein_match); _project_window->doViewPeptideList(_p_identification_group, p_protein_match);
qDebug() << "ProteinListWindow::askPeptideListView end"; qDebug() << "ProteinListWindow::askPeptideListView end";
//updateStatusBar(); //updateStatusBar();
} }
......
...@@ -32,6 +32,7 @@ ProteinWindow::ProteinWindow(ProjectWindow *parent): ...@@ -32,6 +32,7 @@ ProteinWindow::ProteinWindow(ProjectWindow *parent):
QMainWindow(parent), QMainWindow(parent),
ui(new Ui::ProteinDetailView) ui(new Ui::ProteinDetailView)
{ {
_p_project_window = parent;
ui->setupUi(this); ui->setupUi(this);
/* /*
*/ */
...@@ -46,6 +47,8 @@ ProteinWindow::ProteinWindow(ProjectWindow *parent): ...@@ -46,6 +47,8 @@ ProteinWindow::ProteinWindow(ProjectWindow *parent):
*/ */
#else #else
// Qt4 code // Qt4 code
connect (_p_project_window, SIGNAL(identificationGroupGrouped(IdentificationGroup *)), this,SLOT(doIdentificationGroupGrouped(IdentificationGroup *)));
//connect(_protein_table_model_p, SIGNAL(layoutChanged()), this, SLOT(updateStatusBar())); //connect(_protein_table_model_p, SIGNAL(layoutChanged()), this, SLOT(updateStatusBar()));
#endif #endif
} }
...@@ -54,16 +57,19 @@ ProteinWindow::~ProteinWindow() ...@@ -54,16 +57,19 @@ ProteinWindow::~ProteinWindow()
{ {
delete ui; delete ui;
} }
void ProteinWindow::doIdentificationGroupGrouped(IdentificationGroup * p_identification_group) {
updateDisplay();
}
void ProteinWindow::setProteinMatch(ProteinMatch * p_protein_match) { void ProteinWindow::updateDisplay() {
try { try {
ui->descriptionLabel->setText(p_protein_match->getProteinXtpSp().get()->getAccession()); ui->descriptionLabel->setText(_p_protein_match->getProteinXtpSp().get()->getAccession());
//ui->sequenceLabel->setText(p_protein_match->getProteinXtpSp().get()->getSequence()); //ui->sequenceLabel->setText(_p_protein_match->getProteinXtpSp().get()->getSequence());
ui->sequenceTextEdit->setText(p_protein_match->getHtmlSequence()); ui->sequenceTextEdit->setText(_p_protein_match->getHtmlSequence());
ui->coverage_label->setText(QString("%1 %").arg(p_protein_match->getCoverage()*100)); ui->coverage_label->setText(QString("%1 %").arg(_p_protein_match->getCoverage()*100));
pappso::Peptide peptide(p_protein_match->getProteinXtpSp().get()->getSequence()); pappso::Peptide peptide(_p_protein_match->getProteinXtpSp().get()->getSequence());
ui->mw_label->setText(QString("%1 kDa").arg(peptide.getMass()/1000)); 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()))); 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) { catch (pappso::PappsoException exception_pappso) {
QMessageBox::warning(this, QMessageBox::warning(this,
...@@ -73,4 +79,10 @@ void ProteinWindow::setProteinMatch(ProteinMatch * p_protein_match) { ...@@ -73,4 +79,10 @@ void ProteinWindow::setProteinMatch(ProteinMatch * p_protein_match) {
QMessageBox::warning(this, QMessageBox::warning(this,
tr("Unable to display protein details :"), exception_std.what()); tr("Unable to display protein details :"), exception_std.what());
} }
}
void ProteinWindow::setProteinMatch(ProteinMatch * p_protein_match) {
_p_protein_match = p_protein_match;
updateDisplay();
} }
...@@ -42,9 +42,18 @@ public: ...@@ -42,9 +42,18 @@ public:
explicit ProteinWindow(ProjectWindow * parent = 0); explicit ProteinWindow(ProjectWindow * parent = 0);
~ProteinWindow(); ~ProteinWindow();
void setProteinMatch(ProteinMatch * p_protein_match); void setProteinMatch(ProteinMatch * p_protein_match);
public slots:
void doIdentificationGroupGrouped(IdentificationGroup * p_identification_group);
protected :
void updateDisplay();
private: private:
Ui::ProteinDetailView *ui; Ui::ProteinDetailView *ui;
QTextDocument sequence_text; QTextDocument sequence_text;
ProjectWindow * _p_project_window;
ProteinMatch * _p_protein_match = nullptr;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment