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

first ptm peptide list view

parent dea0ff52
No related branches found
No related tags found
No related merge requests found
......@@ -171,6 +171,7 @@ bool PtmIsland::merge(PtmIslandSp ptm_island_sp) {
}
std::vector<PtmSampleScanSp> PtmIsland::getPtmSampleScanSpList() const {
qDebug() << "PtmIsland::getPtmSampleScanSpList begin" ;
std::vector<PtmSampleScanSp> sample_scan_list;
for (const PeptideMatch * p_peptide_match:_peptide_match_list) {
......@@ -178,6 +179,7 @@ std::vector<PtmSampleScanSp> PtmIsland::getPtmSampleScanSpList() const {
std::vector<PtmSampleScanSp>::iterator it_ptm_end = sample_scan_list.end();
while ((it_ptm != it_ptm_end) && (it_ptm->get()->add(p_peptide_match) == false)) {
//peptide added
it_ptm++;
}
if (it_ptm == it_ptm_end) {
//peptide NOT added
......@@ -185,5 +187,6 @@ std::vector<PtmSampleScanSp> PtmIsland::getPtmSampleScanSpList() const {
}
}
qDebug() << "PtmIsland::getPtmSampleScanSpList end" ;
return sample_scan_list;
}
......@@ -33,6 +33,7 @@
#include "ui_ptm_island_list_view.h"
#include "../mainwindow.h"
#include <QSettings>
#include "../ptm_peptide_list_view/ptmpeptidelistwindow.h"
PtmIslandListWindow::PtmIslandListWindow(ProjectWindow *parent):
......@@ -68,7 +69,7 @@ PtmIslandListWindow::PtmIslandListWindow(ProjectWindow *parent):
connect (_project_window, SIGNAL(identificationPtmGroupGrouped(IdentificationGroup *)), this,SLOT(doIdentificationPtmGroupGrouped(IdentificationGroup *)));
connect (_project_window, SIGNAL(identificationGroupGrouped(IdentificationGroup *)), this,SLOT(doIdentificationGroupGrouped(IdentificationGroup *)));
connect(ui->ptm_island_tableview, SIGNAL(clicked(const QModelIndex &)), _ptm_table_model_p, SLOT(onTableClicked(const QModelIndex &)));
connect(ui->ptm_island_tableview, SIGNAL(clicked(const QModelIndex &)), _ptm_proxy_model_p, SLOT(onTableClicked(const QModelIndex &)));
#endif
}
......@@ -126,3 +127,26 @@ void PtmIslandListWindow::doIdentificationPtmGroupGrouped(IdentificationGroup *
void PtmIslandListWindow::resizeColumnsToContents() {
ui->ptm_island_tableview->resizeColumnsToContents();
}
void PtmIslandListWindow::connectNewPtmPeptideListWindow() {
qDebug() << "PtmIslandListWindow::connectNewPtmPeptideListWindow begin";
_p_current_ptm_peptide_list_window = new PtmPeptideListWindow(this);
_ptm_peptide_list_window_collection.push_back(_p_current_ptm_peptide_list_window);
qDebug() << "PtmIslandListWindow::connectNewPtmPeptideListWindow end";
}
void PtmIslandListWindow::askViewPtmPeptideList(PtmIsland * ptm_island) {
if (_ptm_peptide_list_window_collection.size() == 0) {
connectNewPtmPeptideListWindow();
}
Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
if (modifier == Qt::ControlModifier) {
connectNewPtmPeptideListWindow();
}
_p_current_ptm_peptide_list_window->setPtmIsland(ptm_island);
_p_current_ptm_peptide_list_window->show();
}
......@@ -35,6 +35,7 @@
#include "../../core/identificationgroup.h"
class ProjectWindow;
class PtmPeptideListWindow;
//http://doc.qt.io/qt-4.8/qt-itemviews-chart-mainwindow-cpp.html
namespace Ui {
......@@ -43,8 +44,8 @@ class PtmIslandListWindow;
class PtmIslandListWindow: public QMainWindow {
Q_OBJECT
friend PtmIslandProxyModel;
public:
explicit PtmIslandListWindow(ProjectWindow * parent = 0);
~PtmIslandListWindow();
void setIdentificationGroup(IdentificationGroup * p_identification_group);
......@@ -57,13 +58,20 @@ public slots:
signals:
void ptmIslandDataChanged();
protected:
void askViewPtmPeptideList(PtmIsland * ptm_island);
private:
void connectNewPtmPeptideListWindow();
private:
IdentificationGroup * _p_identification_group=nullptr;
Ui::PtmIslandListWindow *ui;
PtmIslandTableModel * _ptm_table_model_p = nullptr;
PtmIslandProxyModel * _ptm_proxy_model_p = nullptr;
ProjectWindow * _project_window;
PtmPeptideListWindow * _p_current_ptm_peptide_list_window;
std::vector<PtmPeptideListWindow *> _ptm_peptide_list_window_collection;
};
......
......@@ -29,6 +29,7 @@
#include "ptmislandproxymodel.h"
#include "ptmislandtablemodel.h"
#include "ptmislandlistwindow.h"
#include "../../grouping/ptm/ptmgroupingexperiment.h"
#include "../../grouping/ptm/ptmisland.h"
#include <pappsomspp/pappsoexception.h>
......@@ -83,16 +84,16 @@ void PtmIslandProxyModel::onTableClicked(const QModelIndex &index)
QModelIndex source_index(this->mapToSource(index));
int row = source_index.row();
int col = source_index.column();
/*
ProteinMatch* p_protein_match = _p_ptm_island_table_model->getIdentificationGroup()->getProteinMatchList().at(row);
//ProteinMatch* p_protein_match = _p_ptm_island_table_model->getIdentificationGroup()->getProteinMatchList().at(row);
if ((col == 2)||(col == 3)) {
_p_ptm_island_table_model->askPtmProteinDetailView(p_protein_match);
//_p_ptm_island_table_model->askPtmProteinDetailView(p_protein_match);
}
else {
_p_ptm_island_table_model->askPtmPeptideListView(p_protein_match);
_p_ptm_island_list_window->askViewPtmPeptideList(_p_ptm_island_table_model->getPtmGroupingExperiment()->getPtmIslandList().at(row).get());
}
*/
qDebug() << "PtmIslandProxyModel::onTableClicked end " << index.row();
}
......@@ -71,5 +71,6 @@ PtmPeptideListWindow::PtmPeptideListWindow(PtmIslandListWindow * parent):QMainWi
PtmPeptideListWindow::~PtmPeptideListWindow() {
}
void PtmPeptideListWindow::setPtmIsland(PtmIsland * p_ptm_island) {
_p_ptm_island = _p_ptm_island;
_p_ptm_island = p_ptm_island;
_ptm_table_model_p->setPtmIsland(_p_ptm_island);
}
......@@ -217,3 +217,18 @@ QVariant PtmPeptideTableModel::data(const QModelIndex &index, int role ) const {
}
return QVariant();
}
void PtmPeptideTableModel::setPtmIsland(PtmIsland * ptm_island) {
qDebug() << "tmPeptideTableModel::setPtmIsland begin ";
beginResetModel();
_p_ptm_island = ptm_island;
_ptm_sample_scan_list = ptm_island->getPtmSampleScanSpList();
//emit headerDataChanged(Qt::Horizontal, 0,11);
//refresh();
qDebug() << "tmPeptideTableModel::setPtmIsland end ";
endResetModel();
//this->_p_ptm_island_list_window->resizeColumnsToContents();
}
......@@ -31,6 +31,7 @@
#include <QAbstractTableModel>
#include "../../grouping/ptm/ptmsamplescan.h"
#include "../../grouping/ptm/ptmisland.h"
......@@ -73,6 +74,7 @@ public:
static const QString getDescription(PtmPeptideListColumn column);
~PtmPeptideTableModel();
void setPtmIsland(PtmIsland * ptm_island);
private :
static const QString getTitle(std::int8_t column);
......@@ -80,6 +82,7 @@ private :
private:
std::vector<PtmSampleScanSp> _ptm_sample_scan_list;
const PtmIsland * _p_ptm_island;
};
#endif // PTMPEPTIDETABLEMODEL_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