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

refactoring : xic peak renamed

parent bd4f789b
No related branches found
No related tags found
No related merge requests found
......@@ -33,14 +33,14 @@
#include <pappsomspp/exception/exceptionnotfound.h>
#include "../xicworkerthread.h"
#include "../../project_view/projectwindow.h"
#include <pappsomspp/processing/detection/xicdetectionzivy.h>
#include <pappsomspp/processing/detection/tracedetectionzivy.h>
#include <pappsomspp/exception/exceptionnotpossible.h>
bool
XicBoxNaturalIsotope::contains(const pappso::XicPeakCstSPtr &peak) const
XicBoxNaturalIsotope::contains(const pappso::TracePeakCstSPtr &peak) const
{
for(const pappso::XicPeakCstSPtr &peak_i : detected_peak_list)
for(const pappso::TracePeakCstSPtr &peak_i : detected_peak_list)
{
if(peak_i.get() == peak.get())
{
......@@ -67,9 +67,9 @@ class XicDetectionList : public pappso::TraceDetectionSinkInterface
}
}
void
setXicPeak(pappso::XicPeak &xic_peak) override
setTracePeak(pappso::TracePeak &xic_peak) override
{
pappso::XicPeakCstSPtr peak_sp = xic_peak.makeXicPeakCstSPtr();
pappso::TracePeakCstSPtr peak_sp = xic_peak.makeTracePeakCstSPtr();
_peak_list.push_back(peak_sp);
for(pappso::pappso_double rt : _rt_list)
......@@ -84,12 +84,12 @@ class XicDetectionList : public pappso::TraceDetectionSinkInterface
}
}
};
const pappso::XicPeakCstSPtr &
const pappso::TracePeakCstSPtr &
getMatchedPeak() const
{
return _max_peak;
}
const std::vector<pappso::XicPeakCstSPtr> &
const std::vector<pappso::TracePeakCstSPtr> &
getXicPeakList() const
{
return _peak_list;
......@@ -103,9 +103,9 @@ class XicDetectionList : public pappso::TraceDetectionSinkInterface
private:
unsigned int _count = 0;
std::vector<pappso::XicPeakCstSPtr> _peak_list;
std::vector<pappso::TracePeakCstSPtr> _peak_list;
std::vector<pappso::pappso_double> _rt_list;
pappso::XicPeakCstSPtr _max_peak;
pappso::TracePeakCstSPtr _max_peak;
};
......@@ -139,13 +139,17 @@ XicBox::XicBox(XicWindow *parent) : QWidget(parent), ui(new Ui::XicBox)
connect(p_worker, &XicWorkerThread::operationFailed, this, &XicBox::error);
connect(this, &XicBox::computeIsotopeMassList, p_worker,
connect(this,
&XicBox::computeIsotopeMassList,
p_worker,
&XicWorkerThread::doComputeIsotopeMassList);
connect(p_worker, &XicWorkerThread::isotopeMassListComputed, this,
connect(p_worker,
&XicWorkerThread::isotopeMassListComputed,
this,
&XicBox::setIsotopeMassList);
connect(_p_xic_window, &XicWindow::reExtractXicNeeded, this,
&XicBox::reExtractXic);
connect(
_p_xic_window, &XicWindow::reExtractXicNeeded, this, &XicBox::reExtractXic);
/* connect(ui->xic_widget,
qOverload<std::vector<std::pair<pappso::XicCstSPtr,
pappso::XicPeakSp>>>( &pappso::XicWidget::xicPeakListChanged), this,
......@@ -156,7 +160,9 @@ XicBox::XicBox(XicWindow *parent) : QWidget(parent), ui(new Ui::XicBox)
this,
&XicBox::onXicWidgetClick);
*/
connect(_p_xic_window, &XicWindow::rtUnitChangeNeeded, this,
connect(_p_xic_window,
&XicWindow::rtUnitChangeNeeded,
this,
&XicBox::onRtUnitChanged);
#else
// Qt4 code
......@@ -194,7 +200,7 @@ XicBox::onXicWidgetClick(double rt, double intensity)
{
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
ui->xic_widget->clearXicPeakBorders();
std::vector<pappso::XicPeakCstSPtr> draw_peak_borders;
std::vector<pappso::TracePeakCstSPtr> draw_peak_borders;
for(XicBoxNaturalIsotope peak : _natural_isotope_list)
{
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
......@@ -264,13 +270,15 @@ XicBox::setPeptideEvidence(const PeptideEvidence *p_peptide_evidence)
_p_xic_window->getProjectWindow()
->getProjectP()
->getSameXicPeptideEvidenceList(
_peptide_evidence_list, _msrun_sp.get(),
_peptide_evidence_list,
_msrun_sp.get(),
_p_peptide_evidence->getPeptideXtpSp().get(),
_p_peptide_evidence->getCharge());
emit computeIsotopeMassList(_p_peptide_evidence->getPeptideXtpSp(),
_p_peptide_evidence->getCharge(),
_p_xic_window->getXicExtractPrecision(), 0.8);
_p_xic_window->getXicExtractPrecision(),
0.8);
}
void
......@@ -295,7 +303,8 @@ XicBox::setPeptideEvidenceInMsRun(const PeptideEvidence *p_peptide_evidence,
_p_xic_window->getProjectWindow()
->getProjectP()
->getSameXicPeptideEvidenceList(
_peptide_evidence_list, _msrun_sp.get(),
_peptide_evidence_list,
_msrun_sp.get(),
_p_peptide_evidence->getPeptideXtpSp().get(),
_p_peptide_evidence->getCharge());
//_p_xic_window->getProjectWindow()->getProjectP()->getSameXicPeptideEvidenceList(p_peptide_evidence,
......@@ -303,7 +312,8 @@ XicBox::setPeptideEvidenceInMsRun(const PeptideEvidence *p_peptide_evidence,
emit computeIsotopeMassList(_p_peptide_evidence->getPeptideXtpSp(),
_p_peptide_evidence->getCharge(),
_p_xic_window->getXicExtractPrecision(), 0.8);
_p_xic_window->getXicExtractPrecision(),
0.8);
}
void
......@@ -373,7 +383,7 @@ XicBox::setXic(std::vector<pappso::XicCstSPtr> xic_sp_list)
XicDetectionList xic_list;
xic_list.setPeptideEvidenceList(_peptide_evidence_list);
std::vector<pappso::XicPeakCstSPtr> draw_peak_borders;
std::vector<pappso::TracePeakCstSPtr> draw_peak_borders;
for(XicBoxNaturalIsotope &xic_isotope : _natural_isotope_list)
{
......@@ -401,7 +411,7 @@ XicBox::setXic(std::vector<pappso::XicCstSPtr> xic_sp_list)
void
XicBox::drawObservedAreaBars(
const std::vector<pappso::XicPeakCstSPtr> &observed_peak_to_draw_list)
const std::vector<pappso::TracePeakCstSPtr> &observed_peak_to_draw_list)
{
if(_isotope_ratio_graph_observed_intensity == nullptr)
{
......@@ -428,8 +438,8 @@ XicBox::drawObservedAreaBars(
qDebug() << "XicBox::setXic plot _isotope_mass_list";
for(const XicBoxNaturalIsotope &xic_isotope : _natural_isotope_list)
{
pappso::XicPeakCstSPtr peak_to_draw;
for(pappso::XicPeakCstSPtr observed_peak : observed_peak_to_draw_list)
pappso::TracePeakCstSPtr peak_to_draw;
for(pappso::TracePeakCstSPtr observed_peak : observed_peak_to_draw_list)
{
if(xic_isotope.contains(observed_peak))
{
......@@ -496,7 +506,9 @@ XicBox::setIsotopeMassList(
{nullptr, natural_isotope_average, nullptr, nullptr});
}
emit loadXic(_msrun_sp, mass_list, _p_xic_window->getXicExtractPrecision(),
emit loadXic(_msrun_sp,
mass_list,
_p_xic_window->getXicExtractPrecision(),
pappso::XicExtractMethod::max);
// histogram
......@@ -570,7 +582,9 @@ XicBox::reExtractXic()
mass_list.push_back(
xic_isotope.peptide_natural_isotope_sp.get()->getMz());
}
emit loadXic(_msrun_sp, mass_list, _p_xic_window->getXicExtractPrecision(),
emit loadXic(_msrun_sp,
mass_list,
_p_xic_window->getXicExtractPrecision(),
_p_xic_window->getXicExtractionMethod());
qDebug() << "XicBox::reExtractXic end";
}
......@@ -583,7 +597,7 @@ XicBox::setRetentionTime(double rt)
}
void
XicBox::setXicPeakList(
std::vector<std::pair<pappso::XicCstSPtr, pappso::XicPeakCstSPtr>>
std::vector<std::pair<pappso::XicCstSPtr, pappso::TracePeakCstSPtr>>
xic_peak_list)
{
qDebug() << "XicBox::setXicPeakList begin";
......@@ -593,7 +607,7 @@ XicBox::setXicPeakList(
xic_isotope.one_peak_sp = nullptr;
}
for(std::pair<pappso::XicCstSPtr, pappso::XicPeakCstSPtr> &pair_xic_peak :
for(std::pair<pappso::XicCstSPtr, pappso::TracePeakCstSPtr> &pair_xic_peak :
xic_peak_list)
{
for(XicBoxNaturalIsotope &xic_isotope : _natural_isotope_list)
......
......@@ -40,20 +40,20 @@
namespace Ui
{
class XicBox;
class XicBox;
}
struct XicBoxNaturalIsotope
{
bool contains(const pappso::XicPeakCstSPtr &peak) const;
bool contains(const pappso::TracePeakCstSPtr &peak) const;
pappso::XicCstSPtr xic_sp;
pappso::PeptideNaturalIsotopeAverageSp peptide_natural_isotope_sp;
pappso::XicPeakCstSPtr matched_peak_sp;
pappso::XicPeakCstSPtr one_peak_sp;
std::vector<pappso::XicPeakCstSPtr> detected_peak_list;
pappso::TracePeakCstSPtr matched_peak_sp;
pappso::TracePeakCstSPtr one_peak_sp;
std::vector<pappso::TracePeakCstSPtr> detected_peak_list;
};
class XicBox : public QWidget
......@@ -67,9 +67,12 @@ class XicBox : public QWidget
MsRunSp msrun_sp);
signals:
void loadXic(MsRunSp p_msrun, std::vector<pappso::pappso_double> mz_list,
pappso::PrecisionPtr precision, pappso::XicExtractMethod method);
void computeIsotopeMassList(pappso::PeptideSp peptide_sp, unsigned int charge,
void loadXic(MsRunSp p_msrun,
std::vector<pappso::pappso_double> mz_list,
pappso::PrecisionPtr precision,
pappso::XicExtractMethod method);
void computeIsotopeMassList(pappso::PeptideSp peptide_sp,
unsigned int charge,
pappso::PrecisionPtr precision,
double minimum_isotope_pattern_ratio);
private slots:
......@@ -87,7 +90,7 @@ class XicBox : public QWidget
private:
void drawObservedAreaBars(
const std::vector<pappso::XicPeakCstSPtr> &observed_peak_to_draw);
const std::vector<pappso::TracePeakCstSPtr> &observed_peak_to_draw);
private:
Ui::XicBox *ui;
......
......@@ -30,17 +30,18 @@
#pragma once
#include <QWidget>
#include <pappsomspp/processing/detection/xicdetectionzivy.h>
#include <pappsomspp/processing/detection/tracedetectionzivy.h>
namespace Ui
{
class ZivyWidget;
class ZivyWidget;
}
struct ZivyParams
{
std::shared_ptr<pappso::TraceDetectionInterface> newTraceDetectionZivySPtr() const;
std::shared_ptr<pappso::TraceDetectionInterface>
newTraceDetectionZivySPtr() const;
void saveSettings() const;
void loadSettings();
......
......@@ -27,13 +27,12 @@
*implementation
******************************************************************************/
#ifndef XICWINDOW_H
#define XICWINDOW_H
#pragma once
#include <QMainWindow>
#include <QAbstractButton>
#include <pappsomspp/xic/xic.h>
#include <pappsomspp/processing/detection/xicdetectionzivy.h>
#include <pappsomspp/processing/detection/tracedetectionzivy.h>
#include "../../core/peptideevidence.h"
#include "xic_widgets/zivydialog.h"
......@@ -97,5 +96,3 @@ class XicWindow : public QMainWindow
ZivyDialog *_p_zivy_dialog;
};
#endif // XICWINDOW_H
......@@ -28,13 +28,12 @@
*implementation
******************************************************************************/
#ifndef MASSCHROQML_H
#define MASSCHROQML_H
#pragma once
#include <QXmlStreamWriter>
#include <QFile>
#include <QString>
#include <pappsomspp/processing/detection/xicdetectionzivy.h>
#include <pappsomspp/processing/detection/tracedetectionzivy.h>
#include "../core/project.h"
#include "../grouping/groupinggroup.h"
#include "../gui/xic_view/xic_widgets/zivywidget.h"
......@@ -70,5 +69,3 @@ class MassChroQml
IdentificationGroup *_p_identification_group;
ZivyParams _detect_zivy;
};
#endif // MASSCHROQML_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