#include <set>
+#include <boost/shared_ptr.hpp>
+
+#include <QDir>
#include <QMainWindow>
#include <QMenu>
+#include <QToolBar>
#include "alg/mussa.hpp"
#include "qui/IntAction.hpp"
+#include "qui/ZoomWidget.hpp"
+#include "qui/ThresholdWidget.hpp"
#include "qui/seqbrowser/SequenceBrowserWidget.hpp"
+#include "qui/subanalysis/SubanalysisWindow.hpp"
//! Show sequence alignments
class MussaAlignedWindow : public QMainWindow
public:
//! construct an aligned window for an analysis and selected paths
- MussaAlignedWindow(Mussa&, const std::set<int>&, QWidget *parent=0);
+ /*! \param analysis is a shared_ptr to a mussa analysis
+ * \param paths is a set of "paths" AKA integer offsets into the sequences stored in mussa
+ * \param window points to a SubanalysisWindowRef, so we can pick interesting
+ * sequence portions from both the mussa window and the sequence view window
+ * \param parent is the typical Qt pointer to a parent widget
+ */
+ MussaAlignedWindow(MussaRef analysis,
+ boost::shared_ptr<QDir> default_dir,
+ const std::set<int>& paths,
+ SubanalysisWindowRef window, QWidget *parent=0);
public slots:
+ //! launch a sub analysis
+ void createSubAnalysis();
//! use selected_paths[pathid] to set the starting position of our sequence
void setAlignment(int pathid);
//! toggle whether or not to show the aligned basepairs of a window
- void toggleViewAlignment(size_t alignment_index);
+ void toggleViewAlignment(int alignment_index);
//! just force updating the window
void update();
+
+ //! set the title based on the analysis
+ void updateTitle();
+ //! display how many base pairs were copied on the status bar
+ void showBasePairsCopied(size_t);
protected:
- void setSelectedPaths(Mussa &m, const std::set<int>& sel_paths);
- //! set menus (must be called after setSelectedPaths)
+ // figure out what Alignments we have (needed for setupAlignmentMenus)
+ void setSelectedPaths(MussaRef m, const std::set<int>& sel_paths);
+ // create our cations
+ void setupActions();
+ // create our menus
void setupMenus();
+ //! set menus (must be called after setSelectedPaths)
+ void setupAlignmentMenus();
void computeMatchLines();
- Mussa& analysis;
+ MussaRef analysis;
+ boost::shared_ptr<QDir> default_dir;
//std::vector<Sequence> sequences;
//const std::set<int>& selected_paths;
- std::vector<ExtendedConservedPath> selected_paths;
+ std::vector<ConservedPath> selected_paths;
std::vector<bool> view_paths;
+ SubanalysisWindowRef subanalysis_window;
SequenceBrowserWidget browser;
QMenu pick_align_menu;
QMenu view_align_menu;
+
+ QAction *createSubAnalysisAction;
+ QAction *saveBrowserPixmapAction;
+
std::vector <IntAction *> pick_actions;
std::vector <IntAction *> view_actions;
+ ZoomWidget *zoom;
+ ThresholdWidget *threshold_widget;
+ QToolBar *alignTB;
};
+
+//! reference to a MussaAlignedWindow
+typedef boost::shared_ptr<MussaAlignedWindow> MussaAlignedWindowRef;
#endif