CycloBranch
cSpectrumDetailWidget.h
Go to the documentation of this file.
1
7#ifndef _CSPECTRUMDETAILWIDGET_H
8#define _CSPECTRUMDETAILWIDGET_H
9
10#include <QWidget>
11#include <QDesktopServices>
12#include <QToolBar>
13#include <QMenuBar>
14#include <QMenu>
15#include <QUrl>
16#include <QFileInfo>
17#include <QMainWindow>
18#include <QTextDocument>
19#include <QTableView>
20#include <QStandardItemModel>
21#include <QStandardItem>
22#include <QHeaderView>
23#include <QProgressDialog>
24#include <QTextStream>
27#include "gui/cLinearWidget.h"
28#include "gui/cCyclicWidget.h"
29#include "gui/cBranchedWidget.h"
32#include "gui/cFindDialog.h"
33#include "gui/cExportDialog.h"
34#include "gui/cEventFilter.h"
37#include "gui/cHTMLDelegate.h"
38
39
40// forward declaration
41class QTextBrowser;
42class QHBoxLayout;
43class QVBoxLayout;
44class QFormLayout;
45class QCheckBox;
46class QPushButton;
47class QSplitter;
48class QComboBox;
49class QDoubleSpinBox;
50class QAction;
51class QLabel;
52
53
61 int row;
62
63
67 int column;
68
69
71 row = 0;
72 column = 0;
73 }
74};
75
76
80class cSpectrumDetailWidget : public QMainWindow
81{
82 Q_OBJECT
83
84public:
85
86
91
92
98
99
105
106
111
112
117 void closeEvent(QCloseEvent *event);
118
119
130 void initialize(int rowid, string scantitle, int activefileid, cGlobalPreferences* globalpreferences, cParameters* parameters, cTheoreticalSpectrum& theoreticalspectrum, QWidget* parent);
131
132
138
139
144 string getDetailsAsHTMLString();
145
146
154 string getPeaksTableAsHTMLString(bool unmatchedtheoreticalpeaks, bool unmatchedexperimentalpeaks, bool exportisomers);
155
156
163 string getPartialPeaksTableAsHTMLString(int id, bool exportisomers);
164
165
175 void prepareToShow(QAction* actionShowIsomers, cPeakListSeries* rawdata, vector<cImzMLItem>* imzmlprofilemetadata, bool profilemz64precision, bool profileintensity64precision, bool usedefaultsize);
176
177
184 void findAll(const QString& str, QTextDocument::FindFlags opt = 0, bool errormessage = true);
185
186
191 void exportImage(bool exportspectrum);
192
193
198 void zoomToPeak(double value);
199
200
205 set<string>& getLocalNeutralLosses();
206
207
212 void setProfileSpectrumEnabled(bool enable);
213
214
220
221
225 void disableProfileMode();
226
227
232 void setAbsoluteIntensityEnabled(bool enable);
233
234
240
241
246 void setHideMatchedPeaksEnabled(bool enable);
247
248
254
255
260 void setHideUnmatchedPeaksEnabled(bool enable);
261
262
268
269
274 void setHideScrambledPeaksEnabled(bool enable);
275
276
282
283
288 void setHidePeakLabelsEnabled(bool enable);
289
290
296
297
302 void setMouseMzSelectionEnabled(bool enable);
303
304
310
311
312protected:
313
314
319 void keyPressEvent(QKeyEvent *event);
320
321
326 void moveEvent(QMoveEvent *event);
327
328
329private:
330
331 QWidget* parent;
332 QAction* actionShowIsomers;
333
334 QMenuBar* menuBar;
335 QMenu* menuFile;
336 QMenu* menuFind;
337 QMenu* menuView;
338 QMenu* menuHelp;
339
340 QToolBar* toolbarFile;
341 QToolBar* toolbarFind;
342 QToolBar* toolbarView;
343 QToolBar* toolbarHelp;
344 QToolBar* toolbarMz;
345 QToolBar* toolbarIonSeries;
346 QToolBar* toolbarNeutralLoss;
347 QToolBar* toolbarRotation;
348 QToolBar* toolbarTrotation;
349
350 QAction* actionExportTable;
351 QAction* actionExportSpectrum;
352 QAction* actionCloseWindow;
353 QAction* actionFind;
354 QAction* actionPrevious;
355 QAction* actionNext;
356 QAction* actionZoomIn;
357 QAction* actionZoomOut;
358 QAction* actionZoomReset;
359 QAction* actionAbsoluteIntensity;
360 QAction* actionRawData;
361 QAction* actionHideMatched;
362 QAction* actionHideUnmatched;
363 QAction* actionHideScrambled;
364 QAction* actionHideLabels;
365 QAction* actionMouseMzSelection;
366 QAction* actionHTMLDocumentation;
367 QSplitter* hsplitter1;
368 QSplitter* hsplitter2;
369 QSplitter* vsplitter;
370
371 QWidget* widgetmz;
372 QHBoxLayout* hboxmz;
373 QLabel* labelmz;
374 QDoubleSpinBox* minmz;
375 QLabel* labelseparator;
376 QDoubleSpinBox* maxmz;
377 QPushButton* setmzinterval;
378 QPushButton* resetmzinterval;
379
380 QWidget* ionserieswidget;
381 QHBoxLayout* ionserieshbox;
382 QLabel* ionserieslabel;
383 QComboBox* ionseriescombobox;
384
385 QWidget* neutrallosswidget;
386 QHBoxLayout* neutrallosshbox;
387 QLabel* neutrallosslabel;
388 QComboBox* neutrallosscombobox;
389
390 QWidget* rotationwidget;
391 QHBoxLayout* rotationhbox;
392 QLabel* rotationlabel;
393 QComboBox* rotationcombobox;
394
395 QWidget* trotationwidget;
396 QHBoxLayout* trotationhbox;
397 QLabel* trotationlabel;
398 QComboBox* trotationcombobox;
399
400 QTextBrowser* textbrowser;
401
402 QTableView* peakstable;
403 QStandardItemModel* peakstablemodel;
404 cSpectrumDetailProxyModel* proxymodel;
405
406 vector<cTablePosition> tablematches;
407
408 cLinearWidget* linearwidget;
409 cCyclicWidget* cyclicwidget;
410 cBranchedWidget* branchedwidget;
411 cBranchCyclicWidget* branchcyclicwidget;
412
413 cSpectrumSceneWidget* spectrumscene;
414
415 cTheoreticalSpectrum* theoreticalspectrum;
416
417 int rowid;
418 string scantitle;
419 bool preparedToShow;
420
421 set<string> localneutralosses;
422
423 cGlobalPreferences* globalpreferences;
424 cParameters* parameters;
425
426 cPeakListSeries* rawdata;
427 vector<cImzMLItem>* imzmlprofilemetadata;
428 bool profilemz64precision;
429 bool profileintensity64precision;
430
431 cFindDialog* finddialog;
432 cExportDialog* exportdialog;
433 int currentfinditem;
434
435 bool reportisomers;
436
437 int activefileid;
438
439 void preparePeaksTable(QRect geometry);
440
441 string printHTMLTableCell(string text, bool red);
442
443
444signals:
445
446
452 void emitMZInterval(double minmz, double maxmz);
453
454
460
461
467
468
473 void lastActiveDetail(int rowid);
474
475
476private slots:
477
478
479 void updateMZInterval(double minmz, double maxmz);
480
481
482 void setMZInterval();
483
484
485 void exportSpectrum();
486
487
488 void exportPeptide();
489
490
491 void openFindDialog();
492
493
494 void openExportImageDialog();
495
496
497 void exportTableToCSV();
498
499
500 void movePrevious();
501
502
503 void moveNext();
504
505
506 void headerItemClicked(int index);
507
508
509 void filterPeaksTable();
510
511
512 void rawDataStateChanged(bool state);
513
514
515 void absoluteIntensityStateChanged(bool state);
516
517
518 void hideMatchedPeaks(bool hide);
519
520
521 void hideUnmatchedPeaks(bool hide);
522
523
524 void hideScrambledPeaks(bool hide);
525
526
527 void hidePeakLabels(bool hide);
528
529
530 void filterTableAfterIonSeriesChanged(int index);
531
532
533 void filterTableAfterNeutralLossChanged(int index);
534
535
536 void filterTableAfterRotationChanged(int index);
537
538
539 void filterTableAfterTRotationChanged(int index);
540
541
542 void showIsomersStateChanged();
543
544
545 void showHTMLDocumentation();
546
547
548 void closeWindow();
549
550
551 void tableDoubleClicked(const QModelIndex& index);
552
553};
554
555#endif
556
Visualization of a branch-cyclic peptide.
Visualization of a branched peptide.
Visualization of a cyclic peptide.
An event filter.
The implementation of a dialog to export spectrum/peptide image.
The implementation of a find dialog.
The representation of a set of peptide sequence candidates.
A delegate to display rich text.
Visualization of a linear peptide.
A table proxy model.
The implementation of a widget painting a 2D mass spectrum.
The representation of a theoretical mass spectrum.
A delegate to create a reference view button.
Visualization of a branch-cyclic peptide.
Definition: cBranchCyclicWidget.h:66
Visualization of a branched peptide.
Definition: cBranchedWidget.h:23
Visualization of a cyclic peptide.
Definition: cCyclicWidget.h:96
The implementation of a dialog to export spectrum/peptide image.
Definition: cExportDialog.h:22
The implementation of a find dialog.
Definition: cFindDialog.h:24
The class storing global preferences.
Definition: cGlobalPreferences.h:104
Visualization of a linear peptide.
Definition: cLinearWidget.h:119
The class storing parameters of the application.
Definition: cParameters.h:82
The class representing a series of peaklists.
Definition: cPeakListSeries.h:21
A table proxy model.
Definition: cSpectrumDetailProxyModel.h:19
The class representing a widget for visualisation of a detail of a spectrum (opened after doubleclick...
Definition: cSpectrumDetailWidget.h:81
bool hasMouseMzSelectionEnabled()
Check if the mouse m/z selection tool is enabled.
Definition: cSpectrumDetailWidget.cpp:1487
bool hasHideUnmatchedPeaksEnabled()
Check if the hide unmatched peaks mode is enabled.
Definition: cSpectrumDetailWidget.cpp:1457
bool hasProfileSpectrumEnabled()
Check if the profile spectrum visualization is enabled.
Definition: cSpectrumDetailWidget.cpp:1422
void findAll(const QString &str, QTextDocument::FindFlags opt=0, bool errormessage=true)
Find all occurrences of str and highlight them.
Definition: cSpectrumDetailWidget.cpp:1297
void setHideScrambledPeaksEnabled(bool enable)
Set the state of hide scrambled peaks mode.
Definition: cSpectrumDetailWidget.cpp:1462
void zoomToPeak(double value)
Zoom to a peak determined by the value.
Definition: cSpectrumDetailWidget.cpp:1405
bool hasHidePeakLabelsEnabled()
Check if the hide peak labels mode is enabled.
Definition: cSpectrumDetailWidget.cpp:1477
void setHideMatchedPeaksEnabled(bool enable)
Set the state of hide matched peaks mode.
Definition: cSpectrumDetailWidget.cpp:1442
cSpectrumDetailWidget()
The constructor.
Definition: cSpectrumDetailWidget.cpp:25
void rawDataStateChangedSignal(bool state)
The signal is emitted when raw data state was changed.
void closeEvent(QCloseEvent *event)
Handle the window close event.
Definition: cSpectrumDetailWidget.cpp:686
~cSpectrumDetailWidget()
The destructor.
Definition: cSpectrumDetailWidget.cpp:574
void keyPressEvent(QKeyEvent *event)
Handle a key press event.
Definition: cSpectrumDetailWidget.cpp:1492
void emitMZInterval(double minmz, double maxmz)
The signal is emitted when the range of m/z ratios has been changed.
void disableProfileMode()
Permanently disable the visualization in profile mode.
Definition: cSpectrumDetailWidget.cpp:1427
void setAbsoluteIntensityEnabled(bool enable)
Set the state of absolute intensity mode.
Definition: cSpectrumDetailWidget.cpp:1432
void absoluteIntensityStateChangedSignal(bool state)
The signal is emitted when the absolute intensity state was changed.
void moveEvent(QMoveEvent *event)
Handle a move event.
Definition: cSpectrumDetailWidget.cpp:1529
bool hasHideMatchedPeaksEnabled()
Check if the hide matched peaks mode is enabled.
Definition: cSpectrumDetailWidget.cpp:1447
bool hasHideScrambledPeaksEnabled()
Check if the hide scrambled peaks mode is enabled.
Definition: cSpectrumDetailWidget.cpp:1467
void prepareToShow(QAction *actionShowIsomers, cPeakListSeries *rawdata, vector< cImzMLItem > *imzmlprofilemetadata, bool profilemz64precision, bool profileintensity64precision, bool usedefaultsize)
Prepare the widget to show.
Definition: cSpectrumDetailWidget.cpp:692
string getPartialPeaksTableAsHTMLString(int id, bool exportisomers)
Get a partial table of peaks as a HTML string.
Definition: cSpectrumDetailWidget.cpp:412
void setMouseMzSelectionEnabled(bool enable)
Set the state of mouse m/z selection tool.
Definition: cSpectrumDetailWidget.cpp:1482
void lastActiveDetail(int rowid)
The signal is emitted when the widget has been moved.
void setHidePeakLabelsEnabled(bool enable)
Set the state of hide peak labels mode.
Definition: cSpectrumDetailWidget.cpp:1472
set< string > & getLocalNeutralLosses()
Get a set of local neutral losses.
Definition: cSpectrumDetailWidget.cpp:1412
string getPeaksTableAsHTMLString(bool unmatchedtheoreticalpeaks, bool unmatchedexperimentalpeaks, bool exportisomers)
Get a table of peaks as a HTML string.
Definition: cSpectrumDetailWidget.cpp:177
void setHideUnmatchedPeaksEnabled(bool enable)
Set the state of hide unmatched peaks mode.
Definition: cSpectrumDetailWidget.cpp:1452
bool hasAbsoluteIntensityEnabled()
Check if the absolute intensity mode is enabled.
Definition: cSpectrumDetailWidget.cpp:1437
void setProfileSpectrumEnabled(bool enable)
Set the state of profile spectrum visualization.
Definition: cSpectrumDetailWidget.cpp:1417
cSpectrumDetailWidget & operator=(const cSpectrumDetailWidget &sd)
Overloaded operator=.
Definition: cSpectrumDetailWidget.cpp:49
cTheoreticalSpectrum & getTheoreticalSpectrum()
Get the theoretical spectrum.
Definition: cSpectrumDetailWidget.cpp:86
void exportImage(bool exportspectrum)
Export spectrum/peptide image.
Definition: cSpectrumDetailWidget.cpp:1395
void initialize(int rowid, string scantitle, int activefileid, cGlobalPreferences *globalpreferences, cParameters *parameters, cTheoreticalSpectrum &theoreticalspectrum, QWidget *parent)
Initialize the widget.
Definition: cSpectrumDetailWidget.cpp:75
string getDetailsAsHTMLString()
Get details about a theoretical spectrum as a HTML string.
Definition: cSpectrumDetailWidget.cpp:91
The widget representing a 2D mass spectrum.
Definition: cSpectrumSceneWidget.h:33
The class representing a theoretical mass spectrum.
Definition: cTheoreticalSpectrum.h:106
Position in QTableWidget.
Definition: cSpectrumDetailWidget.h:57
int column
A number of a column.
Definition: cSpectrumDetailWidget.h:67
int row
A number of a row.
Definition: cSpectrumDetailWidget.h:61