From d67b8ba81ff324ed986b21f303347f89718a0d16 Mon Sep 17 00:00:00 2001 From: Olivier Langella <Olivier.Langella@moulon.inra.fr> Date: Sat, 1 Apr 2017 12:32:44 +0200 Subject: [PATCH] protein match validation OK --- src/core/proteinmatch.cpp | 5 ++++- src/gui/protein_list_view/proteintablemodel.cpp | 6 +++--- src/gui/protein_list_view/proteintableproxymodel.cpp | 12 ++++++------ src/gui/protein_view/protein_detail_view.ui | 6 ++++++ src/gui/protein_view/proteinwindow.cpp | 1 + 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/core/proteinmatch.cpp b/src/core/proteinmatch.cpp index 98b5a7ee..013d1968 100644 --- a/src/core/proteinmatch.cpp +++ b/src/core/proteinmatch.cpp @@ -69,7 +69,10 @@ void ProteinMatch::updateAutomaticFilters(const AutomaticFilterParameters & auto } } - if (number_of_valid_peptides > 0) { + if (number_of_valid_peptides == 0) { + + _proxy_valid = false; + } else { if (number_of_valid_peptides < automatic_filter_parameters.getFilterMinimumPeptidePerMatch()) { } diff --git a/src/gui/protein_list_view/proteintablemodel.cpp b/src/gui/protein_list_view/proteintablemodel.cpp index 2a7dea5b..f09913a0 100644 --- a/src/gui/protein_list_view/proteintablemodel.cpp +++ b/src/gui/protein_list_view/proteintablemodel.cpp @@ -54,15 +54,15 @@ void ProteinTableModel::setIdentificationGroup(IdentificationGroup * p_identific int ProteinTableModel::rowCount(const QModelIndex &parent ) const { - qDebug() << "ProteinTableModel::rowCount begin "; + //qDebug() << "ProteinTableModel::rowCount begin "; 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 (int) _p_identification_group->getProteinMatchList().size(); } return 0; } int ProteinTableModel::columnCount(const QModelIndex &parent ) const { - qDebug() << "ProteinTableModel::columnCount begin "; + //qDebug() << "ProteinTableModel::columnCount begin "; if (_p_identification_group != nullptr) { return _columns.size(); } diff --git a/src/gui/protein_list_view/proteintableproxymodel.cpp b/src/gui/protein_list_view/proteintableproxymodel.cpp index 584865cc..e447e879 100644 --- a/src/gui/protein_list_view/proteintableproxymodel.cpp +++ b/src/gui/protein_list_view/proteintableproxymodel.cpp @@ -35,9 +35,9 @@ ProteinTableProxyModel::ProteinTableProxyModel(ProteinListWindow * p_protein_lis bool ProteinTableProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const { try { - qDebug() << "ProteinTableProxyModel::filterAcceptsRow begin " << source_row; + //qDebug() << "ProteinTableProxyModel::filterAcceptsRow begin " << source_row; ProteinMatch * protein_match = _protein_table_model_p->getIdentificationGroup()->getProteinMatchList().at(source_row); - qDebug() << "ProteinTableProxyModel::filterAcceptsRow protein_match " << source_row; + //qDebug() << "ProteinTableProxyModel::filterAcceptsRow protein_match " << source_row; if (!_protein_search_string.isEmpty()) { if (!protein_match->getProteinXtpSp().get()->getDescription().contains(_protein_search_string)) { @@ -45,27 +45,27 @@ bool ProteinTableProxyModel::filterAcceptsRow(int source_row, } } - qDebug() << "ProteinTableProxyModel::filterAcceptsRow valid "; + //qDebug() << "ProteinTableProxyModel::filterAcceptsRow valid "; if (_hide_not_valid) { if (! protein_match->isValid()) { return false; } } - qDebug() << "ProteinTableProxyModel::filterAcceptsRow checked "; + //qDebug() << "ProteinTableProxyModel::filterAcceptsRow checked "; if (_hide_not_checked) { if (! protein_match->isChecked()) { return false; } } - qDebug() << "ProteinTableProxyModel::filterAcceptsRow grouped "; + //qDebug() << "ProteinTableProxyModel::filterAcceptsRow grouped "; pappso::GrpProtein * p_grp_prot = protein_match->getGrpProteinSp().get(); if (_hide_not_grouped) { if (p_grp_prot == nullptr) { return false; } - qDebug() << "ProteinTableProxyModel::filterAcceptsRow grouped 2"; + //qDebug() << "ProteinTableProxyModel::filterAcceptsRow grouped 2"; if (p_grp_prot->getGroupingId().isEmpty()) { return false; } diff --git a/src/gui/protein_view/protein_detail_view.ui b/src/gui/protein_view/protein_detail_view.ui index 026af897..1695aee6 100644 --- a/src/gui/protein_view/protein_detail_view.ui +++ b/src/gui/protein_view/protein_detail_view.ui @@ -59,9 +59,15 @@ </item> <item> <widget class="QCheckBox" name="validCheckBox"> + <property name="enabled"> + <bool>false</bool> + </property> <property name="text"> <string>valid</string> </property> + <property name="checkable"> + <bool>true</bool> + </property> </widget> </item> </layout> diff --git a/src/gui/protein_view/proteinwindow.cpp b/src/gui/protein_view/proteinwindow.cpp index 8da3bcb8..1df41309 100644 --- a/src/gui/protein_view/proteinwindow.cpp +++ b/src/gui/protein_view/proteinwindow.cpp @@ -63,6 +63,7 @@ void ProteinWindow::doIdentificationGroupGrouped(IdentificationGroup * p_identif void ProteinWindow::updateDisplay() { try { + ui->validCheckBox->setCheckState(Qt::Unchecked); if (_p_protein_match->isValid()) ui->validCheckBox->setCheckState(Qt::Checked); ui->descriptionLabel->setText(_p_protein_match->getProteinXtpSp().get()->getAccession()); //ui->sequenceLabel->setText(_p_protein_match->getProteinXtpSp().get()->getSequence()); -- GitLab