libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
massspectraceplotwidget.h
Go to the documentation of this file.
1
/* This code comes right from the msXpertSuite software project.
2
*
3
* msXpertSuite - mass spectrometry software suite
4
* -----------------------------------------------
5
* Copyright(C) 2009,...,2018 Filippo Rusconi
6
*
7
* http://www.msxpertsuite.org
8
*
9
* This program is free software: you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation, either version 3 of the License, or
12
* (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
18
*
19
* You should have received a copy of the GNU General Public License
20
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21
*
22
* END software license
23
*/
24
25
26
#pragma once
27
28
/////////////////////// StdLib includes
29
30
31
/////////////////////// Qt includes
32
#include <QObject>
33
#include <QString>
34
#include <QWidget>
35
#include <QBrush>
36
#include <QColor>
37
#include <QVector>
38
39
40
/////////////////////// QCustomPlot
41
#include <qcustomplot.h>
42
43
44
/////////////////////// pappsomspp includes
45
46
47
/////////////////////// Local includes
48
#include "
pappsomspp/export-import-config.h
"
49
#include "
basetraceplotwidget.h
"
50
#include "
massspectraceplotcontext.h
"
51
52
53
namespace
pappso
54
{
55
56
57
class
PMSPP_LIB_DECL
MassSpecTracePlotWidget
:
public
BaseTracePlotWidget
58
{
59
Q_OBJECT
60
61
public
:
62
explicit
MassSpecTracePlotWidget
(QWidget *parent = 0);
63
explicit
MassSpecTracePlotWidget
(QWidget *parent,
64
const
QString &x_axis_label,
65
const
QString &y_axis_label);
66
67
virtual
~MassSpecTracePlotWidget
();
68
69
/******* Mass spectrum-specific calculations *******/
70
/******* Mass spectrum-specific calculations *******/
71
void
setChargeMinimalFractionalPart
(
double
charge_fractional_part);
72
double
getChargeMinimalFractionalPart
()
const
;
73
74
void
setChargeStateEnvelopePeakSpan
(
int
interval);
75
int
getChargeStateEnvelopePeakSpan
()
const
;
76
77
bool
deconvolute
();
78
bool
deconvoluteIsotopicCluster
();
79
bool
deconvoluteChargedState
(
int
span = 1);
80
bool
computeResolvingPower
();
81
/******* Mass spectrum-specific calculations *******/
82
83
84
/******* Mouse and keyboard event handlers *******/
85
/******* Mouse and keyboard event handlers *******/
86
virtual
void
keyPressEvent
(QKeyEvent *event)
override
;
87
virtual
void
keyReleaseEvent
(QKeyEvent *event)
override
;
88
89
virtual
void
mouseMoveHandler
(QMouseEvent *event)
override
;
90
91
virtual
void
mousePressHandler
(QMouseEvent *event)
override
;
92
virtual
void
mouseReleaseHandler
(QMouseEvent *event)
override
;
93
94
virtual
void
mouseMoveHandlerNotDraggingCursor
()
override
;
95
virtual
void
mouseMoveHandlerDraggingCursor
()
override
;
96
/******* Mouse and keyboard event handlers *******/
97
98
const
MassSpecTracePlotContext
&
refreshBaseContext
()
const
;
99
100
signals:
101
102
// Here we have signals that are specific of the mass spectrum-oriented
103
// version of the plot widget.
104
105
void
keyPressEventSignal
(
const
MassSpecTracePlotContext
&context);
106
107
void
massDeconvolutionSignal
(
const
MassSpecTracePlotContext
&context);
108
void
resolvingPowerComputationSignal
(
const
MassSpecTracePlotContext
&context);
109
110
void
mousePressEventSignal
(
const
MassSpecTracePlotContext
&context);
111
void
mouseReleaseEventSignal
(
const
MassSpecTracePlotContext
&context);
112
113
protected
:
114
mutable
MassSpecTracePlotContext
m_context
;
115
116
// This value is the tolerance on the fractional part of the charge value that
117
// is computed by the deconvolution. If the z value that is deconvoluted is,
118
// for example, 2.980, and m_chargeFractionalPartTolerance = 0.990, then no z
119
// value will be displayed: we are not reaching an integer near enough for the
120
// z value to be considered valid.
121
double
m_chargeMinimalFractionalPart
= 0.990;
122
123
// When performing deconvolutions based on the distance between peaks belong
124
// to the same charge state envelope, this value indicates the distance
125
// between the peaks that are used for the calculation. When the peaks are
126
// consecutive, the distance is 1. If there is one peak in between, the
127
// distance is 2.
128
int
m_chargeStateEnvelopePeakSpan
= 1;
129
};
130
131
132
}
// namespace pappso
133
134
extern
int
massSpecTracePlotContextMetaTypeId
;
135
136
extern
int
massSpecTracePlotContextPtrMetaTypeId
;
basetraceplotwidget.h
pappso::BaseTracePlotWidget::BaseTracePlotWidget
BaseTracePlotWidget(QWidget *parent=0)
Definition
basetraceplotwidget.cpp:44
pappso::MassSpecTracePlotContext
Definition
massspectraceplotcontext.h:33
pappso::MassSpecTracePlotWidget::mouseMoveHandler
virtual void mouseMoveHandler(QMouseEvent *event) override
Handle mouse movements, in particular record all the last visited points.
Definition
massspectraceplotwidget.cpp:126
pappso::MassSpecTracePlotWidget::resolvingPowerComputationSignal
void resolvingPowerComputationSignal(const MassSpecTracePlotContext &context)
pappso::MassSpecTracePlotWidget::keyReleaseEvent
virtual void keyReleaseEvent(QKeyEvent *event) override
Handle specific key codes and trigger respective actions.
Definition
massspectraceplotwidget.cpp:102
pappso::MassSpecTracePlotWidget::computeResolvingPower
bool computeResolvingPower()
Definition
massspectraceplotwidget.cpp:552
pappso::MassSpecTracePlotWidget::refreshBaseContext
const MassSpecTracePlotContext & refreshBaseContext() const
Definition
massspectraceplotwidget.cpp:209
pappso::MassSpecTracePlotWidget::m_context
MassSpecTracePlotContext m_context
Definition
massspectraceplotwidget.h:114
pappso::MassSpecTracePlotWidget::deconvoluteChargedState
bool deconvoluteChargedState(int span=1)
Deconvolute the mass peaks into charge and molecular mass.
Definition
massspectraceplotwidget.cpp:313
pappso::MassSpecTracePlotWidget::MassSpecTracePlotWidget
MassSpecTracePlotWidget(QWidget *parent=0)
Definition
massspectraceplotwidget.cpp:55
pappso::MassSpecTracePlotWidget::m_chargeStateEnvelopePeakSpan
int m_chargeStateEnvelopePeakSpan
Definition
massspectraceplotwidget.h:128
pappso::MassSpecTracePlotWidget::mousePressEventSignal
void mousePressEventSignal(const MassSpecTracePlotContext &context)
pappso::MassSpecTracePlotWidget::deconvoluteIsotopicCluster
bool deconvoluteIsotopicCluster()
Deconvolute the mass peaks into charge and molecular mass.
Definition
massspectraceplotwidget.cpp:472
pappso::MassSpecTracePlotWidget::deconvolute
bool deconvolute()
Deconvolute the mass peaks into charge and molecular mass.
Definition
massspectraceplotwidget.cpp:265
pappso::MassSpecTracePlotWidget::mouseMoveHandlerDraggingCursor
virtual void mouseMoveHandlerDraggingCursor() override
Definition
massspectraceplotwidget.cpp:148
pappso::MassSpecTracePlotWidget::keyPressEventSignal
void keyPressEventSignal(const MassSpecTracePlotContext &context)
pappso::MassSpecTracePlotWidget::massDeconvolutionSignal
void massDeconvolutionSignal(const MassSpecTracePlotContext &context)
pappso::MassSpecTracePlotWidget::mousePressHandler
virtual void mousePressHandler(QMouseEvent *event) override
Record the clicks of the mouse.
Definition
massspectraceplotwidget.cpp:172
pappso::MassSpecTracePlotWidget::setChargeMinimalFractionalPart
void setChargeMinimalFractionalPart(double charge_fractional_part)
Definition
massspectraceplotwidget.cpp:235
pappso::MassSpecTracePlotWidget::getChargeMinimalFractionalPart
double getChargeMinimalFractionalPart() const
Definition
massspectraceplotwidget.cpp:243
pappso::MassSpecTracePlotWidget::keyPressEvent
virtual void keyPressEvent(QKeyEvent *event) override
Set the m_pressedKeyCode to the key code in event.
Definition
massspectraceplotwidget.cpp:85
pappso::MassSpecTracePlotWidget::mouseReleaseEventSignal
void mouseReleaseEventSignal(const MassSpecTracePlotContext &context)
pappso::MassSpecTracePlotWidget::getChargeStateEnvelopePeakSpan
int getChargeStateEnvelopePeakSpan() const
Definition
massspectraceplotwidget.cpp:257
pappso::MassSpecTracePlotWidget::m_chargeMinimalFractionalPart
double m_chargeMinimalFractionalPart
Definition
massspectraceplotwidget.h:121
pappso::MassSpecTracePlotWidget::mouseMoveHandlerNotDraggingCursor
virtual void mouseMoveHandlerNotDraggingCursor() override
Definition
massspectraceplotwidget.cpp:137
pappso::MassSpecTracePlotWidget::setChargeStateEnvelopePeakSpan
void setChargeStateEnvelopePeakSpan(int interval)
Definition
massspectraceplotwidget.cpp:250
pappso::MassSpecTracePlotWidget::mouseReleaseHandler
virtual void mouseReleaseHandler(QMouseEvent *event) override
React to the release of the mouse buttons.
Definition
massspectraceplotwidget.cpp:191
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
massspectraceplotcontext.h
massSpecTracePlotContextMetaTypeId
int massSpecTracePlotContextMetaTypeId
Definition
massspectraceplotwidget.cpp:43
massSpecTracePlotContextPtrMetaTypeId
int massSpecTracePlotContextPtrMetaTypeId
Definition
massspectraceplotwidget.cpp:47
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappsomspp
gui
plotwidget
massspectraceplotwidget.h
Generated on Tue Sep 23 2025 09:36:37 for libpappsomspp by
1.13.2