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

bug linked to protein search and peptide list : unknown

parent e3d6a1a9
No related branches found
No related tags found
No related merge requests found
......@@ -53,13 +53,13 @@ PeptideListWindow::PeptideListWindow(QWidget *parent):
_peptide_table_model_p = new PeptideTableModel(0);
_p_proxy_model = new PeptideTableProxyModel(this, _peptide_table_model_p);
_p_proxy_model = new PeptideTableProxyModel(this, _peptide_table_model_p);
_p_proxy_model->setSourceModel(_peptide_table_model_p);
_p_proxy_model->setDynamicSortFilter(true);
ui->tableView->setModel( _p_proxy_model );
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 &)));
}
PeptideListWindow::~PeptideListWindow()
......@@ -70,8 +70,11 @@ PeptideListWindow::~PeptideListWindow()
}
void PeptideListWindow::doIdentificationGroupGrouped(IdentificationGroup * p_identification_group) {
}
void PeptideListWindow::setProteinMatch(Project * p_project, ProteinMatch * p_protein_match) {
if (_p_protein_match != p_protein_match) {
if (_p_protein_match != p_protein_match) {
_p_protein_match = p_protein_match;
_peptide_table_model_p->setProteinMatch(p_project, p_protein_match);
_p_proxy_model->setSourceModel(_peptide_table_model_p);
......
......@@ -47,7 +47,9 @@ public slots:
//void peptideEdited(QString peptideStr);
// void setColor(const QColor &color);
// void setShape(Shape shape);
void doIdentificationGroupGrouped(IdentificationGroup * p_identification_group);
signals:
void identificationGroupEdited(IdentificationGroup * p_identification_group);
//void peptideChanged(pappso::PeptideSp peptide);
private:
......
......@@ -92,7 +92,7 @@ void PeptideTableModel::setProteinMatch(Project * p_project, ProteinMatch * p_pr
int PeptideTableModel::rowCount(const QModelIndex &parent ) const {
if (_p_protein_match != nullptr) {
qDebug() << "PeptideTableModel::rowCount(const QModelIndex &parent ) " << _p_protein_match->getPeptideMatchList().size();
//qDebug() << "PeptideTableModel::rowCount(const QModelIndex &parent ) " << _p_protein_match->getPeptideMatchList().size();
return _p_protein_match->getPeptideMatchList().size();
}
return 0;
......@@ -146,8 +146,8 @@ QVariant PeptideTableModel::data(const QModelIndex &index, int role ) const {
// generate a log message when this method gets called
int row = index.row();
int col = index.column();
qDebug() << QString("row %1, col%2, role %3")
.arg(row).arg(col).arg(role);
//qDebug() << QString("row %1, col%2, role %3")
// .arg(row).arg(col).arg(role);
switch(role) {
case Qt::CheckStateRole:
......
......@@ -131,8 +131,8 @@ void ProjectWindow::connectNewPeptideListWindow() {
#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 *)));
//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
......
......@@ -27,6 +27,8 @@
#include "../../grouping/groupinggroup.h"
#include <QDebug>
#include <pappsomspp/pappsoexception.h>
#include <QMessageBox>
ProteinTableProxyModel::ProteinTableProxyModel(ProteinListWindow * p_protein_list_window, ProteinTableModel* protein_table_model_p): QSortFilterProxyModel(protein_table_model_p)
......@@ -44,6 +46,7 @@ void ProteinTableProxyModel::onTableClicked(const QModelIndex &index)
{
qDebug() << "ProteinTableProxyModel::onTableClicked begin " << index.row();
qDebug() << "ProteinTableProxyModel::onTableClicked begin " << this->mapToSource(index).row();
_protein_table_model_p->onTableClicked(this->mapToSource(index));
}
void ProteinTableProxyModel::onTableDoubleClicked(const QModelIndex &index)
......@@ -143,7 +146,7 @@ void ProteinTableModel::setIdentificationGroup(IdentificationGroup * p_identific
int ProteinTableModel::rowCount(const QModelIndex &parent ) const {
if (_p_identification_group != nullptr) {
qDebug() << "ProteinTableModel::rowCount(const QModelIndex &parent ) " << _p_identification_group->getProteinMatchList().size();
//qDebug() << "ProteinTableModel::rowCount(const QModelIndex &parent ) " << _p_identification_group->getProteinMatchList().size();
return _p_identification_group->getProteinMatchList().size();
}
return 0;
......@@ -189,8 +192,8 @@ QVariant ProteinTableModel::data(const QModelIndex &index, int role ) const {
// generate a log message when this method gets called
int row = index.row();
int col = index.column();
qDebug() << QString("row %1, col%2, role %3")
.arg(row).arg(col).arg(role);
// qDebug() << QString("row %1, col%2, role %3")
// .arg(row).arg(col).arg(role);
switch(role) {
......@@ -304,31 +307,43 @@ void ProteinTableModel::onTableDoubleClicked(const QModelIndex &index)
}
bool ProteinTableModel::acceptRow(int source_row) {
ProteinMatch * protein_match = _p_identification_group->getProteinMatchList().at(source_row);
if (!_protein_search_string.isEmpty()) {
if (!protein_match->getProteinXtpSp().get()->getDescription().contains(_protein_search_string)) {
return false;
try {
ProteinMatch * protein_match = _p_identification_group->getProteinMatchList().at(source_row);
if (!_protein_search_string.isEmpty()) {
if (!protein_match->getProteinXtpSp().get()->getDescription().contains(_protein_search_string)) {
return false;
}
}
}
if (_hide_not_valid) {
if (! protein_match->isValid()) {
return false;
if (_hide_not_valid) {
if (! protein_match->isValid()) {
return false;
}
}
}
if (_hide_not_checked) {
if (! protein_match->isChecked()) {
return false;
if (_hide_not_checked) {
if (! protein_match->isChecked()) {
return false;
}
}
}
if (_hide_not_grouped) {
pappso::GrpProtein * p_grp_prot = protein_match->getGrpProteinSp().get();
if (p_grp_prot == nullptr) {
return false;
if (_hide_not_grouped) {
if (p_grp_prot == nullptr)
return false;
}
if (p_grp_prot->getGroupingId().isEmpty()) {
return false;
}
}
catch (pappso::PappsoException exception_pappso) {
//QMessageBox::warning(this,
// tr("Error in ProteinTableModel::acceptRow :"), exception_pappso.qwhat());
qDebug() << "Error in ProteinTableModel::acceptRow :" << exception_pappso.qwhat();
}
catch (std::exception exception_std) {
//QMessageBox::warning(this,
// tr("Error in ProteinTableModel::acceptRow :"), exception_std.what());
qDebug() << "Error in ProteinTableModel::acceptRow :" << exception_std.what();
}
return true;
}
......@@ -24,6 +24,8 @@
#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),
......@@ -53,11 +55,21 @@ ProteinWindow::~ProteinWindow()
}
void ProteinWindow::setProteinMatch(ProteinMatch * p_protein_match) {
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(log10(p_protein_match->getEvalue())));
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(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());
}
}
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