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

Go to the SVN repository for this file.

1  /* $Id: sequester_sets.cpp 47479 2023-05-02 13:24:02Z ucko $
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 #include <sstream>
35 
36 #include <objmgr/scope.hpp>
37 #include <objmgr/seq_entry_ci.hpp>
38 #include <objmgr/seqdesc_ci.hpp>
44 #include <gui/objutils/utils.hpp>
45 #include <gui/core/document.hpp>
50 
51 #include <wx/button.h>
52 #include <wx/statbox.h>
53 #include <wx/stattext.h>
54 
55 ////@begin XPM images
56 ////@end XPM images
57 
58 
59 
61 
62 
63 
64 IMPLEMENT_DYNAMIC_CLASS( CSequesterSets, wxFrame )
65 
66 
67 /*!
68  * CSequesterSets event table definition
69  */
70 
71 BEGIN_EVENT_TABLE( CSequesterSets, wxFrame )
72 
76 
78 
79 
80 /*!
81  * CSequesterSets constructors
82  */
83 
85 {
86  Init();
87 }
88 
89 CSequesterSets::CSequesterSets( wxWindow* parent, objects::CSeq_entry_Handle seh, CConstRef<CSeq_submit> seq_submit, IWorkbench* wb,
90  wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
91 {
92  this->m_TopSeqEntry = seh;
93  this->m_SeqSubmit = seq_submit;
94  this->m_SetSeq.clear();
95  m_Workbench = wb;
96  ReadBioseq(*(this->m_TopSeqEntry.GetCompleteSeq_entry()));
97  Init();
98  Create(parent, id, caption, pos, size, style);
100 }
101 
102 
103 /*!
104  * CVectorTrimDlg creator
105  */
106 
107 bool CSequesterSets::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
108 {
109 ////@begin CSequesterSets creation
110  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
111  wxFrame::Create( parent, id, caption, pos, size, style );
112  wxVisualAttributes attr = wxPanel::GetClassDefaultAttributes();
113  if (attr.colBg != wxNullColour) {
114  SetOwnBackgroundColour(attr.colBg);
115  }
116  CreateControls();
117  if (GetSizer())
118  {
119  GetSizer()->SetSizeHints(this);
120  }
121 
122  Centre();
123 ////@end CSequesterSets creation
124 
125  return true;
126 }
127 
128 
129 /*!
130  * CSequesterSets destructor
131  */
132 
134 {
135 ////@begin CSequesterSets destruction
136 ////@end CSequesterSets destruction
137  RestoreTextView();
138 }
139 
140 
141 /*!
142  * Member initialisation
143  */
144 
146 {
147 }
148 
149 
150 /*!
151  * Control creation for CSequesterSets
152  */
153 
155 {
156 
157  CSequesterSets* itemDialog1 = this;
158 
159  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
160  itemDialog1->SetSizer(itemBoxSizer2);
161 
162  m_Notebook = new wxNotebook(itemDialog1, wxID_ANY,wxDefaultPosition,wxDefaultSize);
163  itemBoxSizer2->Add(m_Notebook, 1, wxGROW|wxALL, 5);
164 
165  CIDSubpanel *panel1 = new CIDSubpanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
166  m_Notebook->AddPage(panel1,_("ID"));
167 
168  CTextSubpanel *panel2 = new CTextSubpanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
169  m_Notebook->AddPage(panel2,_("Text"));
170 
171  CLengthSubpanel *panel3 = new CLengthSubpanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
172  m_Notebook->AddPage(panel3,_("Num Seq Length"));
173 
174  CNumSubpanel *panel4 = new CNumSubpanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
175  m_Notebook->AddPage(panel4,_("Num Sets"));
176 
177  CFileSubpanel *panel5 = new CFileSubpanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
178  m_Notebook->AddPage(panel5,_("File Name"));
179 
180  CFieldSubpanel *panel6 = new CFieldSubpanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
181  m_Notebook->AddPage(panel6,_("Field"));
182 
183  CFeatureTypeSubpanel *panel7 = new CFeatureTypeSubpanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
184  m_Notebook->AddPage(panel7,_("Feature Type"));
185 
186  CDescTypeSubpanel *panel8 = new CDescTypeSubpanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
187  m_Notebook->AddPage(panel8,_("Desc Type"));
188 
189  CMolInfoSubpanel *panel9 = new CMolInfoSubpanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
190  m_Notebook->AddPage(panel9,_("MolInfo"));
191 
192  CStructCommentSubpanel *panel10 = new CStructCommentSubpanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
193  m_Notebook->AddPage(panel10,_("Struct Comment"));
194 
195  m_SequesterButton = new wxButton( itemDialog1, ID_SEQUESTER_BUTTON, _("Sequester"), wxDefaultPosition, wxDefaultSize, 0 );
196  itemBoxSizer2->Add(m_SequesterButton, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
197 
198  wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
199  itemBoxSizer2->Add(itemBoxSizer12, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
200 
201  m_AcceptButton = new wxButton( itemDialog1, ID_ACCEPT_BUTTON, _("Accept"), wxDefaultPosition, wxDefaultSize, 0 );
202  itemBoxSizer12->Add(m_AcceptButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
203  m_AcceptButton->Disable();
204 
205  wxButton* itemButton14 = new wxButton( itemDialog1, ID_CANCEL_BUTTON, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
206  itemBoxSizer12->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
207 }
208 
209 
210 
211 /*!
212  * Should we show tooltips?
213  */
214 
216 {
217  return true;
218 }
219 
220 /*!
221  * Get bitmap resources
222  */
223 
224 wxBitmap CSequesterSets::GetBitmapResource( const wxString& name )
225 {
226  // Bitmap retrieval
227  wxUnusedVar(name);
228  return wxNullBitmap;
229 }
230 
231 /*!
232  * Get icon resources
233  */
234 
235 wxIcon CSequesterSets::GetIconResource( const wxString& name )
236 {
237  // Icon retrieval
238  wxUnusedVar(name);
239  return wxNullIcon;
240 }
241 
242 
244 {
247  view.Set("EnableDone", enable);
248 }
249 
250 void CSequesterSets::OnAccept( wxCommandEvent& event )
251 {
253  {
255  Close();
256  return;
257  }
258 
260 
261  vector<CRef<CSeq_entry> > updated_entries;
262  CSeq_entry_EditHandle eh = m_TopSeqEntry.GetEditHandle();
263  for ( CSeq_entry_I it(eh, CSeq_entry_I::fRecursive); it; ++it )
264  {
265  CSeq_entry_EditHandle entry = *it;
267  entry = entry.GetParentEntry();
268  if (entry.IsSeq() || (entry.IsSet() && entry.GetSet().IsSetClass() && entry.GetSet().GetClass() == CBioseq_set::eClass_nuc_prot) )
269  {
270  CRef<CSeq_entry> saved(new CSeq_entry);
271  saved->Assign(*entry.GetCompleteSeq_entry());
272  updated_entries.push_back(saved);
273  }
274  }
275 
276  eh.SelectNone();
277  if (m_SavedEntry->IsSeq())
278  eh.SelectSeq(m_SavedEntry->SetSeq());
279  else
280  eh.SelectSet(m_SavedEntry->SetSet());
281 
282  for (size_t i = 0; i < updated_entries.size(); i++)
283  {
284  CRef<CSeq_entry> saved = updated_entries[i];
285  if (saved->IsSeq())
286  {
287  const CBioseq& bioseq = saved->GetSeq();
288  CBioseq_Handle bsh = m_TopSeqEntry.GetScope().GetBioseqHandle(*bioseq.GetFirstId());
289  if (bsh)
290  {
293  if (bssh && bssh.IsSetClass() && bssh.GetClass() == CBioseq_set::eClass_nuc_prot)
294  seh = bssh.GetParentEntry().GetEditHandle();
295  seh.SelectNone();
296  seh.SelectSeq(saved->SetSeq());
297  }
298  }
299  else
300  {
301  const CBioseq& bioseq = saved->GetSet().GetNucFromNucProtSet();
302  CBioseq_Handle bsh = m_TopSeqEntry.GetScope().GetBioseqHandle(*bioseq.GetFirstId());
303  if (bsh)
304  {
307  if (bssh && bssh.IsSetClass() && bssh.GetClass() == CBioseq_set::eClass_nuc_prot)
308  seh = bssh.GetParentEntry().GetEditHandle();
309  seh.SelectNone();
310  seh.SelectSet(saved->SetSet());
311  }
312  }
313  }
314 
317  if (prjSrv && m_TextView)
318  {
319  prjSrv->RemoveProjectView(*m_TextView);
320  m_TextView.Reset();
321 
323  if (m_SeqSubmit)
324  objects.push_back(SConstScopedObject(m_SeqSubmit, &m_TopSeqEntry.GetScope()));
325  else
326  objects.push_back(SConstScopedObject(m_TopSeqEntry.GetCompleteSeq_entry(), &m_TopSeqEntry.GetScope()));
327  IProjectView* old_view = prjSrv->FindView(*(objects.front().object), "Text View");
328  if (!old_view)
329  old_view = prjSrv->AddProjectView("Text View", objects, GetParams());
330  }
332  Close();
333 }
334 
335 vector< vector<int> > & CSequesterSets::GetSubsets()
336 {
337  int sel = m_Notebook->GetSelection();
338  CRBSubpanel *win = dynamic_cast<CRBSubpanel*>(m_Notebook->GetPage(sel));
339  return win->GetSubsets();
340 }
341 
343 {
344  int sel = m_Notebook->GetSelection();
345  CRBSubpanel *win = dynamic_cast<CRBSubpanel*>(m_Notebook->GetPage(sel));
346  win->SetSubsets(selected);
347 }
348 
350 {
351  CRef<CUser_object> params(new CUser_object());
353  type->SetStr("TextViewParams");
354  params->SetType(*type);
355  CUser_object::TData& data = params->SetData();
356  {
357  CRef<CUser_field> param(new CUser_field());
359  label->SetStr("TextViewType");
360  param->SetLabel(*label);
361  param->SetData().SetStr("Flat File");
362  data.push_back(param);
363  }
364  {
365  CRef<CUser_field> param(new CUser_field());
367  label->SetStr("ExpandAll");
368  param->SetLabel(*label);
369  param->SetData().SetBool(true);
370  data.push_back(param);
371  }
372  {
373  CRef<CUser_field> param(new CUser_field());
375  label->SetStr("TrackSelection");
376  param->SetLabel(*label);
377  param->SetData().SetBool(true);
378  data.push_back(param);
379  }
380  return params;
381 }
382 
383 
384 void CSequesterSets::OnSequester( wxCommandEvent& event )
385 {
386  vector< vector<int> > &subsets = GetSubsets();
387 
389 
390  if (!this->m_TopSeqEntry || subsets.empty() || subsets.front().empty() || !prjSrv)
391  {
392  event.Skip();
393  return;
394  }
395 
396  // remove old view
397  {
399  if (m_SeqSubmit)
400  objects.push_back(SConstScopedObject(m_SeqSubmit, &m_TopSeqEntry.GetScope()));
401  else
402  objects.push_back(SConstScopedObject(m_TopSeqEntry.GetSeq_entryCore(), &m_TopSeqEntry.GetScope()));
403 
404  IProjectView* old_view = prjSrv->FindView(*(objects.front().object), "Text View");
405  if (old_view)
406  prjSrv->RemoveProjectView(*old_view);
407  }
408 
410 
411  set<CSeq_entry_EditHandle> selected_set;
412  for (unsigned int s = 0; s < subsets.size(); s++)
413  {
414  for ( unsigned int j = 0; j < subsets[s].size(); j++)
415  {
416  int i = subsets[s][j];
417  CSeq_entry_EditHandle entry = m_SetSeq[i].entry.GetEditHandle();
419  entry = entry.GetParentEntry();
420  selected_set.insert(entry);
421  }
422  }
423 
425  m_SavedEntry->Assign(*m_TopSeqEntry.GetCompleteSeq_entry());
426  CSeq_entry_EditHandle eh = m_TopSeqEntry.GetEditHandle();
427  for ( CSeq_entry_I it(eh, CSeq_entry_I::fRecursive); it; ++it )
428  {
429  CSeq_entry_EditHandle entry = *it;
431  entry = entry.GetParentEntry();
432  if (entry.IsSeq() || (entry.IsSet() && entry.GetSet().IsSetClass() && entry.GetSet().GetClass() == CBioseq_set::eClass_nuc_prot) )
433  {
434  if ( selected_set.find(entry) == selected_set.end() )
435  {
436  // detach it
437  entry.SelectNone();
438  // make entry as empty Bioseq-set
439  entry.SelectSet();
440  }
441  }
442  }
443 
444  // Create new Text View
445  {
447  objects.push_back(SConstScopedObject(m_TopSeqEntry.GetSeq_entryCore(), &m_TopSeqEntry.GetScope()));
448 
449  m_TextView.Reset(prjSrv->FindView(*(objects.front().object), "Text View"));
450  if (m_TextView)
451  {
452  prjSrv->ActivateProjectView(m_TextView);
453  }
454  else
455  {
456  m_TextView = prjSrv->AddProjectView("Text View", objects, GetParams());
457  }
458  }
459  m_AcceptButton->Enable();
460  m_SequesterButton->Disable();
461  EnableSmartPackageDone(false);
462 }
463 
464 void CSequesterSets::OnCancel( wxCommandEvent& event )
465 {
466  RestoreTextView();
467  Close();
468 }
469 
471 {
473  if (prjSrv && m_TextView && m_SavedEntry && m_TopSeqEntry)
474  {
475  prjSrv->RemoveProjectView(*m_TextView);
476  m_TextView.Reset();
477 
479  CSeq_entry_EditHandle eh = m_TopSeqEntry.GetEditHandle();
480  eh.SelectNone();
481  if (m_SavedEntry->IsSeq())
482  eh.SelectSeq(m_SavedEntry->SetSeq());
483  else
484  eh.SelectSet(m_SavedEntry->SetSet());
487  if (m_SeqSubmit)
488  objects.push_back(SConstScopedObject(m_SeqSubmit, &m_TopSeqEntry.GetScope()));
489  else
490  objects.push_back(SConstScopedObject(m_TopSeqEntry.GetCompleteSeq_entry(), &m_TopSeqEntry.GetScope()));
491  IProjectView* old_view = prjSrv->FindView(*(objects.front().object), "Text View");
492  if (!old_view)
493  old_view = prjSrv->AddProjectView("Text View", objects, GetParams());
494  }
496 }
497 
498 void CSequesterSets::RecursiveCollectSets(const CBioseq_set_Handle &bssh, vector<CBioseq_set_Handle> &set_vec, set<CBioseq_set_Handle> &unique_set)
499 {
500  CBioseq_set_Handle parent = bssh.GetParentBioseq_set();
501  if (bssh.IsSetClass() && bssh.GetClass() == CBioseq_set::eClass_genbank)
502  return;
503 
504  if (unique_set.find(bssh) == unique_set.end())
505  {
506  set_vec.push_back(bssh);
507  unique_set.insert(bssh);
508  }
509  if (parent)
510  RecursiveCollectSets(parent, set_vec, unique_set);
511 }
512 
514 {
515  vector<CBioseq_set_Handle> set_vec;
516  set<CBioseq_set_Handle> unique_set;
517  CSeq_entry_EditHandle eh = m_TopSeqEntry.GetEditHandle();
518  for ( CSeq_entry_I it(eh, CSeq_entry_I::fRecursive); it; ++it )
519  {
520  CSeq_entry_EditHandle entry = *it;
522  entry = entry.GetParentEntry();
523  if (entry.IsSeq() || (entry.IsSet() && entry.GetSet().IsSetClass() && entry.GetSet().GetClass() == CBioseq_set::eClass_nuc_prot) )
524  {
525  if (entry.HasParentEntry() && entry.GetParentEntry().IsSet())
526  {
527  RecursiveCollectSets(entry.GetParentEntry().GetSet(), set_vec, unique_set);
528  }
529  }
530  }
531 
532  for (long i = set_vec.size() - 1; i >= 0; i--)
533  {
535  }
536 }
537 
539 {
540  vector<CBioseq_set_Handle> set_vec;
541  set<CBioseq_set_Handle> unique_set;
542  CSeq_entry_EditHandle eh = m_TopSeqEntry.GetEditHandle();
543  for ( CSeq_entry_I it(eh, CSeq_entry_I::fRecursive); it; ++it )
544  {
545  CSeq_entry_EditHandle entry = *it;
547  entry = entry.GetParentEntry();
548  if (entry.IsSeq() || (entry.IsSet() && entry.GetSet().IsSetClass() && entry.GetSet().GetClass() == CBioseq_set::eClass_nuc_prot) )
549  {
550  if (entry.HasParentEntry() && entry.GetParentEntry().IsSet())
551  {
552  RecursiveCollectSets(entry.GetParentEntry().GetSet(), set_vec, unique_set);
553  }
554  }
555  }
556 
557  for (int i = 0; i < set_vec.size(); i++)
558  {
560  }
561 }
562 
564 {
565  if (set.IsEmptySeq_set())
566  {
567  return;
568  }
569  CConstRef<CBioseq_set> top_set = set.GetCompleteBioseq_set();
570  CRef<CSeq_descr> master(new CSeq_descr());
571  bool first = true;
572  ITERATE(CBioseq_set::TSeq_set, it, top_set->GetSeq_set())
573  {
574  if ((*it)->IsSetDescr())
575  {
576  if (first)
577  {
578  ITERATE(CSeq_descr::Tdata, d, (*it)->GetDescr().Get())
579  {
581  {
582  // add to master list
583  CRef<CSeqdesc> cpy(new CSeqdesc());
584  cpy->Assign(**d);
585  master->Set().push_back(cpy);
586  }
587  }
588  first = false;
589  }
590  else
591  {
592  // remove from master any descriptor not on member
593  CSeq_descr::Tdata::iterator d = master->Set().begin();
594  while (d != master->Set().end())
595  {
596  bool found = false;
597  ITERATE(CSeq_descr::Tdata, s, (*it)->GetDescr().Get())
598  {
599  if ((*d)->Equals(**s))
600  {
601  found = true;
602  break;
603  }
604  }
605  if (found)
606  {
607  ++d;
608  }
609  else
610  {
611  d = master->Set().erase(d);
612  }
613  }
614  }
615  }
616  else
617  {
618  master->Reset();
619  break;
620  }
621  }
622  if (master->IsSet() && !master->Set().empty())
623  {
624  // copy each descriptor to master, remove from member
626  ITERATE(CSeq_descr::Tdata, d, master->Get())
627  {
628  // remove from components
629  ITERATE(CBioseq_set::TSeq_set, it, top_set->GetSeq_set())
630  {
631  if ((*it)->IsSeq())
632  {
633  CBioseq_Handle bs = set.GetScope().GetBioseqHandle((*it)->GetSeq());
634  CBioseq_EditHandle bse(bs);
635  CBioseq::TDescr::Tdata::iterator di = bse.SetDescr().Set().begin();
636  while (di != bse.SetDescr().Set().end() && !(*di)->Equals(**d))
637  {
638  ++di;
639  }
640  if (di != bse.SetDescr().Set().end())
641  {
642  bse.RemoveSeqdesc(**di);
643  }
644  }
645  else if ((*it)->IsSet())
646  {
647  CBioseq_set_Handle bss = set.GetScope().GetBioseq_setHandle((*it)->GetSet());
648  CBioseq_set_EditHandle bsse(bss);
649  CBioseq_set::TDescr::Tdata::iterator di = bsse.SetDescr().Set().begin();
650  while (di != bsse.SetDescr().Set().end() && !(*di)->Equals(**d))
651  {
652  ++di;
653  }
654  if (di != bsse.SetDescr().Set().end())
655  {
656  bsse.RemoveSeqdesc(**di);
657  }
658  }
659  }
660  CRef<CSeqdesc> cpy(new CSeqdesc());
661  cpy->Assign(**d);
662  etop.AddSeqdesc(*cpy);
663  }
664  }
665 }
666 
667 
669 {
670  if( ! bioseq_set_h )
671  {
672  return;
673  }
674 
675  // retrieve all the CSeqdescs that we will have to copy
676  CConstRef<CSeq_descr> pSeqDescrToCopy;
677  {
678  // we have this pSeqDescrWithChosenDescs variable because
679  // we want pSeqDescrToCopy to be protected
680  // once it's set
681  CRef<CSeq_descr> pSeqDescrWithChosenDescs( new CSeq_descr );
682 
683  for(CSeqdesc_CI desc_ci( bioseq_set_h.GetParentEntry(), CSeqdesc::e_not_set, 1); desc_ci; ++desc_ci )
684  {
686  pSeqDescrWithChosenDescs->Set().push_back( CRef<CSeqdesc>( SerialClone(*desc_ci) ) );
687  }
688  pSeqDescrToCopy = pSeqDescrWithChosenDescs;
689  }
690 
691  if (!pSeqDescrToCopy->IsSet() || pSeqDescrToCopy->Get().empty())
692  return;
693 
694  // copy to all immediate children
695 
696  for(CSeq_entry_CI direct_child_ci( bioseq_set_h, CSeq_entry_CI::eNonRecursive ); direct_child_ci; ++direct_child_ci )
697  {
698  CRef<CSeq_descr> pNewDescr( SerialClone(*pSeqDescrToCopy) );
699  direct_child_ci->GetEditHandle().AddDescr(*SerialClone(*pSeqDescrToCopy) );
700  }
701 
702  // remove copied descs from the parent
703  ITERATE(CSeq_descr::Tdata, d, pSeqDescrToCopy->Get())
704  {
705  CBioseq_set_EditHandle bsse( bioseq_set_h);
706  CBioseq_set::TDescr::Tdata::iterator di = bsse.SetDescr().Set().begin();
707  while (di != bsse.SetDescr().Set().end() && !(*di)->Equals(**d))
708  {
709  ++di;
710  }
711  if (di != bsse.SetDescr().Set().end())
712  {
713  bsse.RemoveSeqdesc(**di);
714  }
715  }
716 }
717 
CBioseq_EditHandle –.
CBioseq_Handle –.
CBioseq_set_EditHandle –.
CBioseq_set_Handle –.
const CBioseq & GetNucFromNucProtSet(void) const
Definition: Bioseq_set.cpp:227
const CSeq_id * GetFirstId() const
Definition: Bioseq.cpp:271
CRegistryWriteView GetWriteView(const string &section)
get a read-write view at a particular level.
Definition: registry.cpp:462
static CGuiRegistry & GetInstance()
access the application-wide singleton
Definition: registry.cpp:400
@ ePriority_Temp_Inc
Definition: registry.hpp:49
CProjectService - a service providing API for operations with Workspaces and Projects.
static bool ShouldStayInPlace(const objects::CSeqdesc &desc)
vector< vector< int > > & GetSubsets()
void SetSubsets(const set< objects::CBioseq_Handle > &selected)
void Set(const string &key, int val)
access a named key at this level, with no recursion
Definition: reg_view.cpp:533
void ReadBioseq(const objects::CSeq_entry &se)
vector< SSetSeqRecord > m_SetSeq
objects::CSeq_entry_Handle m_TopSeqEntry
@Seq_descr.hpp User-defined methods of the data storage class.
Definition: Seq_descr.hpp:55
CSeq_entry_CI –.
CSeq_entry_Handle –.
CSeq_entry_I –.
@ fRecursive
Iterate recursively.
Definition: Seq_entry.hpp:56
CSeqdesc_CI –.
Definition: seqdesc_ci.hpp:65
CSequesterSets()
Constructors.
vector< vector< int > > & GetSubsets()
void BioseqSetDescriptorPropagateUp(objects::CBioseq_set_Handle set)
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Sequester Sets"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
IWorkbench * m_Workbench
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void RecursiveCollectSets(const objects::CBioseq_set_Handle &bssh, vector< objects::CBioseq_set_Handle > &set_vec, set< objects::CBioseq_set_Handle > &unique_set)
void OnAccept(wxCommandEvent &event)
void OnCancel(wxCommandEvent &event)
void SetSubsets(const set< objects::CBioseq_Handle > &selected)
void EnableSmartPackageDone(bool enable)
CIRef< IProjectView > m_TextView
void BioseqSetDescriptorPropagateDown(const objects::CBioseq_set_Handle &bioseq_set_h)
void Init()
Initialises member variables.
void CreateControls()
Creates the controls and sizers.
wxButton * m_AcceptButton
void RecursivePropagateUp(void)
void RecursivePropagateDown(void)
virtual ~CSequesterSets()
Destructor.
static bool ShowToolTips()
Should we show tooltips?
wxButton * m_SequesterButton
CRef< objects::CUser_object > GetParams()
void OnSequester(wxCommandEvent &event)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
wxNotebook * m_Notebook
CConstRef< objects::CSeq_submit > m_SeqSubmit
CRef< objects::CSeq_entry > m_SavedEntry
class IProjectView defines the abstract interface for views observing projects.
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
const_iterator find(const key_type &key) const
Definition: set.hpp:137
const_iterator end() const
Definition: set.hpp:136
#define _(proto)
Definition: ct_nlmzip_i.h:78
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:46
static void Init(void)
Definition: cursor6.c:76
static int type
Definition: getdata.c:31
char data[12]
Definition: iconv.c:80
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
CIRef< T > GetServiceByType()
retrieves a typed reference to a service, the name of C++ type is used as the name of the service.
Definition: service.hpp:91
vector< SConstScopedObject > TConstScopedObjects
Definition: objects.hpp:65
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
C * SerialClone(const C &src)
Create on heap a clone of the source object.
Definition: serialbase.hpp:512
void SetDescr(TDescr &v) const
TClass GetClass(void) const
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
TSet SelectSet(TClass set_class=CBioseq_set::eClass_not_set) const
Convert the empty Seq-entry to Bioseq-set.
void SetDescr(TDescr &v) const
void SelectNone(void) const
Make this Seq-entry to be empty.
TSet GetSet(void) const
bool AddSeqdesc(CSeqdesc &d) const
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
TSeq SelectSeq(CBioseq &seq) const
Make the empty Seq-entry be in seq state with specified Bioseq object.
CSeq_entry_EditHandle GetEditHandle(void) const
Get 'edit' version of handle.
CSeq_entry_Handle GetParentEntry(void) const
Return a handle for the parent seq-entry of the bioseq.
bool IsSetClass(void) const
CRef< CSeqdesc > RemoveSeqdesc(const CSeqdesc &d) const
CConstRef< CSeq_entry > GetCompleteSeq_entry(void) const
Complete and get const reference to the seq-entry.
CRef< CSeqdesc > RemoveSeqdesc(const CSeqdesc &d) const
bool IsSet(void) const
CSeq_entry_EditHandle GetParentEntry(void) const
Get parent seq-entry edit handle.
bool HasParentEntry(void) const
Check if current seq-entry has a parent.
bool IsSeq(void) const
@ eNonRecursive
Deprecated.
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#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 const char label[]
TData & SetData(void)
Assign a value to Data data member.
void SetLabel(TLabel &value)
Assign a value to Label data member.
void SetType(TType &value)
Assign a value to Type data member.
void SetData(TData &value)
Assign a value to Data data member.
vector< CRef< CUser_field > > TData
const TSeq & GetSeq(void) const
Get the variant data.
Definition: Seq_entry_.cpp:102
TSet & SetSet(void)
Select the variant.
Definition: Seq_entry_.cpp:130
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
const TSeq_set & GetSeq_set(void) const
Get the Seq_set member data.
list< CRef< CSeq_entry > > TSeq_set
TSeq & SetSeq(void)
Select the variant.
Definition: Seq_entry_.cpp:108
@ eClass_nuc_prot
nuc acid and coded proteins
Definition: Bioseq_set_.hpp:99
@ eClass_genbank
converted genbank
list< CRef< CSeqdesc > > Tdata
Definition: Seq_descr_.hpp:91
const Tdata & Get(void) const
Get the member data.
Definition: Seq_descr_.hpp:166
bool IsSet(void) const
Check if a value has been assigned to data member.
Definition: Seq_descr_.hpp:154
Tdata & Set(void)
Assign a value to data member.
Definition: Seq_descr_.hpp:172
void Reset(void)
Reset data member.
Definition: Seq_descr_.cpp:51
@ e_not_set
No variant selected.
Definition: Seqdesc_.hpp:110
END_EVENT_TABLE()
int i
void ReportUsage(const wxString &dialog_name)
Report opening & accepting events in the editing package.
const struct ncbi::grid::netcache::search::fields::SIZE size
static static static wxID_ANY
#define ID_SEQUESTER_BUTTON
#define ID_CANCEL_BUTTON
#define ID_ACCEPT_BUTTON
Definition: type.c:6
Modified on Tue Apr 23 07:37:23 2024 by modify_doxy.py rev. 669887