xicwindow.h 2.84 KB
Newer Older
Langella Olivier's avatar
Langella Olivier committed
1
2
3
4
5
6
7
/**
 * \file src/gui/xic_view/xicwindow.h
 * \date 11/1/2018
 * \author Olivier Langella
 * \brief XIC window
 */
/*******************************************************************************
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 * Copyright (c) 2018 Olivier Langella <olivier.langella@u-psud.fr>.
 *
 * This file is part of XTPcpp.
 *
 *     XTPcpp is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 *
 *     XTPcpp is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License
 *     along with XTPcpp.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Contributors:
 *     Olivier Langella <olivier.langella@u-psud.fr> - initial API and
 *implementation
 ******************************************************************************/
Langella Olivier's avatar
Langella Olivier committed
29

30
#pragma once
Langella Olivier's avatar
Langella Olivier committed
31
32

#include <QMainWindow>
33
#include <QAbstractButton>
Langella Olivier's avatar
Langella Olivier committed
34
#include <pappsomspp/xic/xic.h>
35
#include <pappsomspp/processing/detection/tracedetectionzivy.h>
Langella Olivier's avatar
Langella Olivier committed
36

Langella Olivier's avatar
Langella Olivier committed
37
#include "../../core/peptideevidence.h"
38
#include "xic_widgets/zivydialog.h"
39
#include <qcustomplot.h>
Langella Olivier's avatar
Langella Olivier committed
40

Langella Olivier's avatar
Langella Olivier committed
41
class ProjectWindow;
Langella Olivier's avatar
Langella Olivier committed
42
43


44
45
namespace Ui
{
46
class XicWindow;
Langella Olivier's avatar
Langella Olivier committed
47
48
}

Langella Olivier's avatar
Langella Olivier committed
49
50
class XicBox;

51
52
53
54
55
56
57
58
59
60
61
62
63
class XicWindow : public QMainWindow
{
  Q_OBJECT
  friend XicBox;

  public:
  explicit XicWindow(ProjectWindow *parent = 0);
  ~XicWindow();

  void addXic(const PeptideEvidence *p_peptide_evidence);
  void addXicInMsRun(const PeptideEvidence *p_peptide_evidence,
                     MsRunSp msrun_sp);

64
  pappso::PrecisionPtr getXicExtractPrecision() const;
65
  pappso::XicExtractMethod getXicExtractionMethod() const;
66
67
68
69
70

  bool isRetentionTimeSeconds() const;

  void clear();
  public slots:
71
  void xicPrecisionChanged(pappso::PrecisionPtr precision);
72
73
74
75
76
  void rtUnitChanged(QAbstractButton *button);

  protected slots:
  void doEditZivyParams();
  void doAcceptedZivyDialog();
77
  void doXicExtractionMethodChanged(pappso::XicExtractMethod xic_method);
Renne Thomas's avatar
Renne Thomas committed
78
  void doExportXicToCsv();
Renne Thomas's avatar
Renne Thomas committed
79
  void doChangeLockXaxisRule();
80
81
  void doFitAllAxis(QString axis_name, QCPRange new_range);

82
83
84
  signals:
  void reExtractXicNeeded();
  void rtUnitChangeNeeded();
Renne Thomas's avatar
Renne Thomas committed
85
  void operateXicAreaToCsv(QString filename, std::vector<XicBox *> xic_boxs);
86
87
88
89
90
91
92


  protected:
  ProjectWindow *getProjectWindow();
  void removeXicBox(XicBox *xic_box);

  void xicDetect(const pappso::Xic &xic,
Langella Olivier's avatar
Langella Olivier committed
93
                 pappso::TraceDetectionSinkInterface *sink) const;
94
95
96
97

  private:
  ProjectWindow *_project_window;
  Ui::XicWindow *ui;
Renne Thomas's avatar
Renne Thomas committed
98
  bool m_lockXaxis = false;
Langella Olivier's avatar
Langella Olivier committed
99
  std::shared_ptr<pappso::TraceDetectionInterface> msp_detect_zivy;
100
101
102


  ZivyDialog *_p_zivy_dialog;
Langella Olivier's avatar
Langella Olivier committed
103
};