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

Go to the SVN repository for this file.

1 /* $Id: remove_sequences_from_alignments.hpp 40701 2018-04-03 20:43:31Z 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: Igor Filippov
27  */
28 #ifndef _REMOVE_SEQ_FROM_ALIGN_DLG_H_
29 #define _REMOVE_SEQ_FROM_ALIGN_DLG_H_
30 
31 #include <corelib/ncbistd.hpp>
35 
36 #include <wx/dialog.h>
37 
38 /*!
39  * Includes
40  */
41 
42 ////@begin includes
43 ////@end includes
44 #include <wx/sizer.h>
45 #include <wx/listctrl.h>
46 #include <wx/radiobut.h>
47 #include <wx/checkbox.h>
48 #include <wx/textctrl.h>
51 
52 /*!
53  * Forward declarations
54  */
55 
56 ////@begin forward declarations
57 class wxBoxSizer;
58 ////@end forward declarations
59 
61 using namespace objects;
62 
63 /*!
64  * Control identifiers
65  */
66 
67 ////@begin control identifiers
68 #define ID_CREMOVE_SEQ_FROM_ALIGN_DLG 12000
69 #define SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
70 #define SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_TITLE _("Remove Sequences From Alignments")
71 #define SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_IDNAME ID_CREMOVE_SEQ_FROM_ALIGN_DLG
72 #define SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_SIZE wxDefaultSize
73 #define SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_POSITION wxDefaultPosition
74 ////@end control identifiers
75 #define ID_LISTCTRL_SEQ_ALIGN 12001
76 
78 {
79  DECLARE_DYNAMIC_CLASS( CRemoveSeqFromAlignDlg )
80  DECLARE_EVENT_TABLE()
81 
82 public:
83  /// Constructors
85  CRemoveSeqFromAlignDlg( wxWindow* parent, objects::CSeq_entry_Handle seh, wxWindowID id = SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_IDNAME, const wxString& caption = SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_TITLE, const wxPoint& pos = SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_POSITION, const wxSize& size = SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_SIZE, long style = SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_STYLE );
86 
87  /// Creation
88  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_IDNAME, const wxString& caption = SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_TITLE, const wxPoint& pos = SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_POSITION, const wxSize& size = SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_SIZE, long style = SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_STYLE );
89 
90  /// Destructor
92 
93  /// Initialises member variables
94  void Init();
95  void Init(objects::CSeq_entry_Handle seh);
96 
97  /// Creates the controls and sizers
98  void CreateControls();
99 
100  /// Retrieves bitmap resources
101  wxBitmap GetBitmapResource( const wxString& name );
102 
103  /// Retrieves icon resources
104  wxIcon GetIconResource( const wxString& name );
105 
106  /// Should we show tooltips?
107  static bool ShowToolTips();
108 
109  CRef<CCmdComposite> GetCommand();
110  static void ApplyToCSeq_entry (objects::CSeq_entry_Handle tse, CCmdComposite* composite, const vector<string> &names);
111 
112 private:
113  objects::CSeq_entry_Handle m_TopSeqEntry;
115  wxListCtrl* m_ListCtrl;
116  static bool RemoveIdLabel(const CSeq_align& align, string name, bool& modified);
117  static void ModifyAlign(CRef<CSeq_align> align, const string name);
118  void GetAlignLabel(const CSeq_align& align);
119  void SearchSeq_entry (objects::CSeq_entry_Handle tse, const CSeq_entry& se);
120  static bool GetIdsFromLocs(const CStd_seg::TLoc& locs, set<string> &labels, const string name="", bool detect=false, bool found=false);
121  static bool GetIdsFromLoc(const CSeq_loc& loc, set<string> &labels, const string name="", bool detect=false, bool found=false);
122 };
123 
124 
125 
127 
128 #endif
129  // _REMOVE_SEQ_FROM_ALIGN_DLG_H_
objects::CSeq_entry_Handle m_TopSeqEntry
Definition: Seq_entry.hpp:56
Include a standard set of the NCBI C++ Toolkit most basic headers.
static void Init(void)
Definition: cursor6.c:76
static const struct name_t names[]
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
vector< CRef< CSeq_loc > > TLoc
Definition: Std_seg_.hpp:93
const struct ncbi::grid::netcache::search::fields::SIZE size
#define SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_STYLE
#define SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_IDNAME
#define SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_SIZE
#define SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_TITLE
#define SYMBOL_CREMOVE_SEQ_FROM_ALIGN_DLG_POSITION
Modified on Mon Mar 04 05:09:59 2024 by modify_doxy.py rev. 669887