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