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

extract XIC in other MsRun

parent ad6f4a77
No related branches found
No related tags found
No related merge requests found
......@@ -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>
......@@ -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();
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
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