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;
30 class MussaWindow : public QMainWindow
35 MussaWindow(MussaRef analysis, QWidget *parent=0);
37 //! reset any attached window
40 //! switch to a new analysis
41 void setAnalysis(MussaRef new_analysis);
43 //! ask the user what to do if we're going to lose data
44 //! returns true if getting rid of this analysis is safe
45 bool isClearingAnalysisSafe();
48 //! display an about box, contemplating the politics of the author list
51 //! \defgroup AnalysisFunctions Components related to running analyses
53 //! open a window to collect the information needed to create a new analysis
54 void createNewAnalysis();
55 //! launch a sub analysis
56 void createSubAnalysis();
59 //! save an analysis after prompting for new name
60 void saveAnalysisAs();
61 //! set the window modified flag
62 void updateAnalysisModified(bool);
63 //! try to conver the mussa analysis_path to a title
67 //! \defgroup MotifHandling Handling of motif lists
76 //! load a mussa parameter file (which specifies an analysis to run)
78 //! load a previously run analysis
79 void loadSavedAnalysis();
80 //! set the soft threshold used by the Nway_Path algorithm
81 void setSoftThreshold(int thres);
82 //! update progress bar
83 void updateProgress(const std::string& description, int cur, int max);
85 //! open a new mussa window so one can compare analyses
86 void newMussaWindow();
88 void showMussaToolbar();
89 //! display how many base pairs were copied on the status bar
90 void showBasePairsCopied(size_t);
93 //! open new window showing our alignment
94 void viewMussaAlignment();
96 //! display mussagl manual
99 void assistantError(const QString message);
102 void changedAnnotations();
103 void changedMotifs();
106 //! shared_ptr to our analysis
108 //! the default directory we should loand and save from
109 boost::shared_ptr<QDir> default_dir;
110 std::list<boost::shared_ptr<MussaAlignedWindow> > aligned_windows;
111 MotifEditor *motif_editor;
112 MussaSetupDialog *setup_analysis_dialog;
113 SubanalysisWindowRef subanalysis_window;
115 // display our wonderful mussa output
116 SequenceBrowserWidget *browser;
117 QToolBar *mussaViewTB;
119 ThresholdWidget *threshold;
120 QProgressDialog *progress_dialog;
122 QAction *aboutAction;
123 QAction *closeAction;
124 QAction *createNewAnalysisAction;
125 QAction *createSubAnalysisAction;
126 QAction *saveAnalysisAction;
127 QAction *saveAnalysisAsAction;
128 QAction *editMotifsAction;
129 QAction *loadMotifListAction;
130 QAction *loadMupaAction;
131 QAction *loadSavedAnalysisAction;
132 QAction *mussaManualAssistantAction;
133 QAction *newMussaWindowAction;
134 QAction *saveMotifListAction;
135 QAction *showMussaViewToolbarAction;
136 QAction *toggleMotifsAction;
137 QAction *saveBrowserPixmapAction;
138 QAction *whatsThisAction;
139 QAction *viewMussaAlignmentAction;
141 QAssistantClient *manualAssistant;
143 //! initialze the actions
145 //! handle close events (AKA prompt if we should save)
146 void closeEvent(QCloseEvent *event);
147 //! initialize this windows menu object
148 void setupMainMenu();
149 //! initialize assistant client
150 void setupAssistant();
151 //! stub function to fill in QActions
152 void NotImplementedBox();
155 //! update the SequenceBrowser with our analysis
156 void updateAnalysis();
157 //! update the view of conserved windows
159 //! update annotations?
160 void updateAnnotations();