NCBI C++ ToolKit
reorder_sequences_dlg.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1  /* $Id: reorder_sequences_dlg.cpp 33127 2015-06-01 21:14:42Z 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 
29 
30 #include <ncbi_pch.hpp>
31 
32 ////@begin includes
33 ////@end includes
34 
35 #include <objmgr/scope.hpp>
41 
42 #include <wx/button.h>
43 #include <wx/statbox.h>
44 
45 ////@begin XPM images
46 ////@end XPM images
47 
48 static const char * up_xpm[] = {
49 "16 16 2 1",
50 " c None",
51 "X c Gray25",
52 " ",
53 " ",
54 " ",
55 " ",
56 " ",
57 " ",
58 " X ",
59 " XXX ",
60 " XXXXX ",
61 " XXXXXXX ",
62 " ",
63 " ",
64 " ",
65 " ",
66 " ",
67 " "};
68 
69 
70 static const char * down_xpm[] = {
71 "16 16 2 1",
72 " c None",
73 "X c Gray25",
74 " ",
75 " ",
76 " ",
77 " ",
78 " ",
79 " ",
80 " XXXXXXX ",
81 " XXXXX ",
82 " XXX ",
83 " X ",
84 " ",
85 " ",
86 " ",
87 " ",
88 " ",
89 " "};
90 
92 
93 
94 
95 IMPLEMENT_DYNAMIC_CLASS( CReorderSequencesDlg, wxDialog )
96 
97 
98 /*!
99  * CReorderSequencesDlg event table definition
100  */
101 
102 BEGIN_EVENT_TABLE( CReorderSequencesDlg, wxDialog )
103 
107 
109 
110 
111 /*!
112  * CReorderSequencesDlg constructors
113  */
114 
116 {
117  Init();
118 }
119 
120 CReorderSequencesDlg::CReorderSequencesDlg( wxWindow* parent, objects::CSeq_entry_Handle seh,
121  wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
122 : m_TopSeqEntry(seh)
123 {
124  Init();
125  Create(parent, id, caption, pos, size, style);
126 }
127 
128 
129 /*!
130  * CVectorTrimDlg creator
131  */
132 
133 bool CReorderSequencesDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
134 {
135 ////@begin CReorderSequencesDlg creation
136  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
137  wxDialog::Create( parent, id, caption, pos, size, style );
138 
139  CreateControls();
140  if (GetSizer())
141  {
142  GetSizer()->SetSizeHints(this);
143  }
144  Centre();
145 ////@end CReorderSequencesDlg creation
146 
147  SetSize(wxSize(280, 750));
148  return true;
149 }
150 
151 
152 /*!
153  * CReorderSequencesDlg destructor
154  */
155 
157 {
158 ////@begin CReorderSequencesDlg destruction
159 ////@end CReorderSequencesDlg destruction
160 }
161 
162 
163 /*!
164  * Member initialisation
165  */
166 
168 {
169  m_ListCtrl = NULL;
170  m_ReverseSort = true;
171  m_SortButton = NULL;
172  m_down_bitmap = wxBitmap(down_xpm);
173  m_up_bitmap = wxBitmap(up_xpm);
174 }
175 
176 
177 /*!
178  * Control creation for CReorderSequencesDlg
179  */
180 
182 {
183  CReorderSequencesDlg* itemDialog1 = this;
184 
185  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
186  itemDialog1->SetSizer(itemBoxSizer2);
187 
188  wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
189  itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
190 
191  m_ListCtrl = new wxListCtrl( itemDialog1, ID_LISTCTRL_REORDER, wxDefaultPosition, wxSize(240, 570), wxLC_REPORT );
192  itemBoxSizer3->Add(m_ListCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
193 
194  m_ListCtrl->InsertColumn(0," Sequence",wxLIST_FORMAT_LEFT,220);
195  if (m_TopSeqEntry)
196  {
197  m_SetSeq.clear();
198  ReadBioseq(*(m_TopSeqEntry.GetCompleteSeq_entry()),m_SetSeq, m_TopSeqEntry);
199 
200  for (unsigned int i=0; i<m_SetSeq.size(); ++i)
201  {
202  string label;
203  m_SetSeq[i].second.GetSeq().GetSeqId()->GetLabel(&label,CSeq_id::eContent);
204  m_ListCtrl->InsertItem(i, ToWxString(label));
205  m_ListCtrl->SetItemData(i,i);
206  }
207  }
208 
209  wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Move selected sequences"));
210  wxStaticBoxSizer* itemStaticBoxSizer4 = new wxStaticBoxSizer(itemStaticBoxSizer4Static, wxHORIZONTAL);
211  itemBoxSizer2->Add(itemStaticBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
212 
213  wxButton* itemButton1 = new wxButton( itemDialog1, ID_BUTTON_UP, _("Up"), wxDefaultPosition, wxDefaultSize, 0 );
214  itemStaticBoxSizer4->Add(itemButton1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 15);
215 
216  wxButton* itemButton2 = new wxButton( itemDialog1, ID_BUTTON_DOWN, _("Down"), wxDefaultPosition, wxDefaultSize, 0 );
217  itemStaticBoxSizer4->Add(itemButton2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 15);
218 
219  wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL);
220  itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
221 
222 
223  m_SortButton = new wxButton( itemDialog1, ID_BUTTON_SORT, _("Sort"), wxDefaultPosition, wxDefaultSize, 0 );
224  if (m_ReverseSort) m_SortButton->SetBitmapLabel(m_up_bitmap);
225  else m_SortButton->SetBitmapLabel(m_down_bitmap);
226  m_SortButton->SetBitmapPosition(wxRIGHT);
227  itemBoxSizer5->Add(m_SortButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
228 
229 
230  wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
231  itemBoxSizer2->Add(itemBoxSizer12, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
232 
233  wxButton* itemButton13 = new wxButton( itemDialog1, wxID_OK, _("Accept"), wxDefaultPosition, wxDefaultSize, 0 );
234  itemBoxSizer12->Add(itemButton13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
235 
236  wxButton* itemButton14 = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
237  itemBoxSizer12->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
238 }
239 
240 
241 void CReorderSequencesDlg::ReadBioseq(const CSeq_entry& se,vector < pair<CBioseq_set_Handle,CSeq_entry_Handle> > &setseq, CSeq_entry_Handle seh )
242 {
243  if (se.IsSet())
244  {
246  {
247  ReadBioseq(**it,setseq, seh);
248  }
249  }
250  if (se.IsSeq() && se.GetSeq().IsNa())
251  {
252  CBioseq_Handle bsh = seh.GetBioseqHandle(*se.GetSeq().GetFirstId());
253  if (bsh)
254  {
256  if (bssh && bssh.GetBioseq_setCore()->CanGetClass() && bssh.GetBioseq_setCore()->GetClass() == CBioseq_set::eClass_nuc_prot) // if it is a nuc-prot set go a level higher
257  bssh = bssh.GetParentBioseq_set();
258 
259  if (bssh)
260  setseq.push_back(pair<CBioseq_set_Handle,CSeq_entry_Handle>(bssh,bsh.GetSeq_entry_Handle())); // need to save: parent or grandparent set handle, seq-entry handle
261  }
262  }
263 }
264 
265 /*!
266  * Should we show tooltips?
267  */
268 
270 {
271  return true;
272 }
273 
274 /*!
275  * Get bitmap resources
276  */
277 
278 wxBitmap CReorderSequencesDlg::GetBitmapResource( const wxString& name )
279 {
280  // Bitmap retrieval
281  wxUnusedVar(name);
282  return wxNullBitmap;
283 }
284 
285 /*!
286  * Get icon resources
287  */
288 
289 wxIcon CReorderSequencesDlg::GetIconResource( const wxString& name )
290 {
291  // Icon retrieval
292  wxUnusedVar(name);
293  return wxNullIcon;
294 }
295 
297 {
298  CRef<CCmdComposite> cmd( new CCmdComposite("Reorder Sequences") );
299  if (m_ListCtrl && m_TopSeqEntry)
300  {
301  vector < pair<CBioseq_set_Handle,CSeq_entry_Handle> > setseq;
302  ReadBioseq(*(m_TopSeqEntry.GetCompleteSeq_entry()),setseq, m_TopSeqEntry);
303  set<CBioseq_set_Handle> uniq_bssh;
304  for (unsigned int i=0; i<setseq.size(); ++i)
305  {
306  CBioseq_set_Handle bssh = setseq[i].first;
307  uniq_bssh.insert(bssh);
308  }
309  for (set<CBioseq_set_Handle>::iterator b = uniq_bssh.begin(); b != uniq_bssh.end(); ++b)
310  {
311  CBioseq_set_Handle bssh = *b;
312  if (bssh)
313  {
314  CRef<objects::CBioseq_set> new_set(new objects::CBioseq_set());
315  new_set->Assign(*bssh.GetCompleteBioseq_set());
316  vector<int> list_index;
317  PrepareList(list_index);
318  PopulateSet(bssh,*new_set, list_index, m_SetSeq);
319  CCmdChangeBioseqSet *set_cmd = new CCmdChangeBioseqSet(bssh, *new_set);
320  cmd->AddCommand(*set_cmd);
321  }
322  }
323  }
324 
325  return cmd;
326 }
327 
328 void CReorderSequencesDlg::PrepareList(vector<int> &list_index)
329 {
330  long item = -1;
331  for ( ;; )
332  {
333  item = m_ListCtrl->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_DONTCARE);
334  if ( item == -1 ) break;
335  int i = static_cast<int>(m_ListCtrl->GetItemData(item));
336  list_index.push_back(i);
337  }
338 }
339 
340 void CReorderSequencesDlg::PopulateSet(CBioseq_set_Handle bssh, CBioseq_set& new_set, const vector<int> &list_index, const vector < pair<CBioseq_set_Handle,CSeq_entry_Handle> > &set_seq) // Add sorted sequences to a given bioseq-set
341 {
342  if (new_set.CanGetSeq_set())
343  {
344  CBioseq_set::TSeq_set old_seq_set = new_set.GetSeq_set();
345  new_set.ResetSeq_set();
346 
347  for ( size_t j = 0; j < list_index.size(); j++)
348  {
349  int i = list_index[j];
350  if (set_seq[i].first == bssh) // go through the list of all sequences and select only the ones where saved set handle (parent or grandparent) is the same as the given set
351  {
352  CRef<CSeq_entry> se(new CSeq_entry());
353  if (set_seq[i].second.HasParentEntry() && set_seq[i].second.GetParentEntry().IsSet() && // if parent set is different from saved set handle and the given set
354  set_seq[i].second.GetParentBioseq_set() != bssh && set_seq[i].second.GetParentEntry().GetSet().CanGetClass() && // and the parent set is a nuc-prot set
355  set_seq[i].second.GetParentEntry().GetSet().GetClass() == CBioseq_set::eClass_nuc_prot)
356  se->Assign(*set_seq[i].second.GetParentEntry().GetCompleteSeq_entry()); // move the complete nuc-prot set
357  else
358  se->Assign(*set_seq[i].second.GetCompleteSeq_entry()); // otherwise just move the entry
359  new_set.SetSeq_set().push_back(se);
360 
361  CBioseq_set::TSeq_set::iterator it = old_seq_set.begin();
362  while (it != old_seq_set.end())
363  {
364  bool match = false;
365  if ((*it)->IsSeq() && (*it)->GetSeq().CanGetId())
366  for (CBioseq::TId::const_iterator b = (*it)->GetSeq().GetId().begin(); b != (*it)->GetSeq().GetId().end(); ++b) // remove from old_seq_set sequences with the same id
367  if ((*b)->Match(*set_seq[i].second.GetSeq().GetSeqId())) match = true;
368 
369  if ((*it)->IsSet() && (*it)->GetSet().CanGetClass() && (*it)->GetSet().GetClass() == CBioseq_set::eClass_nuc_prot && // remove from old_seq_set nuc-prot sets where nuc portion has the same id
370  (*it)->GetSet().GetNucFromNucProtSet().CanGetId())
371  for (CBioseq::TId::const_iterator b = (*it)->GetSet().GetNucFromNucProtSet().GetId().begin(); b != (*it)->GetSet().GetNucFromNucProtSet().GetId().end(); ++b)
372  if ((*b)->Match(*set_seq[i].second.GetSeq().GetSeqId())) match = true;
373 
374  if (match)
375  it = old_seq_set.erase(it);
376  else
377  ++it;
378  }
379 
380  }
381  }
382  for (CBioseq_set::TSeq_set::iterator it = old_seq_set.begin(); it != old_seq_set.end(); ++it)
383  new_set.SetSeq_set().push_back(*it);
384  }
385 }
386 
387 
388 void CReorderSequencesDlg::OnButtonUp( wxCommandEvent& event )
389 {
390  long item = -1;
391  if (m_ListCtrl)
392  for ( ;; )
393  {
394  item = m_ListCtrl->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
395  if ( item == -1 ) break;
396  if ( item == 0 ) break; // cannot move up selection which starts at the top.
397  int i = static_cast<int>(m_ListCtrl->GetItemData(item));
398  wxString name_i = m_ListCtrl->GetItemText(item);
399  int state_i = m_ListCtrl->GetItemState(item,wxLIST_STATE_SELECTED);
400  int j = static_cast<int>(m_ListCtrl->GetItemData(item-1));
401  wxString name_j = m_ListCtrl->GetItemText(item-1);
402  int state_j = m_ListCtrl->GetItemState(item-1,wxLIST_STATE_SELECTED);
403  m_ListCtrl->SetItemText(item-1,name_i);
404  m_ListCtrl->SetItemData(item-1,i);
405  m_ListCtrl->SetItemState(item-1,state_i,wxLIST_STATE_SELECTED);
406  m_ListCtrl->SetItemText(item,name_j);
407  m_ListCtrl->SetItemData(item,j);
408  m_ListCtrl->SetItemState(item,state_j,wxLIST_STATE_SELECTED);
409  }
410  event.Skip();
411 }
412 
413 void CReorderSequencesDlg::OnButtonDown( wxCommandEvent& event )
414 {
415  vector<long> index;
416  long item = -1;
417  if (m_ListCtrl)
418  for ( ;; )
419  {
420  item = m_ListCtrl->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
421  if ( item == -1 ) break;
422  index.push_back(item);
423  }
424  if ( !index.empty() && index.back() != m_ListCtrl->GetItemCount()-1 ) // cannot move down selection which ends at the bottom.
425  for (vector<long>::reverse_iterator rit = index.rbegin(); rit != index.rend(); ++rit)
426  {
427  item = *rit;
428  int i = static_cast<int>(m_ListCtrl->GetItemData(item));
429  wxString name_i = m_ListCtrl->GetItemText(item);
430  int state_i = m_ListCtrl->GetItemState(item,wxLIST_STATE_SELECTED);
431  int j = static_cast<int>(m_ListCtrl->GetItemData(item+1));
432  wxString name_j = m_ListCtrl->GetItemText(item+1);
433  int state_j = m_ListCtrl->GetItemState(item+1,wxLIST_STATE_SELECTED);
434  m_ListCtrl->SetItemText(item+1,name_i);
435  m_ListCtrl->SetItemData(item+1,i);
436  m_ListCtrl->SetItemState(item+1,state_i,wxLIST_STATE_SELECTED);
437  m_ListCtrl->SetItemText(item,name_j);
438  m_ListCtrl->SetItemData(item,j);
439  m_ListCtrl->SetItemState(item,state_j,wxLIST_STATE_SELECTED);
440  }
441 
442  event.Skip();
443 }
444 
445 int wxCALLBACK DirectCompareFunction(wxIntPtr item1, wxIntPtr item2, wxIntPtr data)
446 {
447  typedef vector < pair<CBioseq_set_Handle,CSeq_entry_Handle> > vptr;
448  vptr * setseq = (vptr *)(data);
449  string a, b;
450  (*setseq)[item1].second.GetSeq().GetSeqId()->GetLabel(&a,CSeq_id::eContent);
451  (*setseq)[item2].second.GetSeq().GetSeqId()->GetLabel(&b,CSeq_id::eContent);
452 
455  if (i==0 && j==0)
456  return (a.compare(b));
457  else
458  {
459  if (i<j) return -1;
460  if (i>j) return 1;
461  }
462  return 0;
463 }
464 
465 int wxCALLBACK ReverseCompareFunction(wxIntPtr item1, wxIntPtr item2, wxIntPtr data)
466 {
467  return (-DirectCompareFunction(item1,item2,data));
468 }
469 
470 
471 void CReorderSequencesDlg::OnButtonSort( wxCommandEvent& event )
472 {
473  if (m_ReverseSort)
474  m_ListCtrl->SortItems(ReverseCompareFunction, wxIntPtr(&m_SetSeq));
475  else
476  m_ListCtrl->SortItems(DirectCompareFunction, wxIntPtr(&m_SetSeq));
477 
479 
480  if (m_ReverseSort) m_SortButton->SetBitmapLabel(m_up_bitmap);
481  else m_SortButton->SetBitmapLabel(m_down_bitmap);
482 
483 
484  event.Skip();
485 }
486 
487 static bool cmp_labels(const pair<unsigned int, pair<bool, string> >&a, const pair<unsigned int, pair<bool,string> > &b)
488 {
489  bool numeric1 = a.second.first;
490  bool numeric2 = b.second.first;
491  string str1 = a.second.second;
492  string str2 = b.second.second;
493  if (numeric1 && numeric2)
494  {
497  if (i != 0 && j != 0)
498  return (i < j);
499  }
500  return (str1 < str2);
501 }
502 
504 {
505  string genebank, general_str, general_int, local;
506  if (bsh.IsSetId())
507  for (CBioseq_Handle::TId::const_iterator it = bsh.GetId().begin(); it != bsh.GetId().end(); ++it)
508  {
509  const CSeq_id &id = *(it->GetSeqId());
510  if (id.IsGenbank() && id.GetGenbank().IsSetAccession())
511  genebank = id.GetGenbank().GetAccession();
512  if (id.IsGeneral() && id.GetGeneral().IsSetTag() && id.GetGeneral().GetTag().IsStr())
513  general_str = id.GetGeneral().GetTag().GetStr();
514  if (id.IsGeneral() && id.GetGeneral().IsSetTag() && id.GetGeneral().GetTag().IsId())
515  general_int = NStr::IntToString(id.GetGeneral().GetTag().GetId());
516  if (id.IsLocal() && id.GetLocal().IsStr())
517  local = id.GetLocal().GetStr();
518  }
519  if (!genebank.empty())
520  {
521  numeric = false;
522  return genebank;
523  }
524  if (!general_int.empty())
525  {
526  numeric = true;
527  return general_int;
528  }
529  if (!general_str.empty())
530  {
531  numeric = false;
532  return general_str;
533  }
534  numeric = true;
535  return local;
536 }
537 
539 {
540  CRef<CCmdComposite> cmd( new CCmdComposite("Reorder Sequences By Id") );
541  vector < pair<CBioseq_set_Handle,CSeq_entry_Handle> > set_seq;
542  vector<pair<unsigned int, pair<bool, string> > > list_seq;
543  ReadBioseq(*(seh.GetCompleteSeq_entry()),set_seq, seh);
544  for (unsigned int i=0; i<set_seq.size(); ++i)
545  {
546  bool numeric;
547  string label = GetIdLabel(set_seq[i].second.GetSeq(), numeric);
548  list_seq.push_back(pair<unsigned int, pair<bool, string> >(i, pair<bool, string>(numeric,label)));
549  }
550  set<CBioseq_set_Handle> uniq_bssh;
551  for (unsigned int i=0; i<set_seq.size(); ++i)
552  {
553  CBioseq_set_Handle bssh = set_seq[i].first;
554  uniq_bssh.insert(bssh);
555  }
556  sort(list_seq.begin(), list_seq.end(), cmp_labels);
557 
558  vector<int> list_index;
559  for (size_t j = 0; j < list_seq.size(); j++)
560  {
561  list_index.push_back(list_seq[j].first);
562  }
563 
564  for (set<CBioseq_set_Handle>::iterator b = uniq_bssh.begin(); b != uniq_bssh.end(); ++b)
565  {
566  CBioseq_set_Handle bssh = *b;
567  if (bssh)
568  {
569  CRef<objects::CBioseq_set> new_set(new objects::CBioseq_set());
570  new_set->Assign(*bssh.GetCompleteBioseq_set());
571  PopulateSet(bssh,*new_set, list_index, set_seq);
572  CCmdChangeBioseqSet *set_cmd = new CCmdChangeBioseqSet(bssh, *new_set);
573  cmd->AddCommand(*set_cmd);
574  }
575  }
576  return cmd;
577 }
578 
CBioseq_Handle –.
CBioseq_set_Handle –.
const CSeq_id * GetFirstId() const
Definition: Bioseq.cpp:271
bool IsNa(void) const
Definition: Bioseq.cpp:345
objects::CSeq_entry_Handle m_TopSeqEntry
void PrepareList(vector< int > &list_index)
static bool ShowToolTips()
Should we show tooltips?
static string GetIdLabel(CBioseq_Handle bsh, bool &numeric)
static void ReadBioseq(const CSeq_entry &se, vector< pair< CBioseq_set_Handle, CSeq_entry_Handle > > &setseq, CSeq_entry_Handle seh)
vector< pair< CBioseq_set_Handle, CSeq_entry_Handle > > m_SetSeq
void OnButtonDown(wxCommandEvent &event)
void OnButtonSort(wxCommandEvent &event)
void CreateControls()
Creates the controls and sizers.
static CRef< CCmdComposite > ReorderById(objects::CSeq_entry_Handle seh)
void OnButtonUp(wxCommandEvent &event)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
static void PopulateSet(CBioseq_set_Handle bssh, CBioseq_set &new_set, const vector< int > &list_index, const vector< pair< CBioseq_set_Handle, CSeq_entry_Handle > > &set_seq)
void Init()
Initialises member variables.
bool Create(wxWindow *parent, wxWindowID id=11100, const wxString &caption=_("Reorder Sequences Dialog"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
CRef< CCmdComposite > GetCommand()
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
CSeq_entry_Handle –.
Definition: Seq_entry.hpp:56
Definition: set.hpp:45
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
const_iterator begin() const
Definition: set.hpp:135
parent_type::iterator iterator
Definition: set.hpp:80
const_iterator end() const
Definition: set.hpp:136
#define _(proto)
Definition: ct_nlmzip_i.h:78
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:46
static void Init(void)
Definition: cursor6.c:76
char data[12]
Definition: iconv.c:80
#define NULL
Definition: ncbistd.hpp:225
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
@ eContent
Untagged human-readable accession or the like.
Definition: Seq_id.hpp:605
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
bool CanGetClass(void) const
TSet GetSet(void) const
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
CConstRef< CBioseq_set > GetCompleteBioseq_set(void) const
Return the complete bioseq-set object.
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id) const
Get Bioseq handle from the TSE of this Seq-entry.
CSeq_entry_Handle GetParentEntry(void) const
Return a handle for the parent seq-entry of the bioseq.
bool IsSetId(void) const
const TId & GetId(void) const
CConstRef< CBioseq_set > GetBioseq_setCore(void) const
Return core data for the bioseq-set.
#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 string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:5084
static unsigned int StringToUInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to unsigned int.
Definition: ncbistr.cpp:642
@ fConvErr_NoThrow
Do not throw an exception on error.
Definition: ncbistr.hpp:285
@ fAllowLeadingSymbols
Ignore leading non-numeric characters.
Definition: ncbistr.hpp:295
@ fAllowTrailingSymbols
Ignore trailing non-numerics characters.
Definition: ncbistr.hpp:298
static const char label[]
const TSeq & GetSeq(void) const
Get the variant data.
Definition: Seq_entry_.cpp:102
bool CanGetSeq_set(void) const
Check if it is safe to call GetSeq_set method.
TClass GetClass(void) const
Get the Class member data.
const TSet & GetSet(void) const
Get the variant data.
Definition: Seq_entry_.cpp:124
bool IsSeq(void) const
Check if variant Seq is selected.
Definition: Seq_entry_.hpp:257
void ResetSeq_set(void)
Reset Seq_set data member.
bool CanGetClass(void) const
Check if it is safe to call GetClass method.
bool IsSet(void) const
Check if variant Set is selected.
Definition: Seq_entry_.hpp:263
const TSeq_set & GetSeq_set(void) const
Get the Seq_set member data.
list< CRef< CSeq_entry > > TSeq_set
TSeq_set & SetSeq_set(void)
Assign a value to Seq_set data member.
@ eClass_nuc_prot
nuc acid and coded proteins
Definition: Bioseq_set_.hpp:99
END_EVENT_TABLE()
int i
constexpr auto sort(_Init &&init)
const struct ncbi::grid::netcache::search::fields::SIZE size
unsigned int a
Definition: ncbi_localip.c:102
static int match(register const pcre_uchar *eptr, register const pcre_uchar *ecode, const pcre_uchar *mstart, int offset_top, match_data *md, eptrblock *eptrb, unsigned int rdepth)
Definition: pcre_exec.c:513
static const char * down_xpm[]
int wxCALLBACK ReverseCompareFunction(wxIntPtr item1, wxIntPtr item2, wxIntPtr data)
int wxCALLBACK DirectCompareFunction(wxIntPtr item1, wxIntPtr item2, wxIntPtr data)
static const char * up_xpm[]
static bool cmp_labels(const pair< unsigned int, pair< bool, string > > &a, const pair< unsigned int, pair< bool, string > > &b)
#define ID_BUTTON_SORT
#define ID_BUTTON_DOWN
#define ID_BUTTON_UP
#define ID_LISTCTRL_REORDER
static static static wxID_ANY
#define FOR_EACH_SEQENTRY_ON_SEQSET(Itr, Var)
FOR_EACH_SEQENTRY_ON_SEQSET EDIT_EACH_SEQENTRY_ON_SEQSET.
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
#define local
Definition: zutil.h:33
Modified on Tue May 28 05:49:20 2024 by modify_doxy.py rev. 669887