diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b277f5212949b43591942dba111516c992cc365d..997cc17ad0f508ceca8dc213510cd90948252353 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -87,6 +87,7 @@ SET(XTPCPP_SRCS ./gui/peptide_list_view/peptidelistwindow.cpp ./gui/peptide_list_view/peptidetablemodel.cpp ./gui/peptide_list_view/peptidetableproxymodel.cpp + ./gui/project_view/automatic_filter_widget/automaticfilterwidget.cpp ./gui/project_view/identification_group_widget/identificationgroupwidget.cpp ./gui/project_view/projectwindow.cpp ./gui/protein_view/proteinwindow.cpp @@ -99,6 +100,7 @@ SET (GUI_UIS ./gui/main.ui ./gui/peptide_detail_view/peptide_detail_view.ui ./gui/peptide_list_view/peptide_view.ui + ./gui/project_view/automatic_filter_widget/automatic_filter_widget.ui ./gui/project_view/identification_group_widget/identification_group_widget.ui ./gui/project_view/project_view.ui ./gui/protein_list_view/protein_view.ui @@ -113,6 +115,7 @@ SET(XTPCPP_MOC_HDRS ./gui/peptide_list_view/peptidelistwindow.h ./gui/peptide_list_view/peptidetablemodel.h ./gui/peptide_list_view/peptidetableproxymodel.h + ./gui/project_view/automatic_filter_widget/automaticfilterwidget.h ./gui/project_view/identification_group_widget/identificationgroupwidget.h ./gui/project_view/projectwindow.h ./gui/protein_list_view/proteinlistwindow.h diff --git a/src/gui/project_view/automatic_filter_widget/automatic_filter_widget.ui b/src/gui/project_view/automatic_filter_widget/automatic_filter_widget.ui new file mode 100644 index 0000000000000000000000000000000000000000..d963ac39f1d35dcbdfe2d0cf86948a3e179ae3bd --- /dev/null +++ b/src/gui/project_view/automatic_filter_widget/automatic_filter_widget.ui @@ -0,0 +1,203 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>AutomaticFilterWidget</class> + <widget class="QWidget" name="AutomaticFilterWidget"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>533</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <layout class="QFormLayout" name="formLayout_1"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::AllNonFixedFieldsGrow</enum> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="sample_number_label"> + <property name="text"> + <string>peptide Evalue</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="group_number_label"> + <property name="text"> + <string>number of peptides per protein</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="subgroup_number_label"> + <property name="text"> + <string>protein Evalue</string> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>protein Evalue (log10)</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QDoubleSpinBox" name="peptide_evalue_spinbox"> + <property name="decimals"> + <number>3</number> + </property> + <property name="maximum"> + <double>1.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.010000000000000</double> + </property> + <property name="value"> + <double>0.050000000000000</double> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QSpinBox" name="peptide_number_spinbox"> + <property name="minimum"> + <number>1</number> + </property> + <property name="value"> + <number>2</number> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QDoubleSpinBox" name="protein_evalue_spinbox"> + <property name="decimals"> + <number>8</number> + </property> + <property name="maximum"> + <double>1.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.000001000000000</double> + </property> + <property name="value"> + <double>0.000100000000000</double> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QDoubleSpinBox" name="protein_evalue_log_spinbox"> + <property name="maximum"> + <double>0.000000000000000</double> + </property> + <property name="value"> + <double>-3.000000000000000</double> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QPushButton" name="set_param_button"> + <property name="text"> + <string>set parameters</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>peptide_evalue_spinbox</sender> + <signal>valueChanged(double)</signal> + <receiver>AutomaticFilterWidget</receiver> + <slot>doPeptideEvalue(double)</slot> + <hints> + <hint type="sourcelabel"> + <x>382</x> + <y>23</y> + </hint> + <hint type="destinationlabel"> + <x>607</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>peptide_number_spinbox</sender> + <signal>valueChanged(int)</signal> + <receiver>AutomaticFilterWidget</receiver> + <slot>doPeptideNumber(int)</slot> + <hints> + <hint type="sourcelabel"> + <x>488</x> + <y>62</y> + </hint> + <hint type="destinationlabel"> + <x>557</x> + <y>196</y> + </hint> + </hints> + </connection> + <connection> + <sender>protein_evalue_spinbox</sender> + <signal>valueChanged(double)</signal> + <receiver>AutomaticFilterWidget</receiver> + <slot>doProteinEvalue(double)</slot> + <hints> + <hint type="sourcelabel"> + <x>422</x> + <y>95</y> + </hint> + <hint type="destinationlabel"> + <x>558</x> + <y>233</y> + </hint> + </hints> + </connection> + <connection> + <sender>protein_evalue_log_spinbox</sender> + <signal>valueChanged(double)</signal> + <receiver>AutomaticFilterWidget</receiver> + <slot>doProteinLogEvalue(double)</slot> + <hints> + <hint type="sourcelabel"> + <x>302</x> + <y>125</y> + </hint> + <hint type="destinationlabel"> + <x>582</x> + <y>248</y> + </hint> + </hints> + </connection> + <connection> + <sender>set_param_button</sender> + <signal>clicked()</signal> + <receiver>AutomaticFilterWidget</receiver> + <slot>doSetParameters()</slot> + <hints> + <hint type="sourcelabel"> + <x>366</x> + <y>162</y> + </hint> + <hint type="destinationlabel"> + <x>534</x> + <y>253</y> + </hint> + </hints> + </connection> + </connections> + <slots> + <slot>doPeptideEvalue(double)</slot> + <slot>doPeptideNumber(int)</slot> + <slot>doProteinEvalue(double)</slot> + <slot>doProteinLogEvalue(double)</slot> + <slot>doSetParameters()</slot> + </slots> +</ui> diff --git a/src/gui/project_view/automatic_filter_widget/automaticfilterwidget.cpp b/src/gui/project_view/automatic_filter_widget/automaticfilterwidget.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8fd762ecdd21fd309dd4503f57559b4ca2059853 --- /dev/null +++ b/src/gui/project_view/automatic_filter_widget/automaticfilterwidget.cpp @@ -0,0 +1,71 @@ + +/******************************************************************************* +* 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 "automaticfilterwidget.h" + +#include "ui_automatic_filter_widget.h" +#include <QDebug> + + +AutomaticFilterWidget::AutomaticFilterWidget(ProjectWindow * parent): + QWidget(parent), + ui(new Ui::AutomaticFilterWidget) +{ + qDebug() << "AutomaticFilterWidget::AutomaticFilterWidget begin"; + _p_project_window = parent; + 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 (_p_project_window, SIGNAL(identificationGroupGrouped(IdentificationGroup *)), this,SLOT(doIdentificationGroupGrouped(IdentificationGroup *))); +#endif + + qDebug() << "AutomaticFilterWidget::AutomaticFilterWidget end"; +} + +AutomaticFilterWidget::~AutomaticFilterWidget() +{ + delete ui; +} + +void AutomaticFilterWidget::doPeptideEvalue(double evalue) { + _parameters.setFilterPeptideEvalue(evalue); +} +void AutomaticFilterWidget::doProteinEvalue(double evalue) { + _parameters.setFilterProteinEvalue(evalue); +} +void AutomaticFilterWidget::doProteinLogEvalue(double evalue) { + _parameters.setFilterProteinEvalue(std::pow(10, evalue)); +} +void AutomaticFilterWidget::doPeptideNumber(int number) { + _parameters.setFilterMinimumPeptidePerMatch((unsigned int) number); +} +void AutomaticFilterWidget::doSetParameters() { +} diff --git a/src/gui/project_view/automatic_filter_widget/automaticfilterwidget.h b/src/gui/project_view/automatic_filter_widget/automaticfilterwidget.h new file mode 100644 index 0000000000000000000000000000000000000000..7964340644aa3012c667521e4e0b7e58052b2d26 --- /dev/null +++ b/src/gui/project_view/automatic_filter_widget/automaticfilterwidget.h @@ -0,0 +1,59 @@ + +/******************************************************************************* +* 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 +******************************************************************************/ + +#ifndef AUTOMATICFILTERWIDGET_H +#define AUTOMATICFILTERWIDGET_H + +#include "../projectwindow.h" +#include "../../../core/automaticfilterparameters.h" + + +namespace Ui { +class AutomaticFilterWidget; +} + + +class AutomaticFilterWidget : public QWidget +{ + Q_OBJECT + +public: + explicit AutomaticFilterWidget(ProjectWindow * parent); + ~AutomaticFilterWidget(); + +public slots: + void doPeptideEvalue(double evalue); + void doProteinEvalue(double evalue); + void doProteinLogEvalue(double evalue); + void doPeptideNumber(int number); + void doSetParameters(); + +private: + Ui::AutomaticFilterWidget *ui; + ProjectWindow *_p_project_window; + + AutomaticFilterParameters _parameters; + +}; + +#endif // AUTOMATICFILTERWIDGET_H