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

WIP: replacing decoy selection with new widget

parent 57061e97
No related branches found
No related tags found
No related merge requests found
...@@ -174,61 +174,13 @@ ...@@ -174,61 +174,13 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <widget class="DecoyWidget" name="decoy_widget" native="true">
<item> <property name="minimumSize">
<widget class="QRadioButton" name="decoy_database_files_radiobutton"> <size>
<property name="toolTip"> <width>10</width>
<string>select decoy sequences from fasta files</string> <height>10</height>
</property> </size>
<property name="text">
<string>data&amp;base files</string>
</property>
<attribute name="buttonGroup">
<string notr="true">decoy_source_buttongroup</string>
</attribute>
</widget>
</item>
<item>
<widget class="QRadioButton" name="decoy_regexp_radiobutton">
<property name="toolTip">
<string>select decoy sequences based on a regular expression</string>
</property>
<property name="text">
<string>&amp;regular expression</string>
</property>
<attribute name="buttonGroup">
<string notr="true">decoy_source_buttongroup</string>
</attribute>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="decoy_database_groupbox">
<property name="title">
<string>Choose decoy database files</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QListView" name="decoy_database_listview"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="decoy_regexp_groupbox">
<property name="title">
<string>Set regular expression to select decoy proteins</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLineEdit" name="decoy_protein_regexp_line_edit">
<property name="placeholderText">
<string>.*\\|reversed$</string>
</property>
</widget>
</item>
</layout>
</widget> </widget>
</item> </item>
<item> <item>
...@@ -412,6 +364,15 @@ ...@@ -412,6 +364,15 @@
<signal>changed()</signal> <signal>changed()</signal>
</slots> </slots>
</customwidget> </customwidget>
<customwidget>
<class>DecoyWidget</class>
<extends>QWidget</extends>
<header>gui/widgets/decoy_widget/decoywidget.h</header>
<container>1</container>
<slots>
<signal>changed()</signal>
</slots>
</customwidget>
</customwidgets> </customwidgets>
<resources/> <resources/>
<connections> <connections>
...@@ -422,8 +383,8 @@ ...@@ -422,8 +383,8 @@
<slot>doFdrChanged()</slot> <slot>doFdrChanged()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>119</x> <x>448</x>
<y>104</y> <y>219</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>484</x> <x>484</x>
...@@ -464,66 +425,50 @@ ...@@ -464,66 +425,50 @@
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>decoy_database_files_radiobutton</sender> <sender>contaminant_widget</sender>
<signal>clicked()</signal> <signal>changed()</signal>
<receiver>ProjectView</receiver> <receiver>ProjectView</receiver>
<slot>doSelectDecoySource()</slot> <slot>doFilterChanged()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>68</x> <x>119</x>
<y>104</y> <y>104</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>682</x> <x>815</x>
<y>256</y> <y>196</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>decoy_regexp_radiobutton</sender> <sender>apply_filter_button</sender>
<signal>clicked()</signal> <signal>clicked()</signal>
<receiver>ProjectView</receiver> <receiver>ProjectView</receiver>
<slot>doSelectDecoySource()</slot> <slot>doApplyFilter()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>119</x> <x>119</x>
<y>104</y> <y>104</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>693</x> <x>689</x>
<y>239</y> <y>147</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>contaminant_widget</sender> <sender>decoy_widget</sender>
<signal>changed()</signal> <signal>changed()</signal>
<receiver>ProjectView</receiver> <receiver>ProjectView</receiver>
<slot>doFilterChanged()</slot> <slot>doFilterChanged()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>368</x> <x>180</x>
<y>99</y> <y>182</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>815</x> <x>763</x>
<y>196</y> <y>179</y>
</hint>
</hints>
</connection>
<connection>
<sender>apply_filter_button</sender>
<signal>clicked()</signal>
<receiver>ProjectView</receiver>
<slot>doApplyFilter()</slot>
<hints>
<hint type="sourcelabel">
<x>412</x>
<y>120</y>
</hint>
<hint type="destinationlabel">
<x>689</x>
<y>147</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
...@@ -537,7 +482,4 @@ ...@@ -537,7 +482,4 @@
<slot>doFilterChanged()</slot> <slot>doFilterChanged()</slot>
<slot>doApplyFilter()</slot> <slot>doApplyFilter()</slot>
</slots> </slots>
<buttongroups>
<buttongroup name="decoy_source_buttongroup"/>
</buttongroups>
</ui> </ui>
...@@ -50,11 +50,6 @@ ProjectWindow::ProjectWindow(MainWindow *parent) ...@@ -50,11 +50,6 @@ ProjectWindow::ProjectWindow(MainWindow *parent)
p_worker->moveToThread(&_worker_thread); p_worker->moveToThread(&_worker_thread);
_worker_thread.start(); _worker_thread.start();
_p_fasta_str_li = new QStandardItemModel();
ui->decoy_database_listview->setModel(_p_fasta_str_li);
ui->decoy_database_listview->setSelectionMode(
QAbstractItemView::MultiSelection);
_p_edit_modifications = new EditModifications(this); _p_edit_modifications = new EditModifications(this);
_p_edit_label_methods = new EditLabelMethods(this); _p_edit_label_methods = new EditLabelMethods(this);
...@@ -89,12 +84,21 @@ ProjectWindow::ProjectWindow(MainWindow *parent) ...@@ -89,12 +84,21 @@ ProjectWindow::ProjectWindow(MainWindow *parent)
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
// Qt5 code // Qt5 code
connect(ui->filter_parameter_widget, connect(ui->filter_parameter_widget,
&AutomaticFilterWidget::automaticFilterParametersChanged, this, &AutomaticFilterWidget::automaticFilterParametersChanged,
this,
&ProjectWindow::doAutomaticFilterParametersChanged); &ProjectWindow::doAutomaticFilterParametersChanged);
connect(ui->contaminant_widget, &ContaminantWidget::changed, this, connect(ui->contaminant_widget,
&ContaminantWidget::changed,
this,
&ProjectWindow::doContaminantSelectionChanged); &ProjectWindow::doContaminantSelectionChanged);
connect(ui->decoy_widget,
&DecoyWidget::changed,
this,
&ProjectWindow::doDecoySelectionChanged);
connect(_p_edit_label_methods, &EditLabelMethods::accepted, this, connect(_p_edit_label_methods,
&EditLabelMethods::accepted,
this,
&ProjectWindow::doAcceptedLabelingMethod); &ProjectWindow::doAcceptedLabelingMethod);
#else #else
...@@ -106,7 +110,9 @@ ProjectWindow::ProjectWindow(MainWindow *parent) ...@@ -106,7 +110,9 @@ ProjectWindow::ProjectWindow(MainWindow *parent)
this, this,
SLOT(doAutomaticFilterParametersChanged(AutomaticFilterParameters))); SLOT(doAutomaticFilterParametersChanged(AutomaticFilterParameters)));
connect(_p_edit_label_methods, SIGNAL(accepted()), this, connect(_p_edit_label_methods,
SIGNAL(accepted()),
this,
SLOT(doAcceptedLabelingMethod())); SLOT(doAcceptedLabelingMethod()));
// connect(this, SIGNAL(operateGrouping(ProjectSp)), // connect(this, SIGNAL(operateGrouping(ProjectSp)),
...@@ -217,13 +223,13 @@ ProjectWindow::refreshPtmGroup(IdentificationGroup *p_ident_group) ...@@ -217,13 +223,13 @@ ProjectWindow::refreshPtmGroup(IdentificationGroup *p_ident_group)
} }
catch(pappso::PappsoException exception_pappso) catch(pappso::PappsoException exception_pappso)
{ {
QMessageBox::warning(this, tr("Unable to display project :"), QMessageBox::warning(
exception_pappso.qwhat()); this, tr("Unable to display project :"), exception_pappso.qwhat());
} }
catch(std::exception exception_std) catch(std::exception exception_std)
{ {
QMessageBox::warning(this, tr("Unable to display project :"), QMessageBox::warning(
exception_std.what()); this, tr("Unable to display project :"), exception_std.what());
} }
} }
qDebug() << "ProjectWindow::refreshPtmGroup end"; qDebug() << "ProjectWindow::refreshPtmGroup end";
...@@ -245,13 +251,13 @@ ProjectWindow::refreshGroup(IdentificationGroup *p_ident_group) ...@@ -245,13 +251,13 @@ ProjectWindow::refreshGroup(IdentificationGroup *p_ident_group)
} }
catch(pappso::PappsoException exception_pappso) catch(pappso::PappsoException exception_pappso)
{ {
QMessageBox::warning(this, tr("Unable to display project :"), QMessageBox::warning(
exception_pappso.qwhat()); this, tr("Unable to display project :"), exception_pappso.qwhat());
} }
catch(std::exception exception_std) catch(std::exception exception_std)
{ {
QMessageBox::warning(this, tr("Unable to display project :"), QMessageBox::warning(
exception_std.what()); this, tr("Unable to display project :"), exception_std.what());
} }
} }
qDebug() << "ProjectWindow::refreshGroup end"; qDebug() << "ProjectWindow::refreshGroup end";
...@@ -284,13 +290,13 @@ ProjectWindow::computeFdr() ...@@ -284,13 +290,13 @@ ProjectWindow::computeFdr()
} }
catch(pappso::PappsoException exception_pappso) catch(pappso::PappsoException exception_pappso)
{ {
QMessageBox::warning(this, tr("Unable to compute FDR :"), QMessageBox::warning(
exception_pappso.qwhat()); this, tr("Unable to compute FDR :"), exception_pappso.qwhat());
} }
catch(std::exception exception_std) catch(std::exception exception_std)
{ {
QMessageBox::warning(this, tr("Unable to compute FDR :"), QMessageBox::warning(
exception_std.what()); this, tr("Unable to compute FDR :"), exception_std.what());
} }
qDebug() << "ProjectWindow::computeFdr end"; qDebug() << "ProjectWindow::computeFdr end";
} }
...@@ -375,7 +381,8 @@ ProjectWindow::computeMassPrecision() ...@@ -375,7 +381,8 @@ ProjectWindow::computeMassPrecision()
ui->mass_precision_mean_label->setText("0"); ui->mass_precision_mean_label->setText("0");
ui->mass_precision_median_label->setText("0"); ui->mass_precision_median_label->setText("0");
ui->mass_precision_sd_label->setText("0"); ui->mass_precision_sd_label->setText("0");
QMessageBox::warning(this, tr("Unable to compute mass precision :"), QMessageBox::warning(this,
tr("Unable to compute mass precision :"),
exception_pappso.qwhat()); exception_pappso.qwhat());
} }
catch(std::exception exception_std) catch(std::exception exception_std)
...@@ -383,8 +390,8 @@ ProjectWindow::computeMassPrecision() ...@@ -383,8 +390,8 @@ ProjectWindow::computeMassPrecision()
ui->mass_precision_mean_label->setText("0"); ui->mass_precision_mean_label->setText("0");
ui->mass_precision_median_label->setText("0"); ui->mass_precision_median_label->setText("0");
ui->mass_precision_sd_label->setText("0"); ui->mass_precision_sd_label->setText("0");
QMessageBox::warning(this, tr("Unable to compute mass precision :"), QMessageBox::warning(
exception_std.what()); this, tr("Unable to compute mass precision :"), exception_std.what());
} }
qDebug() << "ProjectWindow::computeMassPrecision end"; qDebug() << "ProjectWindow::computeMassPrecision end";
} }
...@@ -439,14 +446,14 @@ ProjectWindow::doFdrChanged() ...@@ -439,14 +446,14 @@ ProjectWindow::doFdrChanged()
catch(pappso::PappsoException exception_pappso) catch(pappso::PappsoException exception_pappso)
{ {
hideWaitingMessage(); hideWaitingMessage();
QMessageBox::warning(this, tr("Unable to compute FDR :"), QMessageBox::warning(
exception_pappso.qwhat()); this, tr("Unable to compute FDR :"), exception_pappso.qwhat());
} }
catch(std::exception exception_std) catch(std::exception exception_std)
{ {
hideWaitingMessage(); hideWaitingMessage();
QMessageBox::warning(this, tr("Unable to compute FDR :"), QMessageBox::warning(
exception_std.what()); this, tr("Unable to compute FDR :"), exception_std.what());
} }
qDebug() << "ProjectWindow::doFdrChanged end "; qDebug() << "ProjectWindow::doFdrChanged end ";
...@@ -964,6 +971,44 @@ void ...@@ -964,6 +971,44 @@ void
ProjectWindow::doFilterChanged() ProjectWindow::doFilterChanged()
{ {
ui->apply_filter_button->setEnabled(true); ui->apply_filter_button->setEnabled(true);
ui->fdr_button->setEnabled(true);
}
void
ProjectWindow::doApplyDecoy()
{
ui->fdr_button->setEnabled(false);
// doAutomaticFilterParametersChanged(automatic_filter);
try
{
showWaitingMessage(tr("Updating decoy sequences"));
doDisplayLoadingMessage(tr("tagging decoy proteins"));
ui->decoy_widget->setProjectDecoys(_project_sp.get());
// doDisplayLoadingMessage(tr("updating FDR"));
//_project_sp.get()->updateAutomaticFilters(automatic_filter);
doDisplayLoadingMessage(tr("updating filters"));
_project_sp.get()->updateAutomaticFilters(
_project_sp.get()->getAutomaticFilterParameters());
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
emit operateGrouping(_project_sp);
}
catch(pappso::PappsoException exception_pappso)
{
hideWaitingMessage();
QMessageBox::warning(
this, tr("Error filtering results :"), exception_pappso.qwhat());
}
catch(std::exception exception_std)
{
hideWaitingMessage();
QMessageBox::warning(
this, tr("Error filtering results :"), exception_std.what());
}
} }
void void
...@@ -983,20 +1028,19 @@ ProjectWindow::doApplyFilter() ...@@ -983,20 +1028,19 @@ ProjectWindow::doApplyFilter()
doDisplayLoadingMessage(tr("updating filters")); doDisplayLoadingMessage(tr("updating filters"));
_project_sp.get()->updateAutomaticFilters(automatic_filter); _project_sp.get()->updateAutomaticFilters(automatic_filter);
qDebug() << "ProjectWindow::doAutomaticFilterParametersChanged emit " qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
"operateGrouping(_project_sp) ";
emit operateGrouping(_project_sp); emit operateGrouping(_project_sp);
} }
catch(pappso::PappsoException exception_pappso) catch(pappso::PappsoException exception_pappso)
{ {
hideWaitingMessage(); hideWaitingMessage();
QMessageBox::warning(this, tr("Error filtering results :"), QMessageBox::warning(
exception_pappso.qwhat()); this, tr("Error filtering results :"), exception_pappso.qwhat());
} }
catch(std::exception exception_std) catch(std::exception exception_std)
{ {
hideWaitingMessage(); hideWaitingMessage();
QMessageBox::warning(this, tr("Error filtering results :"), QMessageBox::warning(
exception_std.what()); this, tr("Error filtering results :"), exception_std.what());
} }
} }
...@@ -17,13 +17,9 @@ ...@@ -17,13 +17,9 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>. * along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
* *
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and
*implementation
******************************************************************************/ ******************************************************************************/
#ifndef PROJECTWINDOW_H #pragma once
#define PROJECTWINDOW_H
#include <QMainWindow> #include <QMainWindow>
#include <QThread> #include <QThread>
...@@ -46,7 +42,7 @@ class MainWindow; ...@@ -46,7 +42,7 @@ class MainWindow;
// http://doc.qt.io/qt-4.8/qt-itemviews-chart-mainwindow-cpp.html // http://doc.qt.io/qt-4.8/qt-itemviews-chart-mainwindow-cpp.html
namespace Ui namespace Ui
{ {
class ProjectView; class ProjectView;
} }
class ProjectWindow : public QMainWindow class ProjectWindow : public QMainWindow
...@@ -107,6 +103,7 @@ class ProjectWindow : public QMainWindow ...@@ -107,6 +103,7 @@ class ProjectWindow : public QMainWindow
void doViewProteinDetail(ProteinMatch *protein_match); void doViewProteinDetail(ProteinMatch *protein_match);
void doIdentificationGroupEdited(IdentificationGroup *p_identification_group); void doIdentificationGroupEdited(IdentificationGroup *p_identification_group);
void doContaminantSelectionChanged(); void doContaminantSelectionChanged();
void doDecoySelectionChanged();
void computeFdr(); void computeFdr();
void computeMassPrecision(); void computeMassPrecision();
...@@ -150,5 +147,3 @@ class ProjectWindow : public QMainWindow ...@@ -150,5 +147,3 @@ class ProjectWindow : public QMainWindow
// QCPBars *_p_bars; // QCPBars *_p_bars;
}; };
#endif // PROJECTWINDOW_H
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