CycloBranch
cSummaryPeaksTableWidget.h
Go to the documentation of this file.
1
7#ifndef _CSUMMARYPEAKSTABLEWIDGET_H
8#define _CSUMMARYPEAKSTABLEWIDGET_H
9
10#include <map>
11#include <QWidget>
12#include <QDesktopServices>
13#include <QUrl>
14#include <QFileInfo>
15#include <QMainWindow>
16#include <QToolBar>
17#include <QAction>
18#include <QTableView>
19#include <QStandardItemModel>
20#include <QStandardItem>
21#include <QItemDelegate>
22#include <QMessageBox>
23#include <QComboBox>
24#include <QStringListModel>
25#include <QCompleter>
26
27#include "core/utilities.h"
32#include "gui/cHTMLDelegate.h"
34#include "gui/cEventFilter.h"
35
36
37// forward declaration
38class cParameters;
41class QHBoxLayout;
42class QVBoxLayout;
43class QPushButton;
44class QCheckBox;
45class QLineEdit;
46class QMenuBar;
47class QMenu;
48
49
54
58 string id;
59
60
64 string iontype;
65
66
71
72
77
78
82 string name;
83
84
88 string reference;
89
90
94 string score;
95
96
100 string fdr;
101
102
106 void clear() {
107 id.clear();
108 iontype.clear();
109 theoreticalmz.clear();
110 summaryformula.clear();
111 name.clear();
112 reference.clear();
113 score.clear();
114 fdr.clear();
115 }
116
117};
118
119
124
129
130
134 string thint;
135
136
141
142
146 string relint;
147
148
152 string absint;
153
154
158 string ppmerror;
159
160
164 string summary;
165
166
170 void clear() {
171 theoreticalmz.clear();
172 thint.clear();
173 experimentalmz.clear();
174 relint.clear();
175 absint.clear();
176 ppmerror.clear();
177 summary.clear();
178 }
179
180};
181
182
187
194 bool operator()(const cSummaryTableKeyMS& left, const cSummaryTableKeyMS& right) const {
195 return (left.iontype + left.theoreticalmz + left.summaryformula + left.name + left.reference < right.iontype + right.theoreticalmz + right.summaryformula + right.name + right.reference);
196 }
197
198};
199
200
205
212 bool operator()(const cSummaryTableKeyMS& left, const cSummaryTableKeyMS& right) const {
213 return (left.id + left.iontype + left.name + left.reference < right.id + right.iontype + right.name + right.reference);
214 }
215
216};
217
218
223
230 bool operator()(const cSummaryTableKeyMSMS& left, const cSummaryTableKeyMSMS& right) const {
231 return (left.theoreticalmz + left.thint + left.experimentalmz + left.relint + left.absint + left.ppmerror + left.summary < right.theoreticalmz + right.thint + right.experimentalmz + right.relint + right.absint + right.ppmerror + right.summary);
232 }
233
234};
235
236
244void addEICPeak(cParameters* parameters, cPeaksList& eicchromatogram, cTheoreticalSpectrum& theoreticalspectrum, cPeaksList& experimentalspectrum);
245
246
250class cSummaryPeaksTableWidget : public QMainWindow
251{
252 Q_OBJECT
253
254public:
255
256
262 cSummaryPeaksTableWidget(cGlobalPreferences* globalpreferences, QWidget* parent = (QWidget *)0);
263
264
269
270
275 void closeEvent(QCloseEvent *event);
276
277
288 bool prepareToShow(QStandardItemModel* resultsstandardmodel, cMainWindowProxyModel* resultsproxymodel, cParameters* parameters, cTheoreticalSpectrumList* listoftheoreticalspectra, int activefileid, bool showisomers);
289
290
294 void deleteTable();
295
296
304 void updateFilterBySelectedRegion(int xmin, int xmax, int ymin, int ymax);
305
306
311 void applyGlobalPreferences(cGlobalPreferences* globalpreferences);
312
313
319
320
324 void filterTablerows();
325
326
334 void filterCompound(string name, string iontype, int datatypeview, string mzstr);
335
336
337private:
338
339 QString title;
340
341 cGlobalPreferences* globalpreferences;
342
343 cParameters* parameters;
344 QWidget* parent;
345
346 cPubChemSearchWidget* pubchemsearchwidget;
347
348 QMenuBar* menuBar;
349 QMenu* menuFile;
350 //QMenu* menuSearch;
351 QMenu* menuHelp;
352
353 QToolBar* toolbarFile;
354 QAction* actionExportCSV;
355 QAction* actionExportDatabase;
356 QAction* actionExportStatistics;
357 QAction* actionCloseWindow;
358
359 //QToolBar* toolbarSearch;
360 //QAction* actionSearchPubChem;
361
362 QToolBar* toolbarHelp;
363 QAction* actionHTMLDocumentation;
364
365 QToolBar* toolbarFilter;
366 QWidget* rowsfilterwidget;
367 QHBoxLayout* rowsfilterhbox;
368
369 QComboBox* rowsfilteroperator;
370
371 QComboBox* rowsfiltercombobox1;
372 QComboBox* rowsfiltercomparatorcombobox1;
373 QStringListModel* rowsfilterstringlistmodel1;
374 QCompleter* rowsfilterlinecompleter1;
375 QLineEdit* rowsfilterline1;
376 QPushButton* rowsfilterleft1;
377 QPushButton* rowsfilterright1;
378
379 QComboBox* rowsfiltercombobox2;
380 QComboBox* rowsfiltercomparatorcombobox2;
381 QStringListModel* rowsfilterstringlistmodel2;
382 QCompleter* rowsfilterlinecompleter2;
383 QLineEdit* rowsfilterline2;
384 QPushButton* rowsfilterleft2;
385 QPushButton* rowsfilterright2;
386
387 QCheckBox* rowsfiltercasesensitive;
388 QCheckBox* rowsfilterwholeword;
389 QPushButton* rowsfilterbutton;
390 QPushButton* rowsfilterclearbutton;
391
392 QTableView* database;
393 QStandardItemModel* databasemodel;
395 QVBoxLayout* mainlayout;
396 QWidget* mainwidget;
397
398 QString lastdirexporttocsv;
399 QString lastdirexportdatabase;
400 QString lastdirexportstatisticstocsv;
401
402 vector<double> rtimes;
403
404 vector<cCoordinateInfo> origcoordinateinfo;
405 cPeaksList origeicchromatogram;
406
407 int activefileid;
408
409 void addCoordinateInfo(int spectrumindex, vector<cCoordinateInfo>& coordinateinfo, cTheoreticalSpectrum& theoreticalspectrum, cPeaksList& experimentalspectrum);
410
411
412protected:
413
414
419 void keyPressEvent(QKeyEvent *event);
420
421
422private slots:
423
424 void closeWindow();
425
426
427 void filterRows();
428
429
430 void resetFilter();
431
432
433 void exportToCsv();
434
435
436 void exportToDatabase();
437
438
439 void exportStatistics();
440
441
442 void showHTMLDocumentation();
443
444
445 void rowDoubleClicked(const QModelIndex& item);
446
447
448 void rowsFilterLeft1Slot();
449
450
451 void rowsFilterRight1Slot();
452
453
454 void rowsFilterLeft2Slot();
455
456
457 void rowsFilterRight2Slot();
458
459
460 void searchPubChem();
461
462
463signals:
464
465
470
471
477 void summaryPeaksTableRowDoubleClicked(int rowid, double experimentalmz);
478
479
484
485
499 void sendFilterOptionsToImageWindow(vector<cCoordinateInfo> coordinateinfo, bool operatortype, string columnname1, string comparatorname1, string filterstring1, string columnname2, string comparatorname2, string filterstring2, bool casesensitive, bool wholeword);
500
501
507
508
509};
510
511#endif
512
An event filter.
The representation of a set of peptide sequence candidates.
A delegate to display rich text.
A table proxy model.
The implementation of the dialog PubChem search widget.
A table proxy model.
void addEICPeak(cParameters *parameters, cPeaksList &eicchromatogram, cTheoreticalSpectrum &theoreticalspectrum, cPeaksList &experimentalspectrum)
Add a peak to an extracted ion chromatogram.
Definition: cSummaryPeaksTableWidget.cpp:23
A delegate to create a reference view button.
The class storing global preferences.
Definition: cGlobalPreferences.h:104
A table proxy model.
Definition: cMainWindowProxyModel.h:21
The class storing parameters of the application.
Definition: cParameters.h:82
The class representing a peak list.
Definition: cPeaksList.h:68
The widget representing the PubChem search widget.
Definition: cPubChemSearchWidget.h:33
A table proxy model.
Definition: cSummaryPeaksTableProxyModel.h:21
Summary table of matched peaks.
Definition: cSummaryPeaksTableWidget.h:251
void filterCompound(string name, string iontype, int datatypeview, string mzstr)
Filter a specific compound.
Definition: cSummaryPeaksTableWidget.cpp:989
cSummaryPeaksTableWidget(cGlobalPreferences *globalpreferences, QWidget *parent=(QWidget *) 0)
The constructor.
Definition: cSummaryPeaksTableWidget.cpp:83
void updateFilterBySelectedRegion(int xmin, int xmax, int ymin, int ymax)
Update the filter using an image region.
Definition: cSummaryPeaksTableWidget.cpp:958
void sendFilterOptionsToImageWindow(vector< cCoordinateInfo > coordinateinfo, bool operatortype, string columnname1, string comparatorname1, string filterstring1, string columnname2, string comparatorname2, string filterstring2, bool casesensitive, bool wholeword)
Send the vector of aggregated informations about coordinates to image window.
void applyGlobalPreferences(cGlobalPreferences *globalpreferences)
Apply new global preferences.
Definition: cSummaryPeaksTableWidget.cpp:964
void closeEvent(QCloseEvent *event)
Handle the window close event.
Definition: cSummaryPeaksTableWidget.cpp:362
void deleteTable()
Delete the table content.
Definition: cSummaryPeaksTableWidget.cpp:948
~cSummaryPeaksTableWidget()
The destructor.
Definition: cSummaryPeaksTableWidget.cpp:314
void resetRegion()
Reset the region in image window.
bool prepareToShow(QStandardItemModel *resultsstandardmodel, cMainWindowProxyModel *resultsproxymodel, cParameters *parameters, cTheoreticalSpectrumList *listoftheoreticalspectra, int activefileid, bool showisomers)
Prepare the widget to show.
Definition: cSummaryPeaksTableWidget.cpp:368
void tableCancelled()
The table was not generated because the process was cancelled.
void filterTablerows()
Filter table rows.
Definition: cSummaryPeaksTableWidget.cpp:984
void sendFilterOptionsToChromatogram(cPeaksList eic)
Send the EIC chromatogram to chromatogram window.
void summaryPeaksTableRowDoubleClicked(int rowid, double experimentalmz)
A row was double clicked.
void keyPressEvent(QKeyEvent *event)
Handle a key press event.
Definition: cSummaryPeaksTableWidget.cpp:1106
cPubChemSearchWidget * getPubChemSearchWidget()
Get the reference to cPubChemSearchWidget.
Definition: cSummaryPeaksTableWidget.cpp:979
The class representing a theoretical mass spectrum.
Definition: cTheoreticalSpectrum.h:106
The class representing lists of theoretical spectra.
Definition: cTheoreticalSpectrumList.h:25
Comparison object for cSummaryTableKeyMS (whole envelope).
Definition: cSummaryPeaksTableWidget.h:204
bool operator()(const cSummaryTableKeyMS &left, const cSummaryTableKeyMS &right) const
Operator to define the order of two items.
Definition: cSummaryPeaksTableWidget.h:212
Comparison object for cSummaryTableKeyMS (independent ions).
Definition: cSummaryPeaksTableWidget.h:186
bool operator()(const cSummaryTableKeyMS &left, const cSummaryTableKeyMS &right) const
Operator to define the order of two items.
Definition: cSummaryPeaksTableWidget.h:194
Key to reduce the summary table when exporting statistics for MS and MSI data.
Definition: cSummaryPeaksTableWidget.h:53
string summaryformula
Summary formula subkey.
Definition: cSummaryPeaksTableWidget.h:76
string reference
Reference subkey.
Definition: cSummaryPeaksTableWidget.h:88
void clear()
Clear the structure.
Definition: cSummaryPeaksTableWidget.h:106
string theoreticalmz
Theoretical m/z subkey.
Definition: cSummaryPeaksTableWidget.h:70
string name
Compound name subkey.
Definition: cSummaryPeaksTableWidget.h:82
string iontype
Ion type subkey.
Definition: cSummaryPeaksTableWidget.h:64
string id
Identification ID subkey.
Definition: cSummaryPeaksTableWidget.h:58
string score
Score subkey.
Definition: cSummaryPeaksTableWidget.h:94
string fdr
FDR subkey.
Definition: cSummaryPeaksTableWidget.h:100
Comparison object for cSummaryTableKeyMSMS.
Definition: cSummaryPeaksTableWidget.h:222
bool operator()(const cSummaryTableKeyMSMS &left, const cSummaryTableKeyMSMS &right) const
Operator to define the order of two items.
Definition: cSummaryPeaksTableWidget.h:230
Key to reduce the summary table when exporting statistics for MS/MS data.
Definition: cSummaryPeaksTableWidget.h:123
void clear()
Clear the structure.
Definition: cSummaryPeaksTableWidget.h:170
string relint
Relative intensity subkey.
Definition: cSummaryPeaksTableWidget.h:146
string absint
Absolute intensity subkey.
Definition: cSummaryPeaksTableWidget.h:152
string theoreticalmz
Theoretical m/z subkey.
Definition: cSummaryPeaksTableWidget.h:128
string summary
summary formula subkey.
Definition: cSummaryPeaksTableWidget.h:164
string ppmerror
ppm error subkey.
Definition: cSummaryPeaksTableWidget.h:158
string experimentalmz
Experimental m/z subkey.
Definition: cSummaryPeaksTableWidget.h:140
string thint
Theoretical intensity subkey.
Definition: cSummaryPeaksTableWidget.h:134
Auxiliary funtions and structures.