-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSTAGR.h
223 lines (150 loc) · 5.31 KB
/
STAGR.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
// Copyright 2012 Egor Dolzhenko
//
// This file is a part of STAGR.
//
// STAGR 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/>.
//STAGR.h contains the definition of STAGR's main window class
#ifndef STAGR_H
#define STAGR_H
#include <QMainWindow>
//MultipleMatchesDialog visualizes and shows info about HSPs
//between given contigs
#include "MultipleMatchesDialog.h"
//Dialog with blastn settings
#include "blastnSettingsDialog.h"
//Dialog with blat settings
#include "blatSettingsDialog.h"
#include "scriptEditDialog.h"
#include "pathSettingsDialog.h"
#include "hsp.h"
//Location of the header file for including Python interpreter into STAGR
#include <Python.h>
//Classes used in the definition of StagrMainWindow class
class QTabWidget;
class QHBoxLayout;
class QVBoxLayout;
class QLabel;
class QActionGroup;
//Defines STAGR's main window
class StagrMainWindow : public QMainWindow
{
//Enables use of signals and slots
Q_OBJECT
//Either blast or blat local-alignment heuristics can be used
//to find HSPs
enum InitialAligner {BLASTN, BLAT};
public:
//Constructor
StagrMainWindow(QWidget *parent = 0);
private slots:
//Opens multiple matches dialog
void openMDialogMultipleMatches();
//Opens blastn settings dialog
void openBlastnSettingsDialog();
//Opens blat settings dialog
void openBlatSettingsDialog();
//Opens path settings dialog
void openPathSettingsDialog();
//get precursor filename from user through a file dialog
void getPrecursorFilename();
//get product filename from user through a file dialog
void getProductFilename();
void openScriptEditor();
//Chooses blast aligner
void selectBlastn();
//Chooses blat aligner
void selectBlat();
//Runs main algorithm
bool runStagr();
//Opens settings dialog
void openSettingsDialog();
private:
void createToolBar();
//Run blastn and populate alignments and numAlignments
QString runBlastn(QString queryFilename, QString referenceFilename);
//Runs blat
QString runBlat(QString queryFilename, QString referenceFilename);
void getAlignmentsSummary();
void createTable();
void createMenus();
bool runFilteringAlgorithm(QString input, QString algorithmFilename);
void alert(QString text);
PyObject *runPythonFunction(QString filename, QString functionname, PyObject *argument);
//main tab widget containing table
QTabWidget *mainTabWidget;
//Layout with labels listing query contigs file
QHBoxLayout *querySequenceInformationLayout;
//Layout with labels listing reference contigs file
QHBoxLayout *referenceSequenceInformationLayout;
//Main layout containing all widgets and layouts in main window
QVBoxLayout *mainLayout;
//Label that says: File with query contigs
QLabel *querySequenceLabel;
//Label that says: File with reference contigs
QLabel *referenceSequenceLabel;
//Name of the file with query contigs or <none specified>
QLabel *querySequenceFilenameLabel;
//name of the file with reference contigs or <none specified>
QLabel *referenceSequenceFilenameLabel;
//Table with names of pairs of contigs and the number of matches between them
Table *table;
//Toolbar containing essential commands and dialogs
QToolBar *toolBar;
//start STAGR algorithm
QAction *startAction;
//Open blastn settings dialog
QAction *settingsAction;
QAction *getPrecursorFilenameAction;
QAction *getProductFilenameAction;
//Open STAGR settings dialog
QAction *stagrSettingsAction;
QAction *runBlastnAction;
QAction *runBlatAction;
QAction *selectBlastnAction;
QAction *selectBlatAction;
QAction *filteringAction;
QActionGroup *alignmentGroup;
QAction *startEditorAction;
QAction *openPathSettingsAction;
//Dialog containing summary information about matches corresponding to
//a particular query contig and multiple reference contigs
MultipleMatchesDialog *multipleMatchesDialog;
//Dialog containing blastn settings
BlastnSettingsDialog* blastnSettingsDialog;
//Dialog containing blat settings
BlatSettingsDialog* blatSettingsDialog;
ScriptEditDialog* scriptEditDialog;
PathSettingsDialog* pathSettingsDialog;
//Contains information about alignments found by blast
QStringList* alignments;
//Number of elements in the alignments array
unsigned numAlignments;
//Summary about alignments between pairs of contigs
QVector<QStringList> *hspsStats;
//name of the query file
QString precursorFilename;
//name of the reference file
QString productFilename;
//arguments for blastn local-alignment heuristic
QStringList blastnArguments;
//arguments for blat local-alignment heuristic
QStringList blatArguments;
QMenu *fileMenu;
QMenu *alignmentMenu;
QMenu *setPathsMenu;
InitialAligner currentAligner;
QString pullOutFastaSequence(QString filename, QString id);
HSPs *hsps;
};
#endif //STAGR_H