1 #ifndef _MUSSAWINDOW_H_
2 #define _MUSSAWINDOW_H_
5 #include <boost/shared_ptr.hpp>
10 #include <QProgressDialog>
14 #include "qui/MussaAlignedWindow.hpp"
15 #include "qui/motif_editor/MotifEditor.hpp"
16 #include "qui/mussa_setup_dialog/MussaSetupDialog.hpp"
17 #include "qui/seqbrowser/SequenceBrowserWidget.hpp"
18 #include "qui/SubanalysisWindow.hpp"
19 #include "qui/ThresholdWidget.hpp"
20 #include "qui/ZoomWidget.hpp"
27 class QAssistantClient;
29 class MussaWindow : public QMainWindow
34 MussaWindow(MussaRef analysis, QWidget *parent=0);
36 //! reset any attached window
39 //! switch to a new analysis
40 void setAnalysis(MussaRef new_analysis);
42 //! ask the user what to do if we're going to lose data
43 //! returns true if getting rid of this analysis is safe
44 bool isClearingAnalysisSafe();
47 //! display an about box, contemplating the politics of the author list
50 //! \defgroup AnalysisFunctions Components related to running analyses
52 //! open a window to collect the information needed to create a new analysis
53 void createNewAnalysis();
54 //! launch a sub analysis
55 void createSubAnalysis();
58 //! save an analysis after prompting for new name
59 void saveAnalysisAs();
60 //! set the window modified flag
61 void updateAnalysisModified(bool);
62 //! try to conver the mussa analysis_path to a title
66 //! \defgroup MotifHandling Handling of motif lists
75 //! load a mussa parameter file (which specifies an analysis to run)
77 //! load a previously run analysis
78 void loadSavedAnalysis();
79 //! set the soft threshold used by the Nway_Path algorithm
80 void setSoftThreshold(int thres);
81 //! update progress bar
82 void updateProgress(const std::string& description, int cur, int max);
84 //! open a new mussa window so one can compare analyses
85 void newMussaWindow();
87 void showMussaToolbar();
88 //! display how many base pairs were copied on the status bar
89 void showBasePairsCopied(size_t);
92 //! open new window showing our alignment
93 void viewMussaAlignment();
95 //! display mussagl manual
98 void assistantError(const QString message);
101 void changedAnnotations();
102 void changedMotifs();
105 //! shared_ptr to our analysis
107 //! the default directory we should loand and save from
108 boost::shared_ptr<QDir> default_dir;
109 std::list<boost::shared_ptr<MussaAlignedWindow> > aligned_windows;
110 MotifEditor *motif_editor;
111 MussaSetupDialog *setup_analysis_dialog;
112 SubanalysisWindowRef subanalysis_window;
114 // display our wonderful mussa output
115 SequenceBrowserWidget *browser;
116 QToolBar *mussaViewTB;
118 ThresholdWidget *threshold;
119 QProgressDialog *progress_dialog;
121 QAction *aboutAction;
122 QAction *closeAction;
123 QAction *createNewAnalysisAction;
124 QAction *createSubAnalysisAction;
125 QAction *saveAnalysisAction;
126 QAction *saveAnalysisAsAction;
127 QAction *editMotifsAction;
128 QAction *loadMotifListAction;
129 QAction *loadMupaAction;
130 QAction *loadSavedAnalysisAction;
131 QAction *mussaManualAssistantAction;
132 QAction *newMussaWindowAction;
133 QAction *saveMotifListAction;
134 QAction *showMussaViewToolbarAction;
135 QAction *toggleMotifsAction;
136 QAction *saveBrowserPixmapAction;
137 QAction *whatsThisAction;
138 QAction *viewMussaAlignmentAction;
140 QAssistantClient *manualAssistant;
142 //! initialze the actions
144 //! handle close events (AKA prompt if we should save)
145 void closeEvent(QCloseEvent *event);
146 //! initialize this windows menu object
147 void setupMainMenu();
148 //! initialize assistant client
149 void setupAssistant();
150 //! stub function to fill in QActions
151 void NotImplementedBox();
154 //! update the SequenceBrowser with our analysis
155 void updateAnalysis();
156 //! update the view of conserved windows
158 //! update annotations?
159 void updateAnnotations();