Loading...
Searching...
No Matches
massspectraceplotwidget.h
Go to the documentation of this file.
/* This code comes right from the msXpertSuite software project.
*
* msXpertSuite - mass spectrometry software suite
* -----------------------------------------------
* Copyright(C) 2009,...,2018 Filippo Rusconi
*
* http://www.msxpertsuite.org
*
* This program 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.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*
* END software license
*/
#pragma once
/////////////////////// StdLib includes
/////////////////////// Qt includes
#include <QObject>
#include <QString>
#include <QWidget>
#include <QBrush>
#include <QColor>
#include <QVector>
/////////////////////// QCustomPlot
#include <qcustomplot.h>
/////////////////////// pappsomspp includes
/////////////////////// Local includes
#include "pappsomspp/export-import-config.h"
#include "basetraceplotwidget.h"
#include "massspectraceplotcontext.h"
namespace pappso
{
class PMSPP_LIB_DECL MassSpecTracePlotWidget : public BaseTracePlotWidget
{
Q_OBJECT
public:
explicit MassSpecTracePlotWidget(QWidget *parent = 0);
explicit MassSpecTracePlotWidget(QWidget *parent,
const QString &x_axis_label,
const QString &y_axis_label);
virtual ~MassSpecTracePlotWidget();
/******* Mass spectrum-specific calculations *******/
/******* Mass spectrum-specific calculations *******/
void setChargeMinimalFractionalPart(double charge_fractional_part);
double getChargeMinimalFractionalPart() const;
void setChargeStateEnvelopePeakSpan(int interval);
int getChargeStateEnvelopePeakSpan() const;
bool deconvolute();
bool deconvoluteIsotopicCluster();
bool deconvoluteChargedState(int span = 1);
bool computeResolvingPower();
/******* Mass spectrum-specific calculations *******/
/******* Mouse and keyboard event handlers *******/
/******* Mouse and keyboard event handlers *******/
virtual void keyPressEvent(QKeyEvent *event) override;
virtual void keyReleaseEvent(QKeyEvent *event) override;
virtual void mouseMoveHandler(QMouseEvent *event) override;
virtual void mousePressHandler(QMouseEvent *event) override;
virtual void mouseReleaseHandler(QMouseEvent *event) override;
virtual void mouseMoveHandlerNotDraggingCursor() override;
virtual void mouseMoveHandlerDraggingCursor() override;
/******* Mouse and keyboard event handlers *******/
const MassSpecTracePlotContext &refreshBaseContext() const;
signals:
// Here we have signals that are specific of the mass spectrum-oriented
// version of the plot widget.
void keyPressEventSignal(const MassSpecTracePlotContext &context);
void massDeconvolutionSignal(const MassSpecTracePlotContext &context);
void resolvingPowerComputationSignal(const MassSpecTracePlotContext &context);
void mousePressEventSignal(const MassSpecTracePlotContext &context);
void mouseReleaseEventSignal(const MassSpecTracePlotContext &context);
protected:
mutable MassSpecTracePlotContext m_context;
// This value is the tolerance on the fractional part of the charge value that
// is computed by the deconvolution. If the z value that is deconvoluted is,
// for example, 2.980, and m_chargeFractionalPartTolerance = 0.990, then no z
// value will be displayed: we are not reaching an integer near enough for the
// z value to be considered valid.
double m_chargeMinimalFractionalPart = 0.990;
// When performing deconvolutions based on the distance between peaks belong
// to the same charge state envelope, this value indicates the distance
// between the peaks that are used for the calculation. When the peaks are
// consecutive, the distance is 1. If there is one peak in between, the
// distance is 2.
int m_chargeStateEnvelopePeakSpan = 1;
};
} // namespace pappso
extern int massSpecTracePlotContextMetaTypeId;
extern int massSpecTracePlotContextPtrMetaTypeId;
basetraceplotwidget.h
pappso::BaseTracePlotWidget::BaseTracePlotWidget
BaseTracePlotWidget(QWidget *parent=0)
Definition basetraceplotwidget.cpp:43
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:123
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:99
pappso::MassSpecTracePlotWidget::computeResolvingPower
bool computeResolvingPower()
Definition massspectraceplotwidget.cpp:604
pappso::MassSpecTracePlotWidget::refreshBaseContext
const MassSpecTracePlotContext & refreshBaseContext() const
Definition massspectraceplotwidget.cpp:222
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:339
pappso::MassSpecTracePlotWidget::MassSpecTracePlotWidget
MassSpecTracePlotWidget(QWidget *parent=0)
Definition massspectraceplotwidget.cpp:53
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:484
pappso::MassSpecTracePlotWidget::deconvolute
bool deconvolute()
Deconvolute the mass peaks into charge and molecular mass.
Definition massspectraceplotwidget.cpp:285
pappso::MassSpecTracePlotWidget::mouseMoveHandlerDraggingCursor
virtual void mouseMoveHandlerDraggingCursor() override
Definition massspectraceplotwidget.cpp:147
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:256
pappso::MassSpecTracePlotWidget::getChargeMinimalFractionalPart
double getChargeMinimalFractionalPart() const
Definition massspectraceplotwidget.cpp:263
pappso::MassSpecTracePlotWidget::keyPressEvent
virtual void keyPressEvent(QKeyEvent *event) override
Set the m_pressedKeyCode to the key code in event.
Definition massspectraceplotwidget.cpp:82
pappso::MassSpecTracePlotWidget::mouseReleaseEventSignal
void mouseReleaseEventSignal(const MassSpecTracePlotContext &context)
pappso::MassSpecTracePlotWidget::getChargeStateEnvelopePeakSpan
int getChargeStateEnvelopePeakSpan() const
Definition massspectraceplotwidget.cpp:277
pappso::MassSpecTracePlotWidget::m_chargeMinimalFractionalPart
double m_chargeMinimalFractionalPart
Definition massspectraceplotwidget.h:121
pappso::MassSpecTracePlotWidget::mouseMoveHandlerNotDraggingCursor
virtual void mouseMoveHandlerNotDraggingCursor() override
Definition massspectraceplotwidget.cpp:134
pappso::MassSpecTracePlotWidget::setChargeStateEnvelopePeakSpan
void setChargeStateEnvelopePeakSpan(int interval)
Definition massspectraceplotwidget.cpp:270
pappso::MassSpecTracePlotWidget::mouseReleaseHandler
virtual void mouseReleaseHandler(QMouseEvent *event) override
React to the release of the mouse buttons.
Definition massspectraceplotwidget.cpp:193
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:46
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39