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

Go to the SVN repository for this file.

1 /* $Id: raw_seq_to_delta_by_loc.hpp 42755 2019-04-10 16:32:15Z 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 _RAW_SEQ_TO_DELTA_BY_LOC_H_
29 #define _RAW_SEQ_TO_DELTA_BY_LOC_H_
30 
31 #include <corelib/ncbistd.hpp>
32 #include <wx/dialog.h>
33 #include <objects/seq/Seq_gap.hpp>
35 #include <objmgr/bioseq_handle.hpp>
40 #include <objmgr/bioseq_ci.hpp>
42 
43 /*!
44  * Includes
45  */
46 
47 ////@begin includes
48 ////@end includes
49 #include <wx/sizer.h>
50 
51 /*!
52  * Forward declarations
53  */
54 
55 ////@begin forward declarations
56 class wxBoxSizer;
57 class wxRadioButton;
58 class wxCheckBox;
59 class wxTextCtrl;
60 ////@end forward declarations
61 
63 
64 /*!
65  * Control identifiers
66  */
67 
68 ////@begin control identifiers
69 #define ID_CRAWSEQTODELTASEQBYLOC 10000
70 #define ID_CRAWTODELTA_SCROLLEDWINDOW 10001
71 #define ID_CRAWTODELTA_TEXTCTRL 10002
72 #define ID_CRAWTODELTA_CHOICE 10003
73 #define ID_CRAWTODELTA_TEXTCTRL1 10004
74 #define ID_CRAWTODELTA_CHOICE1 10005
75 #define ID_CRAWTODELTA_TEXTCTRL2 10011
76 #define ID_CRAWTODELTA_CHOICE2 10012
77 #define ID_CRAWTODELTA_TEXTCTRL3 10013
78 #define ID_CRAWTODELTA_CHOICE3 10014
79 #define ID_CRAWTODELTA_TEXTCTRL4 10015
80 #define ID_CRAWTODELTA_CHOICE4 10016
81 #define ID_CRAWTODELTA_TEXTCTRL5 10017
82 #define ID_CRAWTODELTA_CHOICE5 10018
83 #define ID_CRAWTODELTA_TEXTCTRL6 10019
84 #define ID_CRAWTODELTA_CHOICE6 10020
85 #define ID_CRAWTODELTA_TEXTCTRL7 10021
86 #define ID_CRAWTODELTA_CHOICE7 10022
87 #define ID_CRAWTODELTA_RADIOBUTTON 10006
88 #define ID_CRAWTODELTA_RADIOBUTTON1 10007
89 #define ID_CRAWTODELTA_CHECKBOX 10008
90 #define SYMBOL_CRAWSEQTODELTASEQBYLOC_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
91 #define SYMBOL_CRAWSEQTODELTASEQBYLOC_TITLE _("Convert Raw Sequence to Delta Sequence")
92 #define SYMBOL_CRAWSEQTODELTASEQBYLOC_IDNAME ID_CRAWSEQTODELTASEQBYLOC
93 #define SYMBOL_CRAWSEQTODELTASEQBYLOC_SIZE wxSize(400, 300)
94 #define SYMBOL_CRAWSEQTODELTASEQBYLOC_POSITION wxDefaultPosition
95 ////@end control identifiers
96 
97 
98 /*!
99  * CRawSeqToDeltaSeqByLoc class declaration
100  */
101 
103 {
104  DECLARE_DYNAMIC_CLASS( CRawSeqToDeltaSeqByLoc )
105  DECLARE_EVENT_TABLE()
106 
107 public:
108  /// Constructors
110  CRawSeqToDeltaSeqByLoc( wxWindow* parent, objects::CSeq_entry_Handle tse, wxWindowID id = SYMBOL_CRAWSEQTODELTASEQBYLOC_IDNAME, const wxString& caption = SYMBOL_CRAWSEQTODELTASEQBYLOC_TITLE, const wxPoint& pos = SYMBOL_CRAWSEQTODELTASEQBYLOC_POSITION, const wxSize& size = SYMBOL_CRAWSEQTODELTASEQBYLOC_SIZE, long style = SYMBOL_CRAWSEQTODELTASEQBYLOC_STYLE );
111 
112  /// Creation
113  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CRAWSEQTODELTASEQBYLOC_IDNAME, const wxString& caption = SYMBOL_CRAWSEQTODELTASEQBYLOC_TITLE, const wxPoint& pos = SYMBOL_CRAWSEQTODELTASEQBYLOC_POSITION, const wxSize& size = SYMBOL_CRAWSEQTODELTASEQBYLOC_SIZE, long style = SYMBOL_CRAWSEQTODELTASEQBYLOC_STYLE );
114 
115  /// Destructor
117 
118  /// Initialises member variables
119  void Init();
120 
121  /// Creates the controls and sizers
122  void CreateControls();
123 
124 ////@begin CRawSeqToDeltaSeqByLoc event handler declarations
125 
126 ////@end CRawSeqToDeltaSeqByLoc event handler declarations
127 
128 ////@begin CRawSeqToDeltaSeqByLoc member function declarations
129 
130  /// Retrieves bitmap resources
131  wxBitmap GetBitmapResource( const wxString& name );
132 
133  /// Retrieves icon resources
134  wxIcon GetIconResource( const wxString& name );
135 ////@end CRawSeqToDeltaSeqByLoc member function declarations
136 
137  /// Should we show tooltips?
138  static bool ShowToolTips();
139  void OnNewText(wxCommandEvent& event);
140 
141  CRef<CCmdComposite> apply(string title);
142 
143  static void UpdateDensegAlignment(const objects::CSeq_entry_Handle& tse, CRef<CCmdComposite> composite,
144  const vector<NRawToDeltaSeq::SGap> &gaps, const bool use_align_coords);
145  static CRef<CCmdComposite> ByAssemblyGapFeatures(objects::CSeq_entry_Handle seh);
146  void UseAlignCoords(objects::CBioseq_Handle bsh, vector<NRawToDeltaSeq::SGap> &gaps);
147  void ComputeAlignCoords(objects::CBioseq_Handle bsh, int before, int after, int &real_before, int &real_after);
148 private:
149  static void x_UpdateRows(size_t num_rows, const vector<NRawToDeltaSeq::SGap> &gaps, const vector< TSignedSeqPos > &orig_starts, const vector< TSeqPos > &lens,
150  const vector< objects::ENa_strand > &strands, const vector< CRef< objects::CScore > > &scores,
151  vector< vector< vector<TSignedSeqPos> > > &all_new_starts, vector< vector<TSeqPos> > &all_new_lens,
152  vector< vector< vector< objects::ENa_strand > > > &all_new_strands, vector< vector< CRef<objects::CScore> > > &all_new_scores,
153  const bool use_align_coords, const objects::CSeq_align& align);
154 
155  static CRef<objects::CSeq_align> x_GetNewAlign(const size_t block, const objects::CSeq_align& align, const size_t num_rows,
156  const vector < vector< vector<TSignedSeqPos> > > &all_new_starts, const vector < vector<TSeqPos> > &all_new_lens,
157  const vector< vector< vector< objects::ENa_strand > > > &all_new_strands, const vector< vector< CRef<objects::CScore> > > &all_new_scores);
158 
159  CRef<CCmdComposite> apply_impl(string title, map<objects::CObject_id::TId, objects::CObject_id::TId> &old_to_new, bool create_xref_map);
160  static CRef<CCmdComposite> ByAssemblyGapFeatures_impl(objects::CSeq_entry_Handle seh, map<objects::CObject_id::TId, objects::CObject_id::TId> &old_to_new, bool create_xref_map);
161 
162 ////@begin CRawSeqToDeltaSeqByLoc member variables
163  wxBoxSizer* m_ScrollSizer;
164  wxRadioButton* m_CoordSeq;
165  wxCheckBox* m_AdjustCDS;
166  wxTextCtrl* m_LastStart;
167  wxTextCtrl* m_LastLength;
168 ////@end CRawSeqToDeltaSeqByLoc member variables
169  objects::CSeq_entry_Handle m_TopSeqEntry;
170 };
171 
172 
174 
175 #endif
176  // _RAW_SEQ_TO_DELTA_BY_LOC_H_
User-defined methods of the data storage class.
CRef< CCmdComposite > apply_impl(string title, map< objects::CObject_id::TId, objects::CObject_id::TId > &old_to_new, bool create_xref_map)
void ComputeAlignCoords(objects::CBioseq_Handle bsh, int before, int after, int &real_before, int &real_after)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void OnNewText(wxCommandEvent &event)
void Init()
Initialises member variables.
static void x_UpdateRows(size_t num_rows, const vector< NRawToDeltaSeq::SGap > &gaps, const vector< TSignedSeqPos > &orig_starts, const vector< TSeqPos > &lens, const vector< objects::ENa_strand > &strands, const vector< CRef< objects::CScore > > &scores, vector< vector< vector< TSignedSeqPos > > > &all_new_starts, vector< vector< TSeqPos > > &all_new_lens, vector< vector< vector< objects::ENa_strand > > > &all_new_strands, vector< vector< CRef< objects::CScore > > > &all_new_scores, const bool use_align_coords, const objects::CSeq_align &align)
void CreateControls()
Creates the controls and sizers.
static bool ShowToolTips()
Should we show tooltips?
objects::CSeq_entry_Handle m_TopSeqEntry
static CRef< objects::CSeq_align > x_GetNewAlign(const size_t block, const objects::CSeq_align &align, const size_t num_rows, const vector< vector< vector< TSignedSeqPos > > > &all_new_starts, const vector< vector< TSeqPos > > &all_new_lens, const vector< vector< vector< objects::ENa_strand > > > &all_new_strands, const vector< vector< CRef< objects::CScore > > > &all_new_scores)
CRef< CCmdComposite > apply(string title)
void UseAlignCoords(objects::CBioseq_Handle bsh, vector< NRawToDeltaSeq::SGap > &gaps)
static CRef< CCmdComposite > ByAssemblyGapFeatures_impl(objects::CSeq_entry_Handle seh, map< objects::CObject_id::TId, objects::CObject_id::TId > &old_to_new, bool create_xref_map)
static void UpdateDensegAlignment(const objects::CSeq_entry_Handle &tse, CRef< CCmdComposite > composite, const vector< NRawToDeltaSeq::SGap > &gaps, const bool use_align_coords)
static CRef< CCmdComposite > ByAssemblyGapFeatures(objects::CSeq_entry_Handle seh)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
bool Create(wxWindow *parent, wxWindowID id=10000, const wxString &caption=_("Convert Raw Sequence to Delta Sequence"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
Definition: map.hpp:338
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
const struct ncbi::grid::netcache::search::fields::SIZE size
#define SYMBOL_CRAWSEQTODELTASEQBYLOC_SIZE
#define SYMBOL_CRAWSEQTODELTASEQBYLOC_POSITION
#define SYMBOL_CRAWSEQTODELTASEQBYLOC_IDNAME
#define SYMBOL_CRAWSEQTODELTASEQBYLOC_TITLE
#define SYMBOL_CRAWSEQTODELTASEQBYLOC_STYLE
Modified on Wed May 29 18:35:07 2024 by modify_doxy.py rev. 669887