libpappsomspp
Library for mass spectrometry
|
#include <massspectraceplotwidget.h>
Public Member Functions | |
MassSpecTracePlotWidget (QWidget *parent=0) | |
MassSpecTracePlotWidget (QWidget *parent, const QString &x_axis_label, const QString &y_axis_label) | |
virtual | ~MassSpecTracePlotWidget () |
void | setChargeMinimalFractionalPart (double charge_fractional_part) |
double | getChargeMinimalFractionalPart () const |
void | setChargeStateEnvelopePeakSpan (int interval) |
int | getChargeStateEnvelopePeakSpan () const |
bool | deconvolute () |
Deconvolute the mass peaks into charge and molecular mass. More... | |
bool | deconvoluteIsotopicCluster () |
Deconvolute the mass peaks into charge and molecular mass. More... | |
bool | deconvoluteChargedState (int span=1) |
Deconvolute the mass peaks into charge and molecular mass. More... | |
bool | computeResolvingPower () |
virtual void | keyPressEvent (QKeyEvent *event) override |
Set the m_pressedKeyCode to the key code in event . More... | |
virtual void | keyReleaseEvent (QKeyEvent *event) override |
Handle specific key codes and trigger respective actions. More... | |
virtual void | mouseMoveHandler (QMouseEvent *event) override |
Handle mouse movements, in particular record all the last visited points. More... | |
virtual void | mousePressHandler (QMouseEvent *event) override |
Record the clicks of the mouse. More... | |
virtual void | mouseReleaseHandler (QMouseEvent *event) override |
React to the release of the mouse buttons. More... | |
virtual void | mouseMoveHandlerNotDraggingCursor () override |
virtual void | mouseMoveHandlerDraggingCursor () override |
const MassSpecTracePlotContext & | refreshBaseContext () const |
![]() | |
BaseTracePlotWidget (QWidget *parent=0) | |
BaseTracePlotWidget (QWidget *parent, const QString &x_axis_label, const QString &y_axis_label) | |
virtual | ~BaseTracePlotWidget () |
Destruct this BaseTracePlotWidget instance. More... | |
virtual void | setGraphData (int graph_index, const std::vector< double > &keys, const std::vector< double > &values) |
virtual void | setGraphData (QCPGraph *graph_p, const std::vector< double > &keys, const std::vector< double > &values) |
virtual void | clearGraphData (int graph_index) |
virtual void | axisDoubleClickHandler (QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event) override |
virtual void | axisRescale () override |
RANGE-related functions. More... | |
virtual void | axisReframe () override |
virtual void | axisZoom () override |
virtual void | axisPan () override |
virtual QCPGraph * | addTrace (const pappso::Trace &trace, const QColor &color) |
virtual bool | findIntegrationLowerRangeForKey (int index, double key, QCPRange &range) |
Find a minimal integration range starting at an existing data point. More... | |
std::vector< double > | getValuesX (int index) const |
std::vector< double > | getValuesY (int index) const |
QCPRange | getValueRangeOnKeyRange (QCPAbstractPlottable *plottable_p, bool &ok) |
QCPRange | getValueRangeOnKeyRange (int index, bool &ok) |
double | getYatX (double x, QCPGraph *graph_p) |
double | getYatX (double x, int index=0) |
pappso::Trace | toTrace (int index) const |
pappso::Trace | toTrace (const QCPGraph *graph_p) const |
pappso::Trace | toTrace (const QCPRange &x_axis_range, int index) const |
pappso::Trace | toTrace (const QCPRange &x_axis_range, const QCPGraph *graph_p) const |
![]() | |
BasePlotWidget (QWidget *parent) | |
BasePlotWidget (QWidget *parent, const QString &x_axis_label, const QString &y_axis_label) | |
virtual | ~BasePlotWidget () |
Destruct this BasePlotWidget instance. More... | |
virtual bool | setupWidget () |
virtual void | setPen (const QPen &pen) |
virtual const QPen & | getPen () const |
virtual void | setPlottingColor (QCPAbstractPlottable *plottable_p, const QColor &new_color) |
virtual void | setPlottingColor (int index, const QColor &new_color) |
virtual QColor | getPlottingColor (QCPAbstractPlottable *plottable_p) const |
virtual QColor | getPlottingColor (int index=0) const |
virtual void | setAxisLabelX (const QString &label) |
virtual void | setAxisLabelY (const QString &label) |
virtual void | resetAxesRangeHistory () |
virtual void | updateAxesRangeHistory () |
Create new axis range history items and append them to the history. More... | |
virtual void | restorePreviousAxesRangeHistory () |
Go up one history element in the axis history. More... | |
virtual void | restoreAxesRangeHistory (std::size_t index) |
Get the axis histories at index index and update the plot ranges. More... | |
virtual void | spaceKeyReleaseEvent (QKeyEvent *event) |
virtual void | directionKeyPressEvent (QKeyEvent *event) |
virtual void | directionKeyReleaseEvent (QKeyEvent *event) |
virtual void | mousePseudoButtonKeyPressEvent (QKeyEvent *event) |
virtual void | mousePseudoButtonKeyReleaseEvent (QKeyEvent *event) |
virtual void | mouseReleaseHandlerLeftButton () |
virtual void | mouseReleaseHandlerRightButton () |
virtual void | mouseWheelHandler (QWheelEvent *event) |
virtual void | mouseMoveHandlerLeftButtonDraggingCursor () |
virtual void | mouseMoveHandlerRightButtonDraggingCursor () |
bool | isClickOntoXAxis (const QPointF &mousePoint) |
bool | isClickOntoYAxis (const QPointF &mousePoint) |
int | dragDirection () |
MOUSE-related EVENTS. More... | |
virtual void | moveMouseCursorGraphCoordToGlobal (QPointF plot_coordinates) |
virtual void | moveMouseCursorPixelCoordToGlobal (QPointF local_coordinates) |
virtual void | horizontalMoveMouseCursorCountPixels (int pixel_count) |
virtual QPointF | horizontalGetGraphCoordNewPointCountPixels (int pixel_count) |
virtual void | verticalMoveMouseCursorCountPixels (int pixel_count) |
virtual QPointF | verticalGetGraphCoordNewPointCountPixels (int pixel_count) |
virtual QCPRange | getRangeX (bool &found_range, int index) const |
MOUSE MOVEMENTS mouse/keyboard-triggered. More... | |
virtual QCPRange | getRangeY (bool &found_range, int index) const |
QCPRange | getRange (Axis axis, RangeType range_type, bool &found_range) const |
virtual QCPRange | getInnermostRangeX (bool &found_range) const |
virtual QCPRange | getOutermostRangeX (bool &found_range) const |
virtual QCPRange | getInnermostRangeY (bool &found_range) const |
virtual QCPRange | getOutermostRangeY (bool &found_range) const |
void | yMinMaxOnXAxisCurrentRange (double &min, double &max, QCPAbstractPlottable *plottable_p=nullptr) |
void | yMinMaxOnXAxisCurrentRange (double &min, double &max, int index) |
virtual void | replotWithAxesRanges (QCPRange xAxisRange, QCPRange yAxisRange, Axis axis) |
virtual void | replotWithAxisRangeX (double lower, double upper) |
virtual void | replotWithAxisRangeY (double lower, double upper) |
virtual void | hideAllPlotItems () |
PLOTTING / REPLOTTING functions. More... | |
virtual void | showTracers () |
Show the traces (vertical and horizontal). More... | |
virtual void | hideTracers () |
Hide the traces (vertical and horizontal). More... | |
virtual void | drawXDeltaFeatures () |
virtual void | drawYDeltaFeatures () |
virtual void | calculateDragDeltas () |
virtual bool | isVerticalDisplacementAboveThreshold () |
virtual void | drawSelectionRectangleAndPrepareZoom (bool as_line_segment=false, bool for_integration=false) |
virtual void | updateSelectionRectangle (bool as_line_segment=false, bool for_integration=false) |
virtual void | resetSelectionRectangle () |
virtual void | hideSelectionRectangle (bool reset_values=false) |
virtual bool | isSelectionRectangleVisible () |
virtual PolygonType | whatIsVisibleOfTheSelectionRectangle () |
virtual void | setFocus () |
PLOT ITEMS : TRACER TEXT ITEMS... More... | |
virtual void | redrawPlotBackground (QWidget *focusedPlotWidget) |
Redraw the background of the focusedPlotWidget plot widget. More... | |
virtual void | updateContextXandYAxisRanges () |
virtual const BasePlotContext & | getContext () const |
Protected Attributes | |
MassSpecTracePlotContext | m_context |
double | m_chargeMinimalFractionalPart = 0.990 |
int | m_chargeStateEnvelopePeakSpan = 1 |
![]() | |
QString | m_name = "NOT_SET" |
Name of the plot widget. More... | |
QString | m_desc = "NOT_SET" |
Description of the plot widget. More... | |
QString | m_fileName |
The name of the data file from which the mass data were read. More... | |
QString | m_axisLabelX |
QString | m_axisLabelY |
BasePlotContext | m_context |
int | m_leftMousePseudoButtonKey = Qt::Key_Less |
int | m_rightMousePseudoButtonKey = Qt::Key_Greater |
QCPItemLine * | mp_selectionRectangeLine1 = nullptr |
Rectangle defining the borders of zoomed-in/out data. More... | |
QCPItemLine * | mp_selectionRectangeLine2 = nullptr |
QCPItemLine * | mp_selectionRectangeLine3 = nullptr |
QCPItemLine * | mp_selectionRectangeLine4 = nullptr |
QCPItemText * | mp_xDeltaTextItem = nullptr |
Text describing the x-axis delta value during a drag operation. More... | |
QCPItemText * | mp_yDeltaTextItem = nullptr |
bool | m_shouldTracersBeVisible = true |
Tells if the tracers should be visible. More... | |
QCPItemLine * | mp_hPosTracerItem = nullptr |
Horizontal position tracer. More... | |
QCPItemLine * | mp_vPosTracerItem = nullptr |
Vertical position tracer. More... | |
QCPItemLine * | mp_vStartTracerItem = nullptr |
Vertical selection start tracer (typically in green). More... | |
QCPItemLine * | mp_vEndTracerItem = nullptr |
Vertical selection end tracer (typically in red). More... | |
std::size_t | m_lastAxisRangeHistoryIndex = 0 |
Index of the last axis range history item. More... | |
std::vector< QCPRange * > | m_xAxisRangeHistory |
List of x axis ranges occurring during the panning zooming actions. More... | |
std::vector< QCPRange * > | m_yAxisRangeHistory |
List of y axis ranges occurring during the panning zooming actions. More... | |
int | m_mouseMoveHandlerSkipAmount = 10 |
How many mouse move events must be skipped */. More... | |
int | m_mouseMoveHandlerSkipCount = 0 |
Counter to handle the "fat data" mouse move event handling. More... | |
QColor | m_unfocusedColor = QColor("lightgray") |
Color used for the background of unfocused plot. More... | |
QBrush | m_unfocusedBrush = QBrush(m_unfocusedColor) |
Color used for the background of unfocused plot. More... | |
QColor | m_focusedColor = QColor(Qt::transparent) |
Color used for the background of focused plot. More... | |
QBrush | m_focusedBrush = QBrush(m_focusedColor) |
Color used for the background of focused plot. More... | |
QPen | m_pen |
Pen used to draw the graph and textual elements in the plot widget. More... | |
Additional Inherited Members | |
![]() | |
virtual void | createAllAncillaryItems () |
virtual void | update1DSelectionRectangle (bool for_integration=false) |
virtual void | update2DSelectionRectangleSquare (bool for_integration=false) |
virtual void | update2DSelectionRectangleSkewed (bool for_integration=false) |
virtual QString | allLayerNamesToString () const |
virtual QString | layerableLayerName (QCPLayerable *layerable_p) const |
virtual int | layerableLayerIndex (QCPLayerable *layerable_p) const |
Definition at line 57 of file massspectraceplotwidget.h.
|
explicit |
Definition at line 55 of file massspectraceplotwidget.cpp.
References m_context, pappso::BasePlotContext::m_dataKind, and pappso::mz.
|
explicit |
Definition at line 64 of file massspectraceplotwidget.cpp.
References m_context, pappso::BasePlotContext::m_dataKind, and pappso::mz.
|
virtual |
Definition at line 78 of file massspectraceplotwidget.cpp.
bool pappso::MassSpecTracePlotWidget::computeResolvingPower | ( | ) |
Definition at line 536 of file massspectraceplotwidget.cpp.
References m_context, pappso::MassSpecTracePlotContext::m_lastResolvingPower, pappso::BasePlotContext::m_xDelta, pappso::BasePlotContext::m_xRegionRangeEnd, pappso::BasePlotContext::m_xRegionRangeStart, and resolvingPowerComputationSignal().
Referenced by mouseMoveHandlerDraggingCursor().
bool pappso::MassSpecTracePlotWidget::deconvolute | ( | ) |
Deconvolute the mass peaks into charge and molecular mass.
Definition at line 245 of file massspectraceplotwidget.cpp.
References deconvoluteChargedState(), deconvoluteIsotopicCluster(), m_chargeStateEnvelopePeakSpan, m_context, and pappso::BasePlotContext::m_xDelta.
Referenced by mouseMoveHandlerDraggingCursor().
bool pappso::MassSpecTracePlotWidget::deconvoluteChargedState | ( | int | span = 1 | ) |
Deconvolute the mass peaks into charge and molecular mass.
This is one of two methods to deconvolute mass data into a charge value and a Mr value. The method implemented in this function is based on the charge state envelope offered by the mass spectrum (most often for polymers of a reasonable size).
span | value representing the number of peaks of the charge state envelope that are spanned by the user selection. Defaults to 1, that is, the span encompasses two consecutive mass peaks of a given charge state envelope. |
Set m_lastMz, m_lastZ and m_lastMass.
Definition at line 294 of file massspectraceplotwidget.cpp.
References m_chargeMinimalFractionalPart, m_context, pappso::MassSpecTracePlotContext::m_lastMr, pappso::MassSpecTracePlotContext::m_lastMz, pappso::MassSpecTracePlotContext::m_lastTicIntensity, pappso::MassSpecTracePlotContext::m_lastZ, pappso::BasePlotContext::m_xRegionRangeEnd, pappso::BasePlotContext::m_xRegionRangeStart, massDeconvolutionSignal(), and pappso::MPROTON().
Referenced by deconvolute().
bool pappso::MassSpecTracePlotWidget::deconvoluteIsotopicCluster | ( | ) |
Deconvolute the mass peaks into charge and molecular mass.
This is one of two methods to deconvolute mass data into a charge value and a Mr value. The method implemented in this function is based on the distance that separates two immediately consecutive peaks of an isotopic cluster. This method can be used as long as the instrument produced data with a resolution sufficient to separate reasonably well the different peaks of an isotopic cluster.
Set m_lastMz, m_lastZ and m_lastMass.
Definition at line 456 of file massspectraceplotwidget.cpp.
References m_chargeMinimalFractionalPart, m_context, pappso::MassSpecTracePlotContext::m_lastMr, pappso::MassSpecTracePlotContext::m_lastMz, pappso::MassSpecTracePlotContext::m_lastTicIntensity, pappso::MassSpecTracePlotContext::m_lastZ, pappso::BasePlotContext::m_xDelta, pappso::BasePlotContext::m_xRegionRangeEnd, pappso::BasePlotContext::m_xRegionRangeStart, massDeconvolutionSignal(), and pappso::MPROTON().
Referenced by deconvolute().
double pappso::MassSpecTracePlotWidget::getChargeMinimalFractionalPart | ( | ) | const |
Definition at line 223 of file massspectraceplotwidget.cpp.
References m_chargeMinimalFractionalPart.
int pappso::MassSpecTracePlotWidget::getChargeStateEnvelopePeakSpan | ( | ) | const |
Definition at line 237 of file massspectraceplotwidget.cpp.
References m_chargeStateEnvelopePeakSpan.
|
overridevirtual |
Set the m_pressedKeyCode
to the key code in event
.
Reimplemented from pappso::BasePlotWidget.
Definition at line 85 of file massspectraceplotwidget.cpp.
References pappso::BasePlotWidget::keyPressEvent(), keyPressEventSignal(), m_context, and refreshBaseContext().
|
signal |
Referenced by keyPressEvent().
|
overridevirtual |
Handle specific key codes and trigger respective actions.
Reimplemented from pappso::BasePlotWidget.
Definition at line 102 of file massspectraceplotwidget.cpp.
References pappso::BasePlotWidget::keyReleaseEvent(), and refreshBaseContext().
|
signal |
Referenced by deconvoluteChargedState(), and deconvoluteIsotopicCluster().
|
overridevirtual |
Handle mouse movements, in particular record all the last visited points.
This function is reponsible for storing at each time the last visited point in the graph. Here, point is intended as any x/y coordinate in the plot widget viewport, not a graph point.
The stored values are then the basis for a large set of calculations throughout all the plot widget.
pointer | to QMouseEvent from which to retrieve the coordinates of the visited viewport points. |
Reimplemented from pappso::BasePlotWidget.
Definition at line 126 of file massspectraceplotwidget.cpp.
References pappso::BasePlotWidget::mouseMoveHandler(), and refreshBaseContext().
|
overridevirtual |
Reimplemented from pappso::BasePlotWidget.
Definition at line 148 of file massspectraceplotwidget.cpp.
References computeResolvingPower(), deconvolute(), m_context, pappso::BasePlotContext::m_isMeasuringDistance, pappso::BasePlotContext::m_mouseButtonsAtMousePress, pappso::BasePlotWidget::mouseMoveHandlerDraggingCursor(), and refreshBaseContext().
|
overridevirtual |
Reimplemented from pappso::BasePlotWidget.
Definition at line 137 of file massspectraceplotwidget.cpp.
References pappso::BasePlotWidget::mouseMoveHandlerNotDraggingCursor(), and refreshBaseContext().
|
overridevirtual |
Record the clicks of the mouse.
Reimplemented from pappso::BasePlotWidget.
Definition at line 172 of file massspectraceplotwidget.cpp.
References pappso::BasePlotWidget::mousePressHandler(), and refreshBaseContext().
|
signal |
|
overridevirtual |
React to the release of the mouse buttons.
Reimplemented from pappso::BasePlotWidget.
Definition at line 184 of file massspectraceplotwidget.cpp.
References pappso::BasePlotWidget::mouseReleaseHandler(), and refreshBaseContext().
const MassSpecTracePlotContext & pappso::MassSpecTracePlotWidget::refreshBaseContext | ( | ) | const |
Definition at line 195 of file massspectraceplotwidget.cpp.
References pappso::BasePlotWidget::m_context, and m_context.
Referenced by keyPressEvent(), keyReleaseEvent(), mouseMoveHandler(), mouseMoveHandlerDraggingCursor(), mouseMoveHandlerNotDraggingCursor(), mousePressHandler(), and mouseReleaseHandler().
|
signal |
Referenced by computeResolvingPower().
void pappso::MassSpecTracePlotWidget::setChargeMinimalFractionalPart | ( | double | charge_fractional_part | ) |
Definition at line 215 of file massspectraceplotwidget.cpp.
References m_chargeMinimalFractionalPart.
void pappso::MassSpecTracePlotWidget::setChargeStateEnvelopePeakSpan | ( | int | interval | ) |
Definition at line 230 of file massspectraceplotwidget.cpp.
References m_chargeStateEnvelopePeakSpan.
|
protected |
Definition at line 120 of file massspectraceplotwidget.h.
Referenced by deconvoluteChargedState(), deconvoluteIsotopicCluster(), getChargeMinimalFractionalPart(), and setChargeMinimalFractionalPart().
|
protected |
Definition at line 127 of file massspectraceplotwidget.h.
Referenced by deconvolute(), getChargeStateEnvelopePeakSpan(), and setChargeStateEnvelopePeakSpan().
|
mutableprotected |
Definition at line 113 of file massspectraceplotwidget.h.
Referenced by MassSpecTracePlotWidget(), computeResolvingPower(), deconvolute(), deconvoluteChargedState(), deconvoluteIsotopicCluster(), keyPressEvent(), mouseMoveHandlerDraggingCursor(), and refreshBaseContext().