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

Go to the SVN repository for this file.

1 /* $Id: edit_seq_id.hpp 38638 2017-06-05 19:26:02Z asztalos $
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: Igor Filippov
27  */
28 #ifndef _EDIT_SEQ_ID_H_
29 #define _EDIT_SEQ_ID_H_
30 
31 #include <corelib/ncbistd.hpp>
32 #include <objmgr/scope.hpp>
37 
38 /*!
39  * Includes
40  */
41 
42 // For compilers that support precompilation, includes "wx/wx.h".
43 #include "wx/wxprec.h"
44 
45 #ifdef __BORLANDC__
46 #pragma hdrstop
47 #endif
48 
49 #ifndef WX_PRECOMP
50 #include "wx/wx.h"
51 #endif
52 
53 
54 /*!
55  * Forward declarations
56  */
57 
58 ////@begin forward declarations
59 ////@end forward declarations
60 
62 
64 /*!
65  * Control identifiers
66  */
67 
68 ////@begin control identifiers
69 #define ID_CEDIT_SEQ_ID 10420
70 #define SYMBOL_CEDIT_SEQ_ID_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
71 #define SYMBOL_CEDIT_SEQ_ID_TITLE _("Edit Sequence Id")
72 #define SYMBOL_CEDIT_SEQ_ID_IDNAME ID_CEDIT_SEQ_ID
73 #define SYMBOL_CEDIT_SEQ_ID_SIZE wxSize(400, 300)
74 #define SYMBOL_CEDIT_SEQ_ID_POSITION wxDefaultPosition
75 ////@end control identifiers
76 
77 
78 /*!
79  * CEditSeqId class declaration
80  */
81 
83 {
84 public:
86  CModifySeqId(objects::CSeq_entry_Handle seh, const string &name) : m_TopSeqEntry(seh), m_cmd_name(name) {}
87  virtual ~CModifySeqId() {}
88  virtual CRef<CCmdComposite> GetCommand(void);
89 
90 protected:
91  void x_ChangeId(objects::CSeq_id &id);
92  virtual void x_UpdateBioseq(CRef<CBioseq> new_seq);
94  void x_UpdateSeqAnnot(objects::CSeq_annot &annot);
95  void x_UpdateSeqAlign(objects::CSeq_align &align);
96  void x_UpdateLoc(objects::CSeq_loc &loc);
97  void x_UpdateFeat(objects::CSeq_feat &feat);
98  void x_UpdateVariation(objects::CVariation_ref &var);
99 
100  objects::CSeq_entry_Handle m_TopSeqEntry;
101  vector<pair<CConstRef<CSeq_id>, CRef<CSeq_id> > > m_old_to_new_id;
102  string m_cmd_name;
104 };
105 
107 {
108  DECLARE_DYNAMIC_CLASS( CEditSeqId )
109  DECLARE_EVENT_TABLE()
110 
111 public:
112  /// Constructors
113  CEditSeqId();
114  CEditSeqId( wxWindow* parent, objects::CSeq_entry_Handle seh, wxWindowID id = SYMBOL_CEDIT_SEQ_ID_IDNAME, const wxString& caption = SYMBOL_CEDIT_SEQ_ID_TITLE, const wxPoint& pos = SYMBOL_CEDIT_SEQ_ID_POSITION, const wxSize& size = SYMBOL_CEDIT_SEQ_ID_SIZE, long style = SYMBOL_CEDIT_SEQ_ID_STYLE );
115 
116  /// Creation
117  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CEDIT_SEQ_ID_IDNAME, const wxString& caption = SYMBOL_CEDIT_SEQ_ID_TITLE, const wxPoint& pos = SYMBOL_CEDIT_SEQ_ID_POSITION, const wxSize& size = SYMBOL_CEDIT_SEQ_ID_SIZE, long style = SYMBOL_CEDIT_SEQ_ID_STYLE );
118 
119  /// Destructor
120  virtual ~CEditSeqId();
121 
122  /// Initialises member variables
123  void Init();
124 
125  /// Creates the controls and sizers
126  void CreateControls();
127 
128 ////@begin CEditSeqId event handler declarations
129 
130 ////@end CEditSeqId event handler declarations
131 
132 ////@begin CEditSeqId member function declarations
133 
134  /// Retrieves bitmap resources
135  wxBitmap GetBitmapResource( const wxString& name );
136 
137  /// Retrieves icon resources
138  wxIcon GetIconResource( const wxString& name );
139 ////@end CEditSeqId member function declarations
140 
141  /// Should we show tooltips?
142  static bool ShowToolTips();
143  virtual CRef<CCmdComposite> GetCommand(void);
145 
146 private:
147  void x_CollectChangedIds(void);
148 
149  wxRadioButton* m_Local;
150  wxRadioButton* m_GeneralDb;
151  wxRadioButton* m_GeneralTag;
152  wxTextCtrl* m_Prefix;
153  wxTextCtrl* m_Suffix;
154  wxRadioButton* m_Any;
155  wxRadioButton* m_Nuc;
156  wxRadioButton* m_DNA;
157  wxRadioButton* m_RNA;
158  wxRadioButton* m_Proteins;
161  wxCheckBox *m_RemoveOrig;
162 };
163 
165 {
166 public:
168  CRemoveSeqId(objects::CSeq_entry_Handle seh, CSeq_id::E_Choice id_type, CSeq_inst::EMol filter = CSeq_inst::eMol_not_set);
170 protected:
171  virtual void x_UpdateBioseq(CRef<CBioseq> new_seq);
172 };
173 
175 {
176 public:
177  CLocalToGeneralId(objects::CSeq_entry_Handle seh, CSeq_inst::EMol filter = CSeq_inst::eMol_not_set);
178 };
179 
181 {
182 public:
183  CGeneralToLocalId(objects::CSeq_entry_Handle seh, CSeq_inst::EMol filter = CSeq_inst::eMol_not_set);
184 };
185 
186 
188 {
189 public:
190  CRemoveName(objects::CSeq_entry_Handle seh);
191 
192 private:
194 };
195 
197 {
198 public:
199  CAccessionToLocalId(objects::CSeq_entry_Handle seh, CSeq_inst::EMol filter, bool force_name);
200 
201 private:
202  void x_GetReplacementIds(CConstRef<CSeq_id> id, bool force_name);
203 };
204 
205 ////@begin control identifiers
206 #define ID_REMOVE_GENERAL_ID 10420
207 #define SYMBOL_REMOVE_GENERAL_ID_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
208 #define SYMBOL_REMOVE_GENERAL_ID_TITLE _("Remove General Id")
209 #define SYMBOL_REMOVE_GENERAL_ID_IDNAME ID_REMOVE_GENERAL_ID
210 #define SYMBOL_REMOVE_GENERAL_ID_SIZE wxSize(400, 300)
211 #define SYMBOL_REMOVE_GENERAL_ID_POSITION wxDefaultPosition
212 ////@end control identifiers
213 
215 {
216  DECLARE_DYNAMIC_CLASS( CRemoveGeneralId )
217  DECLARE_EVENT_TABLE()
218 
219 public:
220  /// Constructors
222  CRemoveGeneralId( wxWindow* parent, objects::CSeq_entry_Handle seh, wxWindowID id = SYMBOL_REMOVE_GENERAL_ID_IDNAME, const wxString& caption = SYMBOL_REMOVE_GENERAL_ID_TITLE, const wxPoint& pos = SYMBOL_REMOVE_GENERAL_ID_POSITION, const wxSize& size = SYMBOL_REMOVE_GENERAL_ID_SIZE, long style = SYMBOL_REMOVE_GENERAL_ID_STYLE );
223 
224  /// Creation
225  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_REMOVE_GENERAL_ID_IDNAME, const wxString& caption = SYMBOL_REMOVE_GENERAL_ID_TITLE, const wxPoint& pos = SYMBOL_REMOVE_GENERAL_ID_POSITION, const wxSize& size = SYMBOL_REMOVE_GENERAL_ID_SIZE, long style = SYMBOL_REMOVE_GENERAL_ID_STYLE );
226 
227  /// Destructor
228  virtual ~CRemoveGeneralId();
229 
230  /// Initialises member variables
231  void Init();
232 
233  /// Creates the controls and sizers
234  void CreateControls();
235 
236 ////@begin CEditSeqId event handler declarations
237 
238 ////@end CEditSeqId event handler declarations
239 
240 ////@begin CEditSeqId member function declarations
241 
242  /// Retrieves bitmap resources
243  wxBitmap GetBitmapResource( const wxString& name );
244 
245  /// Retrieves icon resources
246  wxIcon GetIconResource( const wxString& name );
247 ////@end CEditSeqId member function declarations
248 
249  /// Should we show tooltips?
250  static bool ShowToolTips();
251  virtual CRef<CCmdComposite> GetCommand(void);
252 
253 private:
254  void x_CollectChangedIds(void);
255 
257 };
258 
259 
261 
262 #endif
263  // _EDIT_SEQ_ID_H_
CAccessionToLocalId(objects::CSeq_entry_Handle seh, CSeq_inst::EMol filter, bool force_name)
void x_GetReplacementIds(CConstRef< CSeq_id > id, bool force_name)
CRef< CCmdComposite > GetRemoveOriginalIdCommand(void)
wxTextCtrl * m_Suffix
wxTextCtrl * m_Prefix
wxRadioButton * m_Proteins
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void x_CollectChangedIds(void)
wxRadioButton * m_Nuc
bool Create(wxWindow *parent, wxWindowID id=10420, const wxString &caption=_("Edit Sequence Id"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxRadioButton * m_GeneralTag
CStringConstraintPanel * m_StringConstraintPanel
CEditSeqId()
Constructors.
Definition: edit_seq_id.cpp:96
wxRadioButton * m_Any
CParseTextOptionsDlg * m_ParseOptions
static bool ShowToolTips()
Should we show tooltips?
CEditSeqId(wxWindow *parent, objects::CSeq_entry_Handle seh, wxWindowID id=10420, const wxString &caption=_("Edit Sequence Id"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
wxRadioButton * m_Local
virtual CRef< CCmdComposite > GetCommand(void)
wxRadioButton * m_RNA
wxRadioButton * m_DNA
virtual ~CEditSeqId()
Destructor.
void Init()
Initialises member variables.
wxCheckBox * m_RemoveOrig
void CreateControls()
Creates the controls and sizers.
wxRadioButton * m_GeneralDb
CGeneralToLocalId(objects::CSeq_entry_Handle seh, CSeq_inst::EMol filter=CSeq_inst::eMol_not_set)
CLocalToGeneralId(objects::CSeq_entry_Handle seh, CSeq_inst::EMol filter=CSeq_inst::eMol_not_set)
vector< pair< CConstRef< CSeq_id >, CRef< CSeq_id > > > m_old_to_new_id
void x_ChangeId(objects::CSeq_id &id)
string m_cmd_name
virtual ~CModifySeqId()
Definition: edit_seq_id.hpp:87
virtual CRef< CCmdComposite > GetCommand(void)
void x_UpdateSeqAlign(objects::CSeq_align &align)
virtual void x_UpdateBioseq(CRef< CBioseq > new_seq)
void x_UpdateSeqAnnot(objects::CSeq_annot &annot)
void x_GetRemoveOriginalIdCommand(CRef< CCmdComposite > cmd)
objects::CSeq_entry_Handle m_TopSeqEntry
set< string > m_remove_ids
void x_UpdateLoc(objects::CSeq_loc &loc)
void x_UpdateVariation(objects::CVariation_ref &var)
CModifySeqId(objects::CSeq_entry_Handle seh, const string &name)
Definition: edit_seq_id.hpp:86
void x_UpdateFeat(objects::CSeq_feat &feat)
CStringConstraintPanel * m_StringConstraintPanel
void Init()
Initialises member variables.
static bool ShowToolTips()
Should we show tooltips?
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
bool Create(wxWindow *parent, wxWindowID id=10420, const wxString &caption=_("Remove General Id"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
void x_CollectChangedIds(void)
CRemoveGeneralId()
Constructors.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
virtual ~CRemoveGeneralId()
Destructor.
void CreateControls()
Creates the controls and sizers.
virtual CRef< CCmdComposite > GetCommand(void)
CRemoveGeneralId(wxWindow *parent, objects::CSeq_entry_Handle seh, wxWindowID id=10420, const wxString &caption=_("Remove General Id"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
CRemoveName(objects::CSeq_entry_Handle seh)
void x_GetReplacementIds(CConstRef< CSeq_id > id)
virtual void x_UpdateBioseq(CRef< CBioseq > new_seq)
CRef< CCmdComposite > GetRemoveOriginalIdCommand()
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define SYMBOL_REMOVE_GENERAL_ID_IDNAME
#define SYMBOL_REMOVE_GENERAL_ID_POSITION
#define SYMBOL_CEDIT_SEQ_ID_SIZE
Definition: edit_seq_id.hpp:73
#define SYMBOL_REMOVE_GENERAL_ID_TITLE
#define SYMBOL_CEDIT_SEQ_ID_TITLE
Definition: edit_seq_id.hpp:71
#define SYMBOL_CEDIT_SEQ_ID_IDNAME
Definition: edit_seq_id.hpp:72
#define SYMBOL_REMOVE_GENERAL_ID_STYLE
#define SYMBOL_CEDIT_SEQ_ID_POSITION
Definition: edit_seq_id.hpp:74
#define SYMBOL_CEDIT_SEQ_ID_STYLE
Definition: edit_seq_id.hpp:70
#define SYMBOL_REMOVE_GENERAL_ID_SIZE
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
E_Choice
Choice variants.
Definition: Seq_id_.hpp:93
EMol
molecule class in living organism
Definition: Seq_inst_.hpp:108
@ eMol_not_set
> cdna = rna
Definition: Seq_inst_.hpp:109
const struct ncbi::grid::netcache::search::fields::SIZE size
Modified on Sun May 19 04:42:35 2024 by modify_doxy.py rev. 669887