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

new peptide detail window

parent d67b8ba8
No related branches found
No related tags found
No related merge requests found
......@@ -83,6 +83,7 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} )
SET(XTPCPP_SRCS
./gui/mainwindow.cpp
./gui/peptide_detail_view/peptidewindow.cpp
./gui/peptide_list_view/peptidelistwindow.cpp
./gui/peptide_list_view/peptidetablemodel.cpp
./gui/peptide_list_view/peptidetableproxymodel.cpp
......@@ -95,6 +96,7 @@ SET(XTPCPP_SRCS
SET (GUI_UIS
./gui/main.ui
./gui/peptide_detail_view/peptide_detail_view.ui
./gui/peptide_list_view/peptide_view.ui
./gui/project_view/project_view.ui
./gui/protein_list_view/protein_view.ui
......@@ -104,6 +106,7 @@ SET (GUI_UIS
SET(XTPCPP_MOC_HDRS
./gui/mainwindow.h
./gui/peptide_detail_view/peptidewindow.h
./gui/peptide_list_view/peptidelistwindow.h
./gui/peptide_list_view/peptidetablemodel.h
./gui/peptide_list_view/peptidetableproxymodel.h
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PeptideDetailView</class>
<widget class="QMainWindow" name="PeptideDetailView">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>826</width>
<height>404</height>
</rect>
</property>
<property name="windowTitle">
<string>Peptide details</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>sequence</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="sequence_label">
<property name="text">
<string>sequence</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>modifications</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="modification_label">
<property name="text">
<string>mods</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>scan</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="scan_label">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>mz</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="mz_label">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>z</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="z_label">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2"/>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>826</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>
/*******************************************************************************
* 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 "peptidewindow.h"
#include "../project_view/projectwindow.h"
#include "ui_peptide_detail_view.h"
#include <pappsomspp/pappsoexception.h>
#include <QMessageBox>
PeptideWindow::PeptideWindow(ProjectWindow *parent):
QMainWindow(parent),
ui(new Ui::PeptideDetailView)
{
_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 *)));
//connect(_protein_table_model_p, SIGNAL(layoutChanged()), this, SLOT(updateStatusBar()));
#endif
}
PeptideWindow::~PeptideWindow()
{
delete ui;
}
void PeptideWindow::doIdentificationGroupGrouped(IdentificationGroup * p_identification_group) {
updateDisplay();
}
void PeptideWindow::updateDisplay() {
try {
ui->sequence_label->setText(_p_peptide_match->getPeptideXtpSp().get()->toString());
ui->mz_label->setText(QString("%1").arg(_p_peptide_match->getPeptideXtpSp().get()->getMz(_p_peptide_match->getCharge())));
ui->z_label->setText(QString("%1").arg(_p_peptide_match->getCharge()));
ui->scan_label->setText(QString("%1").arg(_p_peptide_match->getScan()));
ui->modification_label->setText(_p_peptide_match->getPeptideXtpSp().get()->getModifString());
}
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());
}
}
void PeptideWindow::setPeptideMatch(PeptideMatch * p_peptide_match) {
_p_peptide_match = p_peptide_match;
updateDisplay();
}
/*******************************************************************************
* 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 PEPTIDEWINDOW_H
#define PEPTIDEWINDOW_H
#include <QMainWindow>
#include <QTextDocument>
#include "../../core/peptidematch.h"
#include "../../core/identificationgroup.h"
class ProjectWindow;
namespace Ui {
class PeptideDetailView;
}
class PeptideWindow: public QMainWindow {
Q_OBJECT
public:
explicit PeptideWindow(ProjectWindow * parent = 0);
~PeptideWindow();
void setPeptideMatch(PeptideMatch * p_peptide_match);
public slots:
void doIdentificationGroupGrouped(IdentificationGroup * p_identification_group);
protected :
void updateDisplay();
private:
Ui::PeptideDetailView *ui;
ProjectWindow * _p_project_window;
PeptideMatch * _p_peptide_match = nullptr;
};
#endif // PEPTIDEWINDOW_H
......@@ -93,6 +93,14 @@ void ProjectWindow::connectNewProteinDetailWindow() {
}
void ProjectWindow::connectNewPeptideDetailWindow() {
qDebug() << "ProjectWindow::connectNewPeptideDetailWindow begin";
_p_current_peptide_detail_window = new PeptideWindow(this);
_peptide_detail_window_collection.push_back(_p_current_peptide_detail_window);
qDebug() << "ProjectWindow::connectNewPeptideDetailWindow end";
}
void ProjectWindow::connectNewPeptideListWindow() {
qDebug() << "ProjectWindow::connectNewPeptideListWindow begin";
_p_current_peptide_list_window = new PeptideListWindow(this);
......@@ -172,6 +180,20 @@ void ProjectWindow::doViewPeptideList(IdentificationGroup * p_ident_group, Prote
}
void ProjectWindow::doViewPeptideDetail(PeptideMatch * peptide_match) {
qDebug() << "ProjectWindow::doViewPeptideDetail begin";
if (_peptide_detail_window_collection.size() == 0) {
connectNewPeptideDetailWindow();
}
Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
if (modifier == Qt::ControlModifier) {
connectNewPeptideDetailWindow();
}
_p_current_peptide_detail_window->setPeptideMatch(peptide_match);
_p_current_peptide_detail_window->show();
qDebug() << "ProjectWindow::doViewPeptideDetail end";
}
void ProjectWindow::doViewProteinDetail(ProteinMatch * protein_match) {
......
......@@ -29,6 +29,7 @@
#include "../protein_list_view/proteinlistwindow.h"
#include "../peptide_list_view/peptidelistwindow.h"
#include "../protein_view/proteinwindow.h"
#include "../peptide_detail_view/peptidewindow.h"
class MainWindow;
......@@ -60,14 +61,15 @@ signals:
protected :
void doViewPeptideList(IdentificationGroup * p_ident_group, ProteinMatch * protein_match);
void doViewProteinDetail(ProteinMatch * protein_match);
void doViewPeptideDetail(PeptideMatch * peptide_match);
void doViewProteinDetail(ProteinMatch * protein_match);
void doIdentificationGroupEdited(IdentificationGroup * p_identification_group);
private :
void connectNewProteinListWindow();
void connectNewPeptideListWindow();
void connectNewProteinDetailWindow();
void connectNewPeptideDetailWindow();
void refreshGroup(IdentificationGroup * p_ident_group);
private:
......@@ -79,6 +81,10 @@ private:
PeptideListWindow * _p_current_peptide_list_window = nullptr;
std::list <ProteinWindow *> _protein_detail_window_collection;
ProteinWindow * _p_current_protein_detail_window = nullptr;
std::list <PeptideWindow *> _peptide_detail_window_collection;
PeptideWindow * _p_current_peptide_detail_window = nullptr;
ProjectSp _project_sp;
......
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