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

ptm island peptide evidence viewer bug fixed

parent 5666ae7c
No related branches found
No related tags found
No related merge requests found
...@@ -31,7 +31,6 @@ PeptideMatch::PeptideMatch() { ...@@ -31,7 +31,6 @@ PeptideMatch::PeptideMatch() {
PeptideMatch::PeptideMatch(const PeptideMatch & other) { PeptideMatch::PeptideMatch(const PeptideMatch & other) {
_start=other._start; _start=other._start;
_p_peptide_evidence = other._p_peptide_evidence; _p_peptide_evidence = other._p_peptide_evidence;
} }
bool PeptideMatch::operator==(const PeptideMatch & other) const { bool PeptideMatch::operator==(const PeptideMatch & other) const {
if ((_p_peptide_evidence == other._p_peptide_evidence) && (_start == other._start)) { if ((_p_peptide_evidence == other._p_peptide_evidence) && (_start == other._start)) {
......
...@@ -136,6 +136,6 @@ const QString PtmSampleScan::getHtmlSequence(const PtmGroupingExperiment * p_ptm ...@@ -136,6 +136,6 @@ const QString PtmSampleScan::getHtmlSequence(const PtmGroupingExperiment * p_ptm
return sequence_html; return sequence_html;
} }
const std::vector<PeptideMatch> & PtmSampleScan::getPeptideMatchList() const { std::vector<PeptideMatch> & PtmSampleScan::getPeptideMatchList() {
return _peptide_match_list; return _peptide_match_list;
} }
...@@ -53,7 +53,7 @@ public: ...@@ -53,7 +53,7 @@ public:
std::vector<unsigned int> getBestPtmPositionList(const PtmGroupingExperiment * p_ptm_grouping_experiment) const; std::vector<unsigned int> getBestPtmPositionList(const PtmGroupingExperiment * p_ptm_grouping_experiment) const;
std::vector<unsigned int> getObservedPtmPositionList(const PtmGroupingExperiment * p_ptm_grouping_experiment) const; std::vector<unsigned int> getObservedPtmPositionList(const PtmGroupingExperiment * p_ptm_grouping_experiment) const;
const QString getHtmlSequence(const PtmGroupingExperiment * p_ptm_grouping_experiment) const; const QString getHtmlSequence(const PtmGroupingExperiment * p_ptm_grouping_experiment) const;
const std::vector<PeptideMatch> & getPeptideMatchList() const; std::vector<PeptideMatch> & getPeptideMatchList();
private: private:
std::vector<PeptideMatch> _peptide_match_list; std::vector<PeptideMatch> _peptide_match_list;
......
...@@ -84,7 +84,7 @@ PeptideWindow::PeptideWindow(ProjectWindow *parent): ...@@ -84,7 +84,7 @@ PeptideWindow::PeptideWindow(ProjectWindow *parent):
ui->file_not_found->setVisible(false); ui->file_not_found->setVisible(false);
_mz_label = new QLabel(""); _mz_label = new QLabel("");
ui->statusbar->addWidget(_mz_label); ui->statusbar->addWidget(_mz_label);
QWidget * p_spacer = new QWidget(); QWidget * p_spacer = new QWidget();
...@@ -130,8 +130,8 @@ void PeptideWindow::setIon(pappso::PeakIonIsotopeMatch ion) { ...@@ -130,8 +130,8 @@ void PeptideWindow::setIon(pappso::PeakIonIsotopeMatch ion) {
QString plusstr = "+"; QString plusstr = "+";
plusstr = plusstr.repeated(ion.getCharge()); plusstr = plusstr.repeated(ion.getCharge());
_ion_label->setText(QString("%1%2%3 (+%4) - th. isotope ratio %5%").arg(ion.getPeptideFragmentIonSp().get()->getPeptideIonName()).arg(ion.getPeptideFragmentIonSp().get()->size()).arg(plusstr).arg(ion.getPeptideNaturalIsotopeAverageSp().get()->getIsotopeNumber()).arg((int)(ion.getPeptideNaturalIsotopeAverageSp().get()->getIntensityRatio()*100))); _ion_label->setText(QString("%1%2%3 (+%4) - th. isotope ratio %5%").arg(ion.getPeptideFragmentIonSp().get()->getPeptideIonName()).arg(ion.getPeptideFragmentIonSp().get()->size()).arg(plusstr).arg(ion.getPeptideNaturalIsotopeAverageSp().get()->getIsotopeNumber()).arg((int)(ion.getPeptideNaturalIsotopeAverageSp().get()->getIntensityRatio()*100)));
} }
void PeptideWindow::setPeak(const pappso::Peak * p_peak_match) { void PeptideWindow::setPeak(const pappso::Peak * p_peak_match) {
...@@ -206,7 +206,7 @@ void PeptideWindow::chooseDefaultMzDataDir() { ...@@ -206,7 +206,7 @@ void PeptideWindow::chooseDefaultMzDataDir() {
qDebug() << "PeptideWindow::chooseDefaultMzDataDir begin"; qDebug() << "PeptideWindow::chooseDefaultMzDataDir begin";
ui->file_not_found->setVisible(false); ui->file_not_found->setVisible(false);
ui->xic_button->setEnabled(true); ui->xic_button->setEnabled(true);
ui->spectrum_widget->setVisible(true); ui->spectrum_widget->setVisible(true);
emit loadSpectrumSp(_p_peptide_evidence); emit loadSpectrumSp(_p_peptide_evidence);
ui->statusbar->showMessage(tr("loading spectrum")); ui->statusbar->showMessage(tr("loading spectrum"));
...@@ -280,23 +280,28 @@ void PeptideWindow::doSpectrumSpReady(pappso::SpectrumSp spectrum_sp, QString er ...@@ -280,23 +280,28 @@ void PeptideWindow::doSpectrumSpReady(pappso::SpectrumSp spectrum_sp, QString er
} }
void PeptideWindow::setPeptideEvidence(PeptideEvidence * p_peptide_evidence) { void PeptideWindow::setPeptideEvidence(PeptideEvidence * p_peptide_evidence) {
qDebug() << "PeptideWindow::setPeptideEvidence begin"; qDebug() << "PeptideWindow::setPeptideEvidence begin " << p_peptide_evidence;
_p_peptide_evidence = p_peptide_evidence; _p_peptide_evidence = p_peptide_evidence;
_spectrum_is_ready = false; _spectrum_is_ready = false;
qDebug() << "PeptideWindow::setPeptideEvidence emit loadSpectrumSp(_p_peptide_match)"; qDebug() << "PeptideWindow::setPeptideEvidence 1";
ui->file_not_found->setVisible(false); ui->file_not_found->setVisible(false);
ui->spectrum_widget->setVisible(true); ui->spectrum_widget->setVisible(true);
ui->statusbar->showMessage(tr("loading spectrum")); ui->statusbar->showMessage(tr("loading spectrum"));
qDebug() << "PeptideWindow::setPeptideEvidence 2";
pappso::PeptideSp peptide = _p_peptide_evidence->getPeptideXtpSp(); pappso::PeptideSp peptide = _p_peptide_evidence->getPeptideXtpSp();
qDebug() << "PeptideWindow::setPeptideEvidence 3";
ui->spectrum_widget->setMs2Precision(_p_precision); ui->spectrum_widget->setMs2Precision(_p_precision);
ui->spectrum_widget->setPeptideCharge(_p_peptide_evidence->getCharge()); ui->spectrum_widget->setPeptideCharge(_p_peptide_evidence->getCharge());
ui->spectrum_widget->setPeptideSp(peptide); ui->spectrum_widget->setPeptideSp(peptide);
qDebug() << "PeptideWindow::setPeptideEvidence 4";
//ui->spectrum_widget->plot(); //ui->spectrum_widget->plot();
updateDisplay(); updateDisplay();
qDebug() << "PeptideWindow::setPeptideEvidence emit loadSpectrumSp(_p_peptide_match)";
emit loadSpectrumSp(_p_peptide_evidence); emit loadSpectrumSp(_p_peptide_evidence);
qDebug() << "PeptideWindow::setPeptideEvidence end"; qDebug() << "PeptideWindow::setPeptideEvidence end";
} }
......
...@@ -487,7 +487,7 @@ void ProjectWindow::doViewPeptideList(IdentificationGroup * p_ident_group, Prote ...@@ -487,7 +487,7 @@ void ProjectWindow::doViewPeptideList(IdentificationGroup * p_ident_group, Prote
void ProjectWindow::doViewPeptideDetail(PeptideEvidence * peptide_evidence) { void ProjectWindow::doViewPeptideDetail(PeptideEvidence * peptide_evidence) {
qDebug() << "ProjectWindow::doViewPeptideDetail begin"; qDebug() << "ProjectWindow::doViewPeptideDetail begin " << peptide_evidence;
if (_peptide_detail_window_collection.size() == 0) { if (_peptide_detail_window_collection.size() == 0) {
connectNewPeptideDetailWindow(); connectNewPeptideDetailWindow();
} }
......
...@@ -81,9 +81,11 @@ void PtmPeptideListWindow::setPtmIsland(PtmIsland * p_ptm_island) { ...@@ -81,9 +81,11 @@ void PtmPeptideListWindow::setPtmIsland(PtmIsland * p_ptm_island) {
_ptm_table_model_p->setPtmIsland(_p_ptm_island_list_window->getIdentificationGroup()->getPtmGroupingExperiment(), _p_ptm_island); _ptm_table_model_p->setPtmIsland(_p_ptm_island_list_window->getIdentificationGroup()->getPtmGroupingExperiment(), _p_ptm_island);
} }
void PtmPeptideListWindow::askPeptideDetailView(PeptideMatch p_peptide_match) { void PtmPeptideListWindow::askPeptideDetailView(PeptideEvidence * p_peptide_evidence) {
qDebug() << "PtmPeptideListWindow::askPeptideDetailView begin"; qDebug() << "PtmPeptideListWindow::askPeptideDetailView begin " << p_peptide_evidence;
emit requestPeptideDetailView(p_peptide_match.getPeptideEvidence()); //PeptideMatch peptide_match(* p_peptide_match);
//qDebug() << "PtmPeptideListWindow::askPeptideDetailView begin " << peptide_match.getPeptideEvidence();
emit requestPeptideDetailView(p_peptide_evidence);
qDebug() << "PtmPeptideListWindow::askPeptideDetailView end"; qDebug() << "PtmPeptideListWindow::askPeptideDetailView end";
//updateStatusBar(); //updateStatusBar();
} }
...@@ -49,7 +49,7 @@ public: ...@@ -49,7 +49,7 @@ public:
explicit PtmPeptideListWindow(PtmIslandListWindow * parent = 0); explicit PtmPeptideListWindow(PtmIslandListWindow * parent = 0);
~PtmPeptideListWindow(); ~PtmPeptideListWindow();
void setPtmIsland(PtmIsland * p_ptm_island); void setPtmIsland(PtmIsland * p_ptm_island);
void askPeptideDetailView(PeptideMatch p_peptide_match); void askPeptideDetailView(PeptideEvidence * p_peptide_evidence);
signals: signals:
void requestPeptideDetailView(PeptideEvidence * p_peptide_evidence); void requestPeptideDetailView(PeptideEvidence * p_peptide_evidence);
......
...@@ -143,7 +143,7 @@ const QString PtmPeptideTableModel::getDescription(std::int8_t column) { ...@@ -143,7 +143,7 @@ const QString PtmPeptideTableModel::getDescription(std::int8_t column) {
return "peptide theoretical MH+"; return "peptide theoretical MH+";
break; break;
case (std::int8_t) PtmPeptideListColumn::delta_mhplus: case (std::int8_t) PtmPeptideListColumn::delta_mhplus:
return "peptide mass difference betwenn observed mass and theoretical mass"; return "peptide mass difference between observed mass and theoretical mass";
break; break;
case (std::int8_t) PtmPeptideListColumn::besthyperscore: case (std::int8_t) PtmPeptideListColumn::besthyperscore:
return "best X!Tandem hyperscore"; return "best X!Tandem hyperscore";
......
...@@ -32,9 +32,8 @@ ...@@ -32,9 +32,8 @@
#include "../../grouping/ptm/ptmgroupingexperiment.h" #include "../../grouping/ptm/ptmgroupingexperiment.h"
#include <QTextDocument> #include <QTextDocument>
PtmPeptideMenuQicon::PtmPeptideMenuQicon(const PtmGroupingExperiment * p_ptm_grouping_experiment, const PtmSampleScan * p_ptm_sample, const PeptideMatch * p_peptide_match):QIcon() { PtmPeptideMenuQicon::PtmPeptideMenuQicon(const PtmGroupingExperiment * p_ptm_grouping_experiment, const PtmSampleScan * p_ptm_sample, const PeptideMatch * p_peptide_match):QIcon(), _peptide_match(*p_peptide_match) {
_p_ptm_sample_scan = p_ptm_sample; _p_ptm_sample_scan = p_ptm_sample;
_p_peptide_match = p_peptide_match;
_p_ptm_grouping_experiment = p_ptm_grouping_experiment; _p_ptm_grouping_experiment = p_ptm_grouping_experiment;
} }
PtmPeptideMenuQicon::~PtmPeptideMenuQicon( ) { PtmPeptideMenuQicon::~PtmPeptideMenuQicon( ) {
...@@ -60,7 +59,7 @@ void PtmPeptideMenuQicon::paint(QPainter *painter, const QRect &rect, Qt::Alignm ...@@ -60,7 +59,7 @@ void PtmPeptideMenuQicon::paint(QPainter *painter, const QRect &rect, Qt::Alignm
PtmPeptideMenuQaction::PtmPeptideMenuQaction(PtmPeptideTableProxyModel * parent, const PtmGroupingExperiment * p_ptm_grouping_experiment, const PtmSampleScan * p_ptm_sample, PeptideMatch * p_peptide_match):QAction(parent) { PtmPeptideMenuQaction::PtmPeptideMenuQaction(PtmPeptideTableProxyModel * parent, const PtmGroupingExperiment * p_ptm_grouping_experiment, const PtmSampleScan * p_ptm_sample, PeptideMatch * p_peptide_match):QAction(parent) {
_p_ptm_peptide_table_proxy_model = parent; _p_ptm_peptide_table_proxy_model = parent;
_p_peptide_match = p_peptide_match; _peptide_match = *p_peptide_match;
this->setIcon(PtmPeptideMenuQicon(p_ptm_grouping_experiment, p_ptm_sample, p_peptide_match)); this->setIcon(PtmPeptideMenuQicon(p_ptm_grouping_experiment, p_ptm_sample, p_peptide_match));
//this->setText(p_peptide_match->getPeptideXtpSp().get()->getSequence()); //this->setText(p_peptide_match->getPeptideXtpSp().get()->getSequence());
...@@ -81,7 +80,11 @@ PtmPeptideMenuQaction::PtmPeptideMenuQaction(PtmPeptideTableProxyModel * parent, ...@@ -81,7 +80,11 @@ PtmPeptideMenuQaction::PtmPeptideMenuQaction(PtmPeptideTableProxyModel * parent,
#endif #endif
} }
void PtmPeptideMenuQaction::doTriggered(bool triggered) { void PtmPeptideMenuQaction::doTriggered(bool triggered) {
_p_ptm_peptide_table_proxy_model->getPtmPeptideListWindowP()->askPeptideDetailView(*_p_peptide_match); PeptideEvidence * p_peptide_evidence = _peptide_match.getPeptideEvidence();
qDebug() << "PtmPeptideMenuQaction::doTriggered begin" << _peptide_match.getPeptideEvidence();
qDebug() << "PtmPeptideMenuQaction::doTriggered begin 2 " << p_peptide_evidence;
qDebug() << "PtmPeptideMenuQaction::doTriggered begin 3 " << p_peptide_evidence->getPeptideXtpSp().get()->toString();
_p_ptm_peptide_table_proxy_model->getPtmPeptideListWindowP()->askPeptideDetailView(p_peptide_evidence);
} }
PtmPeptideMenuQaction::~PtmPeptideMenuQaction() PtmPeptideMenuQaction::~PtmPeptideMenuQaction()
...@@ -153,7 +156,7 @@ void PtmPeptideTableProxyModel::onTableClicked(const QModelIndex &index) ...@@ -153,7 +156,7 @@ void PtmPeptideTableProxyModel::onTableClicked(const QModelIndex &index)
PtmSampleScanSp sp_ptm_sample_scan = _p_ptm_table_model->getPtmSampleScanSpList().at(row); PtmSampleScanSp sp_ptm_sample_scan = _p_ptm_table_model->getPtmSampleScanSpList().at(row);
if (sp_ptm_sample_scan.get()->getPeptideMatchList().size() == 1) { if (sp_ptm_sample_scan.get()->getPeptideMatchList().size() == 1) {
_p_ptm_peptide_list_window->askPeptideDetailView(sp_ptm_sample_scan.get()->getPeptideMatchList().at(0)); _p_ptm_peptide_list_window->askPeptideDetailView(sp_ptm_sample_scan.get()->getPeptideMatchList().at(0).getPeptideEvidence());
} }
else { else {
this->showContextMenu(index); this->showContextMenu(index);
......
...@@ -50,7 +50,7 @@ public: ...@@ -50,7 +50,7 @@ public:
private: private:
const PtmSampleScan * _p_ptm_sample_scan; const PtmSampleScan * _p_ptm_sample_scan;
const PeptideMatch * _p_peptide_match; const PeptideMatch _peptide_match;
const PtmGroupingExperiment * _p_ptm_grouping_experiment; const PtmGroupingExperiment * _p_ptm_grouping_experiment;
}; };
...@@ -65,7 +65,7 @@ public slots: ...@@ -65,7 +65,7 @@ public slots:
void doTriggered(bool triggered); void doTriggered(bool triggered);
private: private:
PeptideMatch * _p_peptide_match; PeptideMatch _peptide_match;
PtmPeptideTableProxyModel * _p_ptm_peptide_table_proxy_model; PtmPeptideTableProxyModel * _p_ptm_peptide_table_proxy_model;
}; };
......
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