NCBI C++ ToolKit
update_multi_seq_dlg.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: update_multi_seq_dlg.hpp 42167 2019-01-08 17:17:20Z filippov $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Andrea Asztalos
27  */
28 #ifndef _UPDATE_MULTI_SEQ_DLG_H_
29 #define _UPDATE_MULTI_SEQ_DLG_H_
30 
31 #include <corelib/ncbistd.hpp>
34 #include <gui/utils/job_future.hpp>
35 
38 
39 class wxListBox;
40 class wxButton;
41 class wxNotebook;
42 
44 
45 class CUpdateSeqPanel;
47 class CCmdComposite;
48 
49 /*!
50  * Control identifiers
51  */
52 
53 ////@begin control identifiers
54 #define SYMBOL_CUPDATEMULTISEQ_DLG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
55 #define SYMBOL_CUPDATEMULTISEQ_DLG_TITLE _("Multiple Sequence Update")
56 #define SYMBOL_CUPDATEMULTISEQ_DLG_IDNAME ID_CUPDATEMULTISEQ_DLG
57 #define SYMBOL_CUPDATEMULTISEQ_DLG_SIZE wxSize(400, 300)
58 #define SYMBOL_CUPDATEMULTISEQ_DLG_POSITION wxDefaultPosition
59 ////@end control identifiers
60 
61 
62 /*!
63  * CUpdateMultiSeq_Dlg class declaration
64  */
65 
67 {
68  DECLARE_DYNAMIC_CLASS( CUpdateMultiSeq_Dlg )
69  DECLARE_EVENT_TABLE()
70 
71 public:
72  /// Constructors
74  CUpdateMultiSeq_Dlg( wxWindow* parent,
75  CUpdateMultipleSeq_Input& updmultiseq_in,
77  wxWindowID id = SYMBOL_CUPDATEMULTISEQ_DLG_IDNAME,
78  const wxString& caption = SYMBOL_CUPDATEMULTISEQ_DLG_TITLE,
79  const wxPoint& pos = SYMBOL_CUPDATEMULTISEQ_DLG_POSITION,
80  const wxSize& size = SYMBOL_CUPDATEMULTISEQ_DLG_SIZE,
81  long style = SYMBOL_CUPDATEMULTISEQ_DLG_STYLE );
82 
83  /// Creation
84  bool Create( wxWindow* parent,
85  wxWindowID id = SYMBOL_CUPDATEMULTISEQ_DLG_IDNAME,
86  const wxString& caption = SYMBOL_CUPDATEMULTISEQ_DLG_TITLE,
87  const wxPoint& pos = SYMBOL_CUPDATEMULTISEQ_DLG_POSITION,
88  const wxSize& size = SYMBOL_CUPDATEMULTISEQ_DLG_SIZE,
89  long style = SYMBOL_CUPDATEMULTISEQ_DLG_STYLE );
90 
91  /// Destructor
93 
94  /// Initialises member variables
95  void Init();
96 
97  /// Creates the controls and sizers
98  void CreateControls();
99 
100 ////@begin CUpdateMultiSeq_Dlg event handler declarations
101 
102  /// wxEVT_CLOSE_WINDOW event handler for ID_CUPDATEMULTISEQ_DLG
103  void OnCloseWindow( wxCloseEvent& event );
104 
105  /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_UPDMULTSEQ_PNL1_LISTBOX1
106  void OnNonIdentSeqSelected( wxCommandEvent& event );
107 
108  /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_UPDMULTSEQ_PNL1_LISTBOX2
109  void OnIdentSeqSelected( wxCommandEvent& event );
110 
111  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_UPDMULTSEQ_PNL1_BTN
112  void OnRemoveIdenticalsClick( wxCommandEvent& event );
113 
114  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_UPDMULTSEQ_PNL2_BTN1
115  void OnLoadMapClick( wxCommandEvent& event );
116 
117  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_UPDMULTSEQ_PNL2_BTN2
118  void OnMapSelectionClick( wxCommandEvent& event );
119 
120  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_UPDMULTSEQ_OKTHIS
121  void OnUpdateThisSequenceClick( wxCommandEvent& event );
122 
123  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_UPDMULTSEQ_SKIP
124  void OnSkipThisSequenceClick( wxCommandEvent& event );
125 
126  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_UPDMULTSEQ_OKALL
127  void OnUpdateAllSequenceClick( wxCommandEvent& event );
128 
129  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_UPDMULTSEQ_STOP
130  void OnStopUpdatingClick( wxCommandEvent& event );
131 
132  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
133  void OnCancelClick( wxCommandEvent& event );
134 
135  void OnRemoveIdenticalUpdate(wxUpdateUIEvent& event);
136 
137  void OnMapSelectionUpdate(wxUpdateUIEvent& event);
138 
139 ////@end CUpdateMultiSeq_Dlg event handler declarations
140 
141  void OnIdle(wxIdleEvent& event);
142 
143 ////@begin CUpdateMultiSeq_Dlg member function declarations
144 
146 
147  void ReportStats() const;
148 
149  /// Retrieves bitmap resources
150  wxBitmap GetBitmapResource( const wxString& name );
151 
152  /// Retrieves icon resources
153  wxIcon GetIconResource( const wxString& name );
154 ////@end CUpdateMultiSeq_Dlg member function declarations
155 
156  virtual void x_LoadSettings(const CRegistryReadView& view);
157  virtual void x_SaveSettings(CRegistryWriteView view) const;
158 
159  /// Should we show tooltips?
160  static bool ShowToolTips();
161 
162  static string s_GetSeqIDLabel(const objects::CSeq_id_Handle& idh);
163 
164  const string& GetRevCompReport() const { return m_RevCompReport; }
165  bool AnyUpdated() const { return (m_Updated > 0); }
166 
167 private:
172 
173  void x_FillNonIdenticalList();
174  void x_FillIdenticalList();
175  void x_FillNoUpdateList();
176  void x_FillUnmatchedList();
177 
178  void x_SetUp();
179  string x_GetCurrentSelection();
180 
181  void x_UpdateAlignmentPanel(const string& seq_name);
182  // skip the selected row in sel_list and update sel_list
183  // if sel_list is empty, update other_list
184  void x_SkipSelected(wxListBox& sel_list, unsigned int selected, wxListBox* other_list);
185  CRef<CCmdComposite> x_UpdateSelected(const string& seq_name, bool create_general_only);
186 
187  void x_UpdateNotebookAfterMapping(void);
188 
189  void x_CloseDialog();
190 
192 
196 
197  TNameToIDHandleMap m_UnmatchedOldSeqs; // list of old sequences that could not be matched
198  TNameToIDHandleMap m_UnmatchedUpdSeqs; // list of update sequences that could not be mapped to an old sequence
199 
201 
202  typedef tuple<objects::CSeq_id_Handle, CConstRef<objects::CSeq_align> > TAlignResult;
203  list<job_future<TAlignResult> > m_Futures;
204 
206 
208 
209  enum {
211  ID_NOTEBOOK = 10901,
212  ID_PANEL = 10902,
216  ID_PANEL1 = 10906,
221  ID_FOREIGN = 10911,
225  ID_UPDMULTSEQ_STOP = 10915
226  };
227 
228  wxNotebook* m_Notebook;
229  wxListBox* m_NonIdenticalList; // list of old sequences with nonidentical updates
230  wxListBox* m_IdenticalList; // list of old sequences with identical updates
231  wxListBox* m_NoUpdateList; // list of old sequences without updates
232  wxListBox* m_UnmatchedList; // list of update sequences that were not matched to any sequence in the seq-entry
233 
234  wxButton* m_IdenticalUpdBtn;
235  wxButton* m_LoadMap;
236  wxButton* m_MapSelection;
237 
238  unsigned int m_Updated;
239  unsigned int m_Skipped;
241 };
242 
244 
245 #endif
246  // _UPDATE_MULTI_SEQ_DLG_H_
CDialog.
Definition: dialog.hpp:47
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
CStopWatch –.
Definition: ncbitime.hpp:1937
TNameToIDHandleMap m_UnmatchedUpdSeqs
void OnIdle(wxIdleEvent &event)
virtual void x_SaveSettings(CRegistryWriteView view) const
void x_LaunchJobs(const CUpdateMultipleSeq_Input::TIDToUpdInputMap &updates)
CRef< CCmdComposite > x_UpdateSelected(const string &seq_name, bool create_general_only)
CUpdateMultipleSeq_Input * m_UpdMultiSeqInput
void OnUpdateAllSequenceClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_UPDMULTSEQ_OKALL
virtual void x_LoadSettings(const CRegistryReadView &view)
override these functions in derived classes
void x_SkipSelected(wxListBox &sel_list, unsigned int selected, wxListBox *other_list)
void OnStopUpdatingClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_UPDMULTSEQ_STOP
TNameToIDHandleMap m_SeqList
static bool ShowToolTips()
Should we show tooltips?
static void s_ReportIdenticalPairs(const CUpdateMultipleSeq_Input &input)
void OnUpdateThisSequenceClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_UPDMULTSEQ_OKTHIS
void OnMapSelectionUpdate(wxUpdateUIEvent &event)
void Init()
Initialises member variables.
void OnSkipThisSequenceClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_UPDMULTSEQ_SKIP
tuple< objects::CSeq_id_Handle, CConstRef< objects::CSeq_align > > TAlignResult
void x_GenerateAlignments(const CUpdateMultipleSeq_Input::TOldToUpdateMap &update_pairs)
CUpdateMultiSeq_Dlg()
Constructors.
static string s_GetSeqIDLabel(const objects::CSeq_id_Handle &idh)
const string & GetRevCompReport() const
void OnIdentSeqSelected(wxCommandEvent &event)
wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_UPDMULTSEQ_PNL1_LISTBOX2
set< objects::CSeq_id_Handle > m_Running
void OnLoadMapClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_UPDMULTSEQ_PNL2_BTN1
list< job_future< TAlignResult > > m_Futures
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void OnCloseWindow(wxCloseEvent &event)
wxEVT_CLOSE_WINDOW event handler for ID_CUPDATEMULTISEQ_DLG
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void OnMapSelectionClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_UPDMULTSEQ_PNL2_BTN2
void OnCancelClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void x_UpdateAlignmentPanel(const string &seq_name)
void OnNonIdentSeqSelected(wxCommandEvent &event)
wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_UPDMULTSEQ_PNL1_LISTBOX1
void OnRemoveIdenticalsClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_UPDMULTSEQ_PNL1_BTN
CUpdateSeqPanel * m_UpdSeqPanel
void OnRemoveIdenticalUpdate(wxUpdateUIEvent &event)
TNameToIDHandleMap m_UnmatchedOldSeqs
CRef< CCmdComposite > m_UpdateCmd
bool Create(wxWindow *parent, wxWindowID id=ID_CUPDATEMULTISEQ_DLG, const wxString &caption=_("Multiple Sequence Update"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
void CreateControls()
Creates the controls and sizers.
map< string, objects::CSeq_id_Handle > TNameToIDHandleMap
Include a standard set of the NCBI C++ Toolkit most basic headers.
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static int input()
const struct ncbi::grid::netcache::search::fields::SIZE size
#define SYMBOL_CUPDATEMULTISEQ_DLG_TITLE
#define SYMBOL_CUPDATEMULTISEQ_DLG_SIZE
#define SYMBOL_CUPDATEMULTISEQ_DLG_STYLE
#define SYMBOL_CUPDATEMULTISEQ_DLG_POSITION
#define SYMBOL_CUPDATEMULTISEQ_DLG_IDNAME
Modified on Sat May 04 13:12:01 2024 by modify_doxy.py rev. 669887