1 #ifndef _MUSSAWINDOW_H_
2 #define _MUSSAWINDOW_H_
5 #include <boost/shared_ptr.hpp>
11 #include <QProgressDialog>
16 #include "qui/MussaAlignedWindow.hpp"
17 #include "qui/motif_editor/MotifEditor.hpp"
18 #include "qui/mussa_setup_dialog/MussaSetupDialog.hpp"
19 #include "qui/seqbrowser/SequenceBrowserWidget.hpp"
20 #include "qui/subanalysis/SubanalysisWindow.hpp"
21 #include "qui/ThresholdWidget.hpp"
22 #include "qui/ZoomWidget.hpp"
29 class QAssistantClient;
32 typedef boost::shared_ptr<MussaWindow> MussaWindowRef;
34 class MussaWindow : public QMainWindow
39 MussaWindow(MussaRef analysis, QWidget *parent=0);
42 //! reset any attached window
45 //! switch to a new analysis
46 void setAnalysis(MussaRef new_analysis);
48 //! ask the user what to do if we're going to lose data
49 //! returns true if getting rid of this analysis is safe
50 bool isClearingAnalysisSafe();
53 //! display an about box, contemplating the politics of the author list
56 //! \defgroup AnalysisFunctions Components related to running analyses
58 //! open a window to collect the information needed to create a new analysis
59 void createNewAnalysis();
60 //! launch a sub analysis
61 void createSubAnalysis();
64 //! save an analysis after prompting for new name
65 void saveAnalysisAs();
66 //! set the window modified flag
67 void updateAnalysisModified(bool);
68 //! try to conver the mussa analysis_path to a title
72 //! \defgroup MotifHandling Handling of motif lists
81 //! load a mussa parameter file (which specifies an analysis to run)
83 //! load a previously run analysis
84 void loadSavedAnalysis();
85 //! set the soft threshold used by the Nway_Path algorithm
86 void setSoftThreshold(int thres);
87 //! update progress bar
88 void updateProgress(const QString& description, int cur, int max);
90 //! open a new mussa window so one can compare analyses
91 void newMussaWindow();
93 void showMussaToolbar();
94 //! display how many base pairs were copied on the status bar
95 void showBasePairsCopied(size_t);
98 //! open new window showing our alignment
99 void viewMussaAlignment();
101 //! display mussagl manual
104 void assistantError(const QString message);
107 void changedAnnotations();
108 void changedMotifs();
111 //! shared_ptr to our analysis
113 //! the default directory we should loand and save from
114 boost::shared_ptr<QDir> default_dir;
115 std::list<MussaAlignedWindowRef> aligned_windows;
116 MotifEditor *motif_editor;
117 MussaSetupDialog *setup_analysis_dialog;
118 SubanalysisWindowRef subanalysis_window;
120 // display our wonderful mussa output
121 SequenceBrowserWidget *browser;
122 QToolBar *mussaViewTB;
124 ThresholdWidget *threshold;
125 QProgressDialog *progress_dialog;
127 QAction *aboutAction;
128 QAction *closeAction;
129 QAction *createNewAnalysisAction;
130 QAction *createSubAnalysisAction;
131 QAction *saveAnalysisAction;
132 QAction *saveAnalysisAsAction;
133 QAction *editMotifsAction;
134 QAction *loadMotifListAction;
135 QAction *loadMupaAction;
136 QAction *loadSavedAnalysisAction;
137 QAction *mussaManualAssistantAction;
138 QAction *newMussaWindowAction;
139 QAction *saveMotifListAction;
140 QAction *showMussaViewToolbarAction;
141 QAction *toggleMotifsAction;
142 QAction *saveBrowserPixmapAction;
143 QAction *whatsThisAction;
144 QAction *viewMussaAlignmentAction;
146 //QAssistantClient *manualAssistant;
147 QProcess *assistantProcess;
149 //! initialze the actions
151 //! handle close events (AKA prompt if we should save)
152 void closeEvent(QCloseEvent *event);
153 //! initialize this windows menu object
154 void setupMainMenu();
155 //! initialize all of our widgets
157 //! initialize assistant client
158 void setupAssistant();
159 //! stub function to fill in QActions
160 void NotImplementedBox();
163 //! update the SequenceBrowser with our analysis
164 void updateAnalysis();
165 //! update the view of conserved windows
167 //! update annotations?
168 void updateAnnotations();