diff --git a/src/gui/xic_view/xic_box/xic_box.ui b/src/gui/xic_view/xic_box/xic_box.ui index e438ff7c179c702e933dd8a39e76339174c4f471..f35f69a28d1968411d1b101155fd1a5b851acfc7 100644 --- a/src/gui/xic_view/xic_box/xic_box.ui +++ b/src/gui/xic_view/xic_box/xic_box.ui @@ -180,8 +180,8 @@ <slot>remove()</slot> <hints> <hint type="sourcelabel"> - <x>378</x> - <y>25</y> + <x>592</x> + <y>39</y> </hint> <hint type="destinationlabel"> <x>585</x> @@ -189,8 +189,25 @@ </hint> </hints> </connection> + <connection> + <sender>pushButton_2</sender> + <signal>clicked()</signal> + <receiver>XicBox</receiver> + <slot>extractXicInOtherMsRun()</slot> + <hints> + <hint type="sourcelabel"> + <x>414</x> + <y>38</y> + </hint> + <hint type="destinationlabel"> + <x>891</x> + <y>69</y> + </hint> + </hints> + </connection> </connections> <slots> <slot>remove()</slot> + <slot>extractXicInOtherMsRun()</slot> </slots> </ui> diff --git a/src/gui/xic_view/xic_box/xicbox.cpp b/src/gui/xic_view/xic_box/xicbox.cpp index 41ff464e344c30bebc78a5743c030e8879ac721c..6abf1eaae2e5f27465b40f869433ec36c3dd7ffe 100644 --- a/src/gui/xic_view/xic_box/xicbox.cpp +++ b/src/gui/xic_view/xic_box/xicbox.cpp @@ -29,7 +29,7 @@ #include "xicbox.h" #include "ui_xic_box.h" #include <QMessageBox> -#include <pappsomspp/pappsoexception.h> +#include <pappsomspp/exception/exceptionnotfound.h> #include "../xicworkerthread.h" #include "../../project_view/projectwindow.h" #include <pappsomspp/xic/detection/xicdetectionzivy.h> @@ -110,6 +110,19 @@ XicBox::XicBox(XicWindow *parent): #endif + QStringList msrun_list; + for (MsRunSp msrun_sp : _p_xic_window->getProjectWindow()->getProjectP()->getMsRunStore().getMsRunList()) { + msrun_list << msrun_sp.get()->getFilename(); + qDebug() << "ProteinListWindow::setIdentificationGroup " << msrun_sp.get()->getFilename(); + } + QCompleter *completer = new QCompleter(msrun_list, this); + completer->setCaseSensitivity(Qt::CaseInsensitive); + + completer->setCompletionMode(QCompleter::PopupCompletion); + completer->setModelSorting(QCompleter::CaseSensitivelySortedModel); + completer->setFilterMode(Qt::MatchContains); + ui->msrun_autocompletion->setCompleter(completer); + } XicBox::~XicBox() @@ -128,10 +141,23 @@ void XicBox::error(QString error_message) { tr("Error trying to save spectrum to SVG file :"), error_message); } + +void XicBox::extractXicInOtherMsRun() { + qDebug() << "XicBox::extractXicInOtherMsRun begin"; + try { + MsRunSp msrun_sp = _p_xic_window->getProjectWindow()->getProjectP()->getMsRunStore().getInstance(ui->msrun_autocompletion->text()); + _p_xic_window->addXicInMsRun(_p_peptide_evidence, msrun_sp); + } + catch (pappso::ExceptionNotFound & error) { + qDebug() << "XicBox::extractXicInOtherMsRun not found " << ui->msrun_autocompletion->text(); + } +} + void XicBox::setPeptideEvidence(const PeptideEvidence * p_peptide_evidence) { + _p_peptide_evidence = p_peptide_evidence; - _msrun_sp = _p_xic_window->getProjectWindow()->getProjectP()->getMsRunStore().getInstance(_p_peptide_evidence->getMsRunP()); + _msrun_sp = p_peptide_evidence->getIdentificationDataSource()->getMsRunSp(); ui->peptide_label->setText(_p_peptide_evidence->getPeptideXtpSp().get()->toString()); ui->msrun_label->setText(_p_peptide_evidence->getMsRunP()->getFilename()); @@ -147,6 +173,23 @@ void XicBox::setPeptideEvidence(const PeptideEvidence * p_peptide_evidence) { } +void XicBox::setPeptideEvidenceInMsRun(const PeptideEvidence * p_peptide_evidence, MsRunSp msrun_sp) { + _p_peptide_evidence = p_peptide_evidence; + _msrun_sp = msrun_sp; + + ui->peptide_label->setText(_p_peptide_evidence->getPeptideXtpSp().get()->toString()); + ui->msrun_label->setText(msrun_sp->getFilename()); + ui->charge_label->setText(QString("%1").arg(_p_peptide_evidence->getCharge())); + ui->mz_label->setText(QString::number(_p_peptide_evidence->getTheoreticalMz(), 'f', 4)); + + //get same xic peptide evidence (msrun, peptide, charge) + //p_projet + _peptide_evidence_list.clear(); + //_p_xic_window->getProjectWindow()->getProjectP()->getSameXicPeptideEvidenceList(p_peptide_evidence, _peptide_evidence_list); + + emit computeIsotopeMassList(_p_peptide_evidence->getPeptideXtpSp(), _p_peptide_evidence->getCharge(), _p_xic_window->getXicExtractPrecision(), 0.8); + +} void XicBox::setXic(std::vector< pappso::XicSp> xic_sp_list) { qDebug() << "XicBox::setXic begin " << xic_sp_list.size(); diff --git a/src/gui/xic_view/xic_box/xicbox.h b/src/gui/xic_view/xic_box/xicbox.h index 33ae45e203b0240e3bad99200c57eaf4ac29bfef..c06e56d53d5930a5183083fd5064bb938ec98607 100644 --- a/src/gui/xic_view/xic_box/xicbox.h +++ b/src/gui/xic_view/xic_box/xicbox.h @@ -51,6 +51,7 @@ public: explicit XicBox(XicWindow * parent = 0); ~XicBox(); void setPeptideEvidence(const PeptideEvidence * p_peptide_evidence) ; + void setPeptideEvidenceInMsRun(const PeptideEvidence * p_peptide_evidence, MsRunSp msrun_sp); signals : void loadXic(MsRunSp p_msrun, std::vector<pappso::mz> mz_list, pappso::PrecisionP precision, XicExtractMethod method); @@ -61,6 +62,7 @@ private slots: void setXic(std::vector< pappso::XicSp> xic_sp_list); void setIsotopeMassList(std::vector<pappso::PeptideNaturalIsotopeAverageSp> isotope_mass_list); void error(QString error_message); + void extractXicInOtherMsRun(); private: Ui::XicBox *ui; QThread _xic_thread; diff --git a/src/gui/xic_view/xicwindow.cpp b/src/gui/xic_view/xicwindow.cpp index 703195a7eb52e8cab42b7534dca418595b87bb75..f4fbaf6a5125ab1b7ed2689a5ec920b55a5da567 100644 --- a/src/gui/xic_view/xicwindow.cpp +++ b/src/gui/xic_view/xicwindow.cpp @@ -78,6 +78,11 @@ void XicWindow::addXic(const PeptideEvidence * p_peptide_evidence) { ui->xic_vertical_layout->layout()->addWidget(p_box); } +void XicWindow::addXicInMsRun(const PeptideEvidence * p_peptide_evidence, MsRunSp msrun_sp) { + XicBox * p_box = new XicBox(this); + p_box->setPeptideEvidenceInMsRun(p_peptide_evidence, msrun_sp); + ui->xic_vertical_layout->layout()->addWidget(p_box); +} void XicWindow::removeXicBox(XicBox * xic_box) { xic_box->setVisible(false); diff --git a/src/gui/xic_view/xicwindow.h b/src/gui/xic_view/xicwindow.h index e04745b6bca67ad69ef6882f70e067c479d42dcf..30bef11257f1c2d226e6869f85cac68b36929bb1 100644 --- a/src/gui/xic_view/xicwindow.h +++ b/src/gui/xic_view/xicwindow.h @@ -52,6 +52,7 @@ public: ~XicWindow(); void addXic(const PeptideEvidence * p_peptide_evidence); + void addXicInMsRun(const PeptideEvidence * p_peptide_evidence, MsRunSp msrun_sp); pappso::PrecisionP getXicExtractPrecision() const;