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

Go to the SVN repository for this file.

1 /* $Id: submission_wizard.cpp 46622 2021-08-06 20:19:47Z 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: Andrea Asztalos
27  */
28 
29 
30 
31 #include <ncbi_pch.hpp>
32 #include <objects/seq/Pubdesc.hpp>
35 #include <objects/seq/Seqdesc.hpp>
42 #include <objects/pub/Pub.hpp>
45 #include <objects/seq/Pubdesc.hpp>
58 
59  // for importing/exporting templates
60 #include <util/format_guess.hpp>
62 #include <serial/objistr.hpp>
67 #include <objects/seq/Bioseq.hpp>
71 #include <objects/seq/MolInfo.hpp>
75 #include <gui/objutils/label.hpp>
76 #include <objmgr/bioseq_ci.hpp>
77 #include <objmgr/seqdesc_ci.hpp>
83 #include <gui/objutils/utils.hpp>
85 
86 #include <gui/core/document.hpp>
94 
95 
96 #include <wx/sizer.h>
97 #include <wx/statline.h>
98 #include <wx/notebook.h>
99 #include <wx/button.h>
100 #include <wx/icon.h>
101 #include <wx/settings.h>
102 #include <wx/filedlg.h>
103 #include <wx/utils.h>
104 #include <wx/filename.h>
105 #include <wx/msgdlg.h>
106 #include <wx/cshelp.h>
107 #include <wx/utils.h>
108 #include <wx/uri.h>
109 #include <wx/hyperlink.h>
112 
114 {
115 public:
116  CRaiseWindowTask(wxWindow *win) : m_Win(win) {}
117 protected:
118  wxWindow* m_Win;
120  {
121  m_Win->Raise();
122  m_Win->SetFocus();
123  return eCompleted;
124  }
125 };
126 
127 
128 /*!
129  * CSubmissionWizard type definition
130  */
131 
132 IMPLEMENT_DYNAMIC_CLASS(CSubmissionWizard, wxFrame)
133 
134 
135 /*!
136  * CSubmissionWizard event table definition
137  */
138 
139 BEGIN_EVENT_TABLE(CSubmissionWizard, wxFrame)
140  EVT_BUTTON(ID_CSUBMISSIONCONTBTN, CSubmissionWizard::OnContinuebtnClick)
141  EVT_BUTTON(ID_CSUBMISSIONBACKBTN, CSubmissionWizard::OnBackbtnClick)
142  EVT_NOTEBOOK_PAGE_CHANGED(ID_CSUBMISSIONNOTEBOOK, CSubmissionWizard::OnPageChanged)
143  EVT_NOTEBOOK_PAGE_CHANGING(ID_CSUBMISSIONNOTEBOOK, CSubmissionWizard::OnPageChanging)
144  EVT_BUTTON( ID_SUBMITTER_EXPORT, CSubmissionWizard::ExportTemplate )
145  EVT_BUTTON( ID_SUBMITTER_IMPORT, CSubmissionWizard::ImportTemplate )
146  EVT_HYPERLINK(wxID_HELP, CSubmissionWizard::OnHelp)
148 
150  ON_EVENT(CProjectViewEvent, CViewEvent::eProjectChanged, &CSubmissionWizard::OnDataChanged)
152 
153 /*!
154  * CSubmissionWizard constructors
155  */
156 
158 {
159  Init();
160 }
161 
163  wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
164  : m_Workbench(wb), m_ProjectHandle(ph), m_ProjectItem(pi)
165 {
166  Init();
167  Create(parent, id, caption, pos, size, style);
168  ConnectListener();
170 }
171 
173 {
174  m_SeqSubmit.Reset();
175  m_Seh.Reset();
178 
179  CScope* scope = m_ProjectHandle->GetScope();
180  if (m_SeqSubmit)
181  {
182  if (m_SeqSubmit->IsSetData() && m_SeqSubmit->GetData().IsEntrys())
183  {
184  for (auto entry : m_SeqSubmit->GetData().GetEntrys())
185  {
186  if (entry)
187  {
188  CSeq_entry_Handle seh = scope->GetSeq_entryHandle(*entry);
189  if (seh)
190  {
191  m_Seh = seh.GetTopLevelEntry();
192  break;
193  }
194  }
195  }
196  }
197  }
199  {
201  if (seh)
202  m_Seh = seh.GetTopLevelEntry();
203  }
204 }
205 
207 {
208  CGBDocument* doc = dynamic_cast<CGBDocument*>(m_ProjectHandle.GetPointer());
209  if (doc)
210  {
211  m_CmdProcessor = &doc->GetUndoManager();
212  m_WorkDir = doc->GetWorkDir();
213  }
214 }
215 
216 
217 /*!
218  * CSubmissionWizard creator
219  */
220 
221 bool CSubmissionWizard::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
222 {
223 ////@begin CSubmissionWizard creation
224  SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY | wxWS_EX_BLOCK_EVENTS);
225  wxFrame::Create( parent, id, caption, pos, size, style );
226 
227  CreateControls();
228  if (GetSizer())
229  {
230  GetSizer()->SetSizeHints(this);
231  }
232  Centre();
233 ////@end CSubmissionWizard creation
234  return true;
235 }
236 
237 
238 /*!
239  * CSubmissionWizard destructor
240  */
241 
243 {
244 ////@begin CSubmissionWizard destruction
245 ////@end CSubmissionWizard destruction
247  m_Instance = NULL;
248 }
249 
250 
251 /*!
252  * Member initialisation
253  */
254 
256 {
257  m_Notebook = NULL;
258  m_Backbtn = NULL;
263  m_OrgPanel = NULL;
269  m_IsBusy = false;
270  m_WorkDir = wxGetHomeDir();
275 }
276 
277 /*!
278  * Control creation for CSubmissionWizard
279  */
280 
282 {
283  wxBoxSizer* itemBoxSizer1 = new wxBoxSizer(wxVERTICAL);
284  SetSizer(itemBoxSizer1);
285 
286  wxPanel* itemPanel1 = new wxPanel(this, wxID_ANY);
287  itemBoxSizer1->Add(itemPanel1, 1, wxGROW | wxALL, 0);
288 
289  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
290  itemPanel1->SetSizer(itemBoxSizer2);
291 
292  m_Notebook = new wxNotebook(itemPanel1, ID_CSUBMISSIONNOTEBOOK, wxDefaultPosition, wxDefaultSize, wxBK_DEFAULT /*wxNB_TOP */);
293  itemBoxSizer2->Add(m_Notebook, 1, wxGROW | wxALL, 0);
294 
296  m_Notebook->AddPage(m_SubmitterPanel, "Submitter");
297 
299  m_Notebook->AddPage(m_GeneralPanel, "General");
300 
302  m_Notebook->AddPage(m_GenomePanel, "Genome info");
303 
305  m_Notebook->AddPage(m_OrgPanel, "Organism info");
306 
308  m_Notebook->AddPage(m_MoleculePanel, "Molecule info");
309 
311  m_Notebook->AddPage(m_AnnotationPanel, "Annotation");
312 
314  m_Notebook->AddPage(m_ReferencePanel, "Reference");
315 
317  m_Notebook->AddPage(m_ValidatePanel, "Validation");
318 
319  wxStaticLine* itemStaticLine29 = new wxStaticLine(itemPanel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL);
320  itemBoxSizer2->Add(itemStaticLine29, 0, wxGROW | wxALL, 5);
321 
322  m_BottomSizer = new wxBoxSizer(wxHORIZONTAL);
323  itemBoxSizer2->Add(m_BottomSizer, 0, wxGROW | wxTOP | wxBOTTOM, 5);
324 
325  m_Backbtn = new wxButton(itemPanel1, ID_CSUBMISSIONBACKBTN, _("&Back"), wxDefaultPosition, wxDefaultSize, 0);
326  m_BottomSizer->Add(m_Backbtn, 0, wxALIGN_CENTER_VERTICAL | wxRESERVE_SPACE_EVEN_IF_HIDDEN |wxALL, 5);
327 
328  m_BottomSizer->AddStretchSpacer();
329 
330  wxButton* itemButton4 = new wxButton( itemPanel1, ID_SUBMITTER_IMPORT, _("Import from template"), wxDefaultPosition, wxDefaultSize, 0 );
331  m_BottomSizer->Add(itemButton4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
332 
333 
334  m_BottomSizer->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
335 
336  wxButton* itemButton6 = new wxButton( itemPanel1, ID_SUBMITTER_EXPORT, _("Export to template"), wxDefaultPosition, wxDefaultSize, 0 );
337  m_BottomSizer->Add(itemButton6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
338 
339  m_BottomSizer->AddStretchSpacer();
340 
341  wxHyperlinkCtrl* itemHyperlinkCtrl = new wxHyperlinkCtrl( itemPanel1, wxID_HELP, _("Help"), wxT(""), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
342  itemHyperlinkCtrl->SetForegroundColour(wxColour(192, 192, 192));
343  m_BottomSizer->Add(itemHyperlinkCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
344 
345  m_ContinueBtn = new wxButton(itemPanel1, ID_CSUBMISSIONCONTBTN, _("&Continue"), wxDefaultPosition, wxDefaultSize, 0);
346  m_BottomSizer->Add(m_ContinueBtn, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
347 
349 
351 }
352 
354 {
355  m_BottomSizer->Show(m_Backbtn, false);
356  wxColour bg_color = wxSystemSettings::GetColour(wxSYS_COLOUR_FRAMEBK);
357  m_Notebook->SetBackgroundColour(bg_color);
358  for (size_t i = 0; i < m_Notebook->GetPageCount(); ++i) {
359  m_Notebook->GetPage(i)->SetBackgroundColour(bg_color);
360  }
361 }
362 
363 
365 {
368  string version_str = "Genome Workbench ";
369  version_str += NStr::IntToString(version.GetVer_major());
370  version_str += ".";
371  version_str += NStr::IntToString(version.GetVer_minor());
372  version_str += ".";
373  version_str += NStr::IntToString(version.GetVer_patch());
374  version_str += " " + wxGetOsDescription().ToStdString();
375  m_SubmitBlock->SetTool(version_str);
376 }
377 
379 {
380  auto& cit_sub = m_SubmitBlock->SetCit();
381  if (!cit_sub.IsSetDate()) {
382  CRef<CDate> today(new CDate);
384  cit_sub.SetDate(*today);
385  }
386 }
387 
388 
390 {
392  if (m_SeqSubmit && m_SeqSubmit->IsSetSub()) {
393  m_SubmitBlock->Assign(m_SeqSubmit->GetSub());
394  }
395 }
396 
397 
399 {
407 }
408 
409 
411 {
412  bool found_pub = false;
413  for (auto& it : m_Descriptors) {
420  if (!found_pub & it->IsPub()) {
422  found_pub = true;
423  }
424  }
425 }
426 
427 namespace {
428  CRef<CPub> MakeEmptyRefPub()
429  {
430  CRef<CPub> citgen(new CPub());
431  citgen->SetGen().SetCit("unpublished");
432  return citgen;
433  }
434 
435  bool s_IsCitSubPub(const CSeqdesc& desc)
436  {
437  if (desc.IsPub() && desc.GetPub().IsSetPub() && desc.GetPub().GetPub().IsSet() &&
438  !desc.GetPub().GetPub().Get().empty() &&
439  desc.GetPub().GetPub().Get().front()->IsSub()) {
440  return true;
441  }
442  return false;
443  }
444 
445  bool IsReferencePub(const CSeqdesc& seqdesc)
446  {
447  if (!seqdesc.IsPub()) {
448  return false;
449  }
450  const CPubdesc& pubdesc = seqdesc.GetPub();
451  if (pubdesc.IsSetPub() && pubdesc.GetPub().IsSet() &&
452  !pubdesc.GetPub().Get().empty() &&
453  (pubdesc.GetPub().Get().front()->IsGen() || pubdesc.GetPub().Get().front()->IsArticle())) {
454  return true;
455  }
456  return false;
457  }
458 
459  bool s_AddStringToField(const string& val, CUser_field& field) {
460  if (field.GetData().IsStr()) {
461  string old_val = field.GetData().GetStr();
462  if (NStr::Equal(old_val, val)) {
463  // nothing to do, already here
464  return false;
465  }
466  else {
467  field.SetData().SetStrs().push_back(old_val);
468  field.SetData().SetStrs().push_back(val);
469  return true;
470  }
471  }
472  else if (field.GetData().IsStrs()) {
473  for (auto s : field.GetData().GetStrs()) {
474  if (NStr::Equal(s, val)) {
475  // already here
476  return false;
477  }
478  }
479  field.SetData().SetStrs().push_back(val);
480  return true;
481  }
482  else {
483  return false;
484  }
485  }
486 
487  bool IsEmptyAuthor(const CAuthor& author) {
488  if (author.IsSetAffil()) {
489  return false;
490  }
491  else if (!author.IsSetName()) {
492  return true;
493  }
494  else if (author.GetName().IsName()) {
495  const CName_std& name_std = author.GetName().GetName();
496  if (!name_std.IsSetLast()) {
497  return true;
498  }
499  else if (NStr::Equal(name_std.GetLast(), "?")) {
500  return true;
501  }
502  else {
503  return false;
504  }
505  }
506  else {
507  return false;
508  }
509  }
510 
511  bool IsEmptyRefPub(const CPub& pub)
512  {
513  if (!pub.IsGen()) {
514  return false;
515  }
516  if (!pub.GetGen().IsSetAuthors()) {
517  return true;
518  }
519  const CAuth_list& auth_list = pub.GetGen().GetAuthors();
520  if (!auth_list.IsSetNames() || auth_list.GetNames().Which() == CAuth_list::TNames::e_not_set) {
521  return true;
522  }
523  else if (!auth_list.GetNames().IsStd()) {
524  if (auth_list.GetNames().GetStd().empty()) {
525  return true;
526  }
527  for (auto it : auth_list.GetNames().GetStd()) {
528  if (IsEmptyAuthor(*it)) {
529  // doesn't count
530  }
531  else {
532  return false;
533  }
534  }
535  }
536  return true;
537  }
538 
539  bool s_IsEmptyStructuredComment(const CUser_object& user)
540  {
541  if (!user.IsSetData() || user.GetData().empty()) {
542  return true;
543  }
544  for (auto it : user.GetData()) {
545  if (it->IsSetLabel()
546  && it->GetLabel().IsStr()
547  && (NStr::Equal(it->GetLabel().GetStr(), "StructuredCommentPrefix") ||
548  NStr::Equal(it->GetLabel().GetStr(), "StructuredCommentSuffix"))) {
549  // doesn't count if it's a prefix or suffix
550  }
551  else {
552  return false;
553  }
554  }
555  return true;
556  }
557 
558 
559  bool s_IsEmptySource(const CBioSource& src)
560  {
561  if (src.IsSetSubtype() && !src.GetSubtype().empty()) {
562  return false;
563  }
564  if (!src.IsSetOrg()) {
565  return true;
566  }
567  const COrg_ref& org = src.GetOrg();
568  if (org.IsSetTaxname() && !org.GetTaxname().empty()) {
569  return false;
570  }
571  if (org.IsSetOrgname() && org.GetOrgname().IsSetMod() &&
572  !org.GetOrgname().GetMod().empty()) {
573  return false;
574  }
575  return true;
576  }
577 }
578 
579 
581 {
582  m_Descriptors.clear();
583 
584  // add DBLink
585  CRef<CSeqdesc> dblink(new CSeqdesc());
587  m_Descriptors.push_back(dblink);
588 
589  // add assembly-data
590  m_AssemblyPrefix = "Genome-Assembly-Data";
591  CRef<CSeqdesc> assembly(new CSeqdesc());
592  CRef<CUser_object> user = edit::CStructuredCommentField::MakeUserObject(m_AssemblyPrefix);
593  assembly->SetUser().Assign(*user);
594  m_Descriptors.push_back(assembly);
595 
596  // add BioSource
597  CRef<CSeqdesc> biosrc(new CSeqdesc());
598  biosrc->SetSource();
599  m_Descriptors.push_back(biosrc);
600 
601  // add reference pub
602  CRef<CSeqdesc> pub(new CSeqdesc());
603  pub->SetPub().SetPub().Set().push_back(MakeEmptyRefPub());
604  m_Descriptors.push_back(pub);
605 
606  bool first_ref_pub = true;
607  if (m_SeqSubmit && m_SeqSubmit->IsSetData() && m_SeqSubmit->GetData().IsEntrys()) {
608  // search for descriptors in Seq-submit.data
609  x_ExtractDescriptorsFromSeqEntry(*(m_SeqSubmit->GetData().GetEntrys().front()), first_ref_pub);
610  } else if (m_Seh) {
611  // search for descriptors in Seq-entry
612  x_ExtractDescriptorsFromSeqEntry(*(m_Seh.GetCompleteSeq_entry()), first_ref_pub);
613  }
614 
615 }
616 
617 
618 /*!
619  * Should we show tooltips?
620  */
621 
623 {
624  return true;
625 }
626 
627 /*!
628  * Get bitmap resources
629  */
630 
631 wxBitmap CSubmissionWizard::GetBitmapResource( const wxString& name )
632 {
633  // Bitmap retrieval
634 ////@begin CSubmissionWizard bitmap retrieval
635  wxUnusedVar(name);
636  return wxNullBitmap;
637 ////@end CSubmissionWizard bitmap retrieval
638 }
639 
640 /*!
641  * Get icon resources
642  */
643 
644 wxIcon CSubmissionWizard::GetIconResource( const wxString& name )
645 {
646  // Icon retrieval
647 ////@begin CSubmissionWizard icon retrieval
648  wxUnusedVar(name);
649  return wxNullIcon;
650 ////@end CSubmissionWizard icon retrieval
651 }
652 
653 /*
654  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CSUBMISSIONCONTBTN
655  */
656 
657 void CSubmissionWizard::OnContinuebtnClick(wxCommandEvent& event)
658 {
659  GetSize(&m_Width, &m_Height);
660  if (x_ValidateCurrentPage()) {
661  ApplyCommand();
662  x_StepForward();
663  SetSize(wxSize(m_Width, m_Height));
664  }
665 }
666 
667 /*
668  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CSUBMISSIONBACKBTN
669  */
670 
671 void CSubmissionWizard::OnBackbtnClick( wxCommandEvent& event )
672 {
673  GetSize(&m_Width, &m_Height);
674  ApplyCommand();
675  x_StepBackward();
676  SetSize(wxSize(m_Width, m_Height));
677 }
678 
679 void CSubmissionWizard::OnPageChanging(wxBookCtrlEvent& event)
680 {
681  ApplyCommand();
682 }
683 
684 void CSubmissionWizard::OnPageChanged(wxBookCtrlEvent& event)
685 {
686  wxWindow* wnd = m_Notebook->GetPage(event.GetSelection());
687  UpdateOnPageChange(wnd);
688 }
689 
690 static void restoreRecursivelyAllToolTips(wxWindow *win)
691 {
692  if (!win)
693  return;
694 
695  wxString tooltip = win->GetToolTipText();
696  win->UnsetToolTip();
697  if (!tooltip.IsEmpty())
698  win->SetToolTip(tooltip);
699 
700  for (auto child : win->GetChildren())
702 }
703 
704 void CSubmissionWizard::UpdateOnPageChange(wxWindow* current_page)
705 {
706  if (!current_page) return;
707  ISubmissionPage* current = dynamic_cast<ISubmissionPage*>(current_page);
708  GetSize(&m_Width, &m_Height);
709  LOG_POST(Info << "Page changed to: " << ToStdString(current->GetName()));
710 
711  if (current && m_Backbtn && m_ContinueBtn) {
712  if (current->IsFirstPage()) {
713  m_BottomSizer->Show(m_Backbtn, false);
714  }
715  else if (current->IsLastPage()) {
716  m_ContinueBtn->SetLabel("Finish");
717  }
718  else {
719  m_BottomSizer->Show(m_Backbtn, true);
720  m_ContinueBtn->SetLabel("Continue");
721  }
722  SetSize(wxSize(m_Width, m_Height));
723  }
724 #ifdef __WXMAC__
725  restoreRecursivelyAllToolTips(current_page);
726 #endif
727 }
728 
730 {
731  return TransferDataFromWindow();
732 }
733 
735 {
736  wxWindow* wnd = m_Notebook->GetCurrentPage();
737  ISubmissionPage* current = dynamic_cast<ISubmissionPage*>(wnd);
738  if (current) {
739  if (current->IsLastPage()) {
740  if (SaveFile())
741  {
743  LOG_POST(Info << "Submission wizard file saved");
744  Close();
745  }
746  return;
747  }
748 
749  bool stepped = current->StepForward();
750  if (!stepped) {
751  int page = m_Notebook->GetSelection();
752  if (page != wxNOT_FOUND) {
753  m_Notebook->ChangeSelection(++page);
754  stepped = true;
755  }
756  }
757  if (stepped) {
758  m_BottomSizer->Show(m_Backbtn, true);
759  wnd = m_Notebook->GetCurrentPage();
760  current = dynamic_cast<ISubmissionPage*>(wnd);
761  if (current) {
762  LOG_POST(Info << "x_StepForward(): " << ToStdString(current->GetName()));
763  if (current->IsLastPage()) {
764  m_ContinueBtn->SetLabel("Finish");
765  }
766  }
767  }
768  }
769  else {
770  LOG_POST(Error << "CSubmissionWizard::x_StepForward(): All pages of submission wizard should derive from ISubmissionPage");
771  }
772 }
773 
775 {
776  wxWindow* wnd = m_Notebook->GetCurrentPage();
777  ISubmissionPage* current = dynamic_cast<ISubmissionPage*>(wnd);
778  if (current) {
779  if (current->IsFirstPage()) {
780  // this should never be true
781  return;
782  }
783 
784  bool stepped = current->StepBackward();
785  if (!stepped) {
786  int page = m_Notebook->GetSelection();
787  if (page != wxNOT_FOUND) {
788  m_Notebook->ChangeSelection(--page);
789  stepped = true;
790  }
791 
792  }
793  if (stepped) {
794  m_ContinueBtn->SetLabel("Continue");
795  wnd = m_Notebook->GetCurrentPage();
796  current = dynamic_cast<ISubmissionPage*>(wnd);
797  if (current) {
798  LOG_POST(Info << "x_StepBackward(): " << ToStdString(current->GetName()));
799  if (current->IsFirstPage()) {
800  m_BottomSizer->Show(m_Backbtn, false);
801  }
802  }
803  }
804  }
805  else {
806  LOG_POST(Error << "CSubmissionWizard::x_StepBackward(): All pages of submission wizard should derive from ISubmissionPage");
807  }
808 }
809 
810 
812 {
813  if (!m_SubmitBlock) {
815  }
816  m_SubmitBlock->Assign(block);
817 }
818 
819 void CSubmissionWizard::ExtractDescriptor(const CSeqdesc& desc, bool first_pub = false)
820 {
821  // Figure out if this descriptor should be added or should replace one we already have
822  bool found = false;
823  bool first_pub_in_list = true;
824  CRef<CSeqdesc> add(NULL);
825  for (auto& it : m_Descriptors) {
826  if (it->Which() == desc.Which()) {
827  if (it->IsUser()) {
828  if (it->GetUser().IsSetType() && desc.GetUser().IsSetType() && it->GetUser().GetType().Equals(desc.GetUser().GetType())) {
829  found = true;
830  it->Assign(desc);
831  add = it;
832  break;
833  }
834  } else if (it->IsPub()) {
835  if (first_pub_in_list && first_pub) {
836  found = true;
837  it->Assign(desc);
838  add = it;
839  break;
840  } else if (it->GetPub().Equals(desc.GetPub())) {
841  // don't add if identical
842  found = true;
843  add = it;
844  break;
845  }
846  first_pub_in_list = false;
847  } else {
848  // TODO - are there any other descriptors of the same type that we could have multiples of?
849  found = true;
850  it->Assign(desc);
851  add = it;
852  break;
853  }
854  }
855  }
856  if (!found) {
857  add.Reset(new CSeqdesc());
858  add->Assign(desc);
859  m_Descriptors.push_back(add);
860  }
861 }
862 
863 
864 unique_ptr<CObjectIStream> xCreateASNStream(CFormatGuess::EFormat format, unique_ptr<istream>& instream)
865 {
866  // guess format
867  ESerialDataFormat eSerialDataFormat = eSerial_None;
868  { {
870  format = CFormatGuess::Format(*instream);
871 
872  switch (format) {
874  eSerialDataFormat = eSerial_AsnBinary;
875  break;
878  eSerialDataFormat = eSerial_AsnText;
879  break;
880  case CFormatGuess::eXml:
881  eSerialDataFormat = eSerial_Xml;
882  break;
883  default:
884  wxMessageBox(_("Descriptor file seems to be in an unsupported format: ") + wxString(CFormatGuess::GetFormatName(format)));
885  return unique_ptr<CObjectIStream>(nullptr);
886  break;
887  }
888 
889  //instream.seekg(0);
890  }}
891 
892  unique_ptr<CObjectIStream> pObjIstrm(
893  CObjectIStream::Open(eSerialDataFormat, *instream, eTakeOwnership));
894 
895  instream.release();
896 
897  return pObjIstrm;
898 }
899 
900 
901 // This is looking for the following:
902 // a source descriptor
903 // a DBLink User-object descriptor
904 // structured comment descriptors
905 // publications
906 void CSubmissionWizard::x_ExtractDescriptors(const CSeq_descr& descr, bool& first_ref_pub)
907 {
908  if (!descr.IsSet()) {
909  return;
910  }
911  for (auto it : descr.Get()) {
912  if (it->IsSource()) {
913  ExtractDescriptor(*it);
914  }
915  else if (it->IsUser()) {
916  ExtractDescriptor(*it);
917  }
918  else if (it->IsPub()) {
919  bool is_reference_pub = first_ref_pub && IsReferencePub(*it);
920  ExtractDescriptor(*it, first_ref_pub);
921  if (is_reference_pub) {
922  first_ref_pub = false;
923  }
924  }
925  }
926 }
927 
928 
930 {
931  if (entry.IsSeq()) {
932  if (entry.GetSeq().IsSetDescr()) {
933  x_ExtractDescriptors(entry.GetSeq().GetDescr(), first_ref_pub);
934  }
935  } else if (entry.IsSet()) {
936  const CBioseq_set& set = entry.GetSet();
937  if (set.IsSetDescr()) {
938  x_ExtractDescriptors(set.GetDescr(), first_ref_pub);
939  }
940  if (set.IsSetSeq_set()) {
941  // Use first element of set only
942  for (auto entry : set.GetSeq_set()) {
943  x_ExtractDescriptorsFromSeqEntry(*entry, first_ref_pub);
944  if (entry->IsSeq() && entry->GetSeq().IsNa())
945  break;
946  }
947  }
948  }
949 }
950 
951 
952 void CSubmissionWizard::ImportTemplate( wxCommandEvent& event )
953 {
954  wxFileDialog asn_open_file(this, wxT("Import from file"), m_WorkDir, wxEmptyString,
955  _("SBT files (*.sbt)|*.sbt|") +
958  wxFD_OPEN | wxFD_FILE_MUST_EXIST);
959 
960  if (asn_open_file.ShowModal() == wxID_OK)
961  {
962  wxString path = asn_open_file.GetPath();
963  if (!path.IsEmpty())
964  {
965  //m_WorkDir = wxFileName::DirName(path).GetPath();
966  CNcbiIfstream istr(path.fn_str());
967  unique_ptr<istream> instream(new CNcbiIfstream(path.fn_str()));
968  unique_ptr<CObjectIStream> pObjIstrm = xCreateASNStream(CFormatGuess::eUnknown, instream);
969  if (!pObjIstrm)
970  return;
971 
972  // guess object type
973  string sType = pObjIstrm->ReadFileHeader();
974 
975  // templates can come in many forms
976  if (sType == CSubmit_block::GetTypeInfo()->GetName()) {
977  CRef<CSubmit_block> block(new CSubmit_block());
978  pObjIstrm->Read(ObjectInfo(*block), CObjectIStream::eNoFileHeader);
979  ApplySubmitBlock(*block);
980  } else if (sType == CSeq_submit::GetTypeInfo()->GetName()) {
981  CRef<CSeq_submit> submit(new CSeq_submit());
982  pObjIstrm->Read(ObjectInfo(*submit), CObjectIStream::eNoFileHeader);
983  ApplySubmitBlock(submit->GetSub());
984  if (submit->IsSetData() && submit->GetData().IsEntrys() && !submit->GetData().GetEntrys().empty()) {
985  bool first_ref_pub = true;
986  x_ExtractDescriptorsFromSeqEntry(*(submit->GetData().GetEntrys().front()), first_ref_pub);
987  }
988  } else if (sType == CSeq_entry::GetTypeInfo()->GetName()) {
989  CRef<CSeq_entry> entry(new CSeq_entry());
990  pObjIstrm->Read(ObjectInfo(*entry), CObjectIStream::eNoFileHeader);
991  bool first_ref_pub = true;
992  x_ExtractDescriptorsFromSeqEntry(*entry, first_ref_pub);
993  }
994 
995  // read in Seqdescs
996  if (!pObjIstrm->EndOfData())
997  {
998  if (sType != CSeqdesc::GetTypeInfo()->GetName())
999  sType = pObjIstrm->ReadFileHeader();
1000 
1001  bool first_ref_pub = true;
1002 
1003  while (sType == CSeqdesc::GetTypeInfo()->GetName()) {
1004  CRef<CSeqdesc> desc(new CSeqdesc);
1005  pObjIstrm->Read(ObjectInfo(*desc), CObjectIStream::eNoFileHeader);
1006 
1007  bool is_reference_pub = first_ref_pub && IsReferencePub(*desc);
1008  ExtractDescriptor(*desc, desc->IsPub() ? first_ref_pub : false);
1009  if (is_reference_pub) {
1010  first_ref_pub = false;
1011  }
1012 
1013  if (pObjIstrm->EndOfData())
1014  break;
1015 
1016  try {
1017  sType = pObjIstrm->ReadFileHeader();
1018  }
1019  catch (CEofException&) {
1020  break;
1021  }
1022  }
1023  }
1024  }
1025  }
1026 
1027  CRef<CCmdComposite> cmd(new CCmdComposite("import template"));
1028  bool any_changes = false;
1029 
1030  // apply descriptors to record
1031  for (auto it : m_Descriptors) {
1032  any_changes |= x_ApplyDescriptorToRecord(*it, *cmd);
1033  }
1034  if (any_changes) {
1036  }
1037 
1039 }
1040 
1041 
1043 {
1044  // m_SubmitterPanel->SetSeqEntryHandle(m_Seh); // no need
1048 
1053 }
1054 
1055 
1057 {
1058  if (!m_SubmitBlock->IsSetContact() ||
1059  !m_SubmitBlock->GetContact().IsSetContact() ||
1060  !m_SubmitBlock->GetContact().GetContact().IsSetName() ||
1061  !m_SubmitBlock->GetContact().GetContact().GetName().IsName() ||
1062  !m_SubmitBlock->GetContact().GetContact().GetName().GetName().IsSetLast())
1063  return;
1064  if (!m_SubmitBlock->IsSetCit() ||
1065  !m_SubmitBlock->GetCit().IsSetAuthors() ||
1066  !m_SubmitBlock->GetCit().GetAuthors().IsSetNames() ||
1067  m_SubmitBlock->GetCit().GetAuthors().GetNames().Which() == CAuth_list::C_Names::e_not_set)
1068  return;
1069 
1070  if (!m_Seh)
1071  return;
1072 
1073  if (m_SeqSubmit && m_SeqSubmit->IsSetSub() && m_SeqSubmit->GetSub().Equals(m_SubmitBlock.GetNCObject()))
1074  return;
1075 
1076  x_SetTool();
1078 
1079  if (m_SeqSubmit && m_SeqSubmit->IsSetSub())
1080  {
1082  CObject* actual = (CObject*) &m_SeqSubmit->GetSub();
1083  cmd->Add(actual, CConstRef<CObject>(m_SubmitBlock));
1085  }
1086  else
1087  {
1088  CConstRef<CSeq_entry> entry = m_Seh.GetCompleteSeq_entry();
1090  copy->Assign(*entry);
1091 
1092  CRef<CSeq_submit> submission(new CSeq_submit);
1093  submission->SetSub(m_SubmitBlock.GetNCObject());
1094  submission->SetData().SetEntrys().push_back(copy);
1095 
1096  CGBDocument* doc = dynamic_cast<CGBDocument*>(m_ProjectHandle.GetPointer());
1097 
1098  CRef<CProjectItem> new_item(new CProjectItem);
1099  new_item->SetDescr().assign(m_ProjectItem->GetDescr().begin(), m_ProjectItem->GetDescr().end());
1100  new_item->SetItem().SetSubmit(*submission);
1101 
1102  if (m_ProjectItem->IsSetLabel())
1103  new_item->SetLabel(m_ProjectItem->GetLabel());
1104  else
1105  {
1106  string label;
1108  new_item->SetLabel(label);
1109  }
1110 
1112  m_ProjectItem = new_item;
1113  m_CmdProcessor->Execute(chg);
1114  }
1115 }
1116 
1118 {
1119  if (!m_IsBusy)
1120  {
1121  wxBeginBusyCursor();
1122  m_IsBusy = true;
1123  }
1124 }
1125 
1127 {
1128  bool rval = false;
1129  if (desc.IsSource()) {
1130  rval = x_ApplySourceDescriptorToRecord(desc.GetSource(), cmd); \
1131  } else if (desc.IsUser()) {
1133  rval = x_ApplyUserDescriptorToRecord(desc.GetUser(), false, cmd);
1134  } else {
1135  rval = x_ApplyUserDescriptorToRecord(desc.GetUser(), true, cmd);
1136  }
1137  } else if (desc.IsMolinfo()) {
1138  rval = x_ApplyMolinfoToRecords(desc, cmd);
1139  } else {
1140  bool already_has = false;
1141  if (m_Seh.IsSetDescr() && m_Seh.GetDescr().IsSet()) {
1142  for (auto di : m_Seh.GetDescr().Get()) {
1143  if (di->Equals(desc)) {
1144  already_has = true;
1145  break;
1146  }
1147  }
1148  }
1149  if (!already_has) {
1150  CRef<CSeqdesc> new_desc(new CSeqdesc());
1151  new_desc->Assign(desc);
1152  CIRef<IEditCommand> cmdAddDesc(new CCmdCreateDesc(m_Seh, *new_desc));
1153  cmd.AddCommand(*cmdAddDesc);
1154  rval = true;
1155  }
1156  }
1157  return rval;
1158 }
1159 
1160 
1162 {
1163  bool any_changes = false;
1164 
1165  for (CBioseq_CI bi(m_Seh, CSeq_inst::eMol_na); bi; ++bi) {
1167  if (di) {
1168  // edit existing descriptor
1169  CRef<CSeqdesc> cpy(new CSeqdesc());
1170  cpy->Assign(*di);
1171  if (src.IsSetOrg()) {
1172  cpy->SetSource().SetOrg().Assign(src.GetOrg());
1173  }
1175  if (!di->GetSource().Equals(cpy->GetSource())) {
1177  cmd.AddCommand(*chg);
1178  any_changes = true;
1179  }
1180  } else {
1181  // create new source descriptor on this sequence or on the nuc-prot that contains it
1182  CRef<CSeqdesc> new_desc(new CSeqdesc());
1183  new_desc->SetSource().Assign(src);
1184  CBioseq_set_Handle parent = bi->GetParentBioseq_set();
1185  if (parent && parent.IsSetClass() && parent.GetClass() == CBioseq_set::eClass_nuc_prot) {
1186  CIRef<IEditCommand> cmdAddDesc(new CCmdCreateDesc(parent.GetParentEntry(), *new_desc));
1187  cmd.AddCommand(*cmdAddDesc);
1188  }
1189  else {
1190  CIRef<IEditCommand> cmdAddDesc(new CCmdCreateDesc(bi->GetParentEntry(), *new_desc));
1191  cmd.AddCommand(*cmdAddDesc);
1192  }
1193  any_changes = true;
1194  }
1195  }
1196  return any_changes;
1197 }
1198 
1199 
1201 {
1202  // only add or replace subsources, and only add subsources that are not chromosome or plasmid name
1203  if (!src.IsSetSubtype()) {
1204  return;
1205  }
1206  std::unordered_map <CSubSource::TSubtype, bool> found_first;
1207  for (auto sit : src.GetSubtype()) {
1208  if (sit->IsSetSubtype() && sit->IsSetName() &&
1209  sit->GetSubtype() != CSubSource::eSubtype_plasmid_name &&
1210  sit->GetSubtype() != CSubSource::eSubtype_chromosome) {
1211  auto findit = found_first.find(sit->GetSubtype());
1212  if (findit != found_first.end()) {
1213  // already found one of these and deleted all after the first, just add
1214  CRef<CSubSource> cpy(new CSubSource());
1215  cpy->Assign(*sit);
1216  dst.SetSubtype().push_back(cpy);
1217  } else {
1218  // replace first copy found and remove all other values
1219  bool found = false;
1220  auto dit = dst.SetSubtype().begin();
1221  while (dit != dst.SetSubtype().end()) {
1222  if ((*dit)->IsSetSubtype() && (*dit)->GetSubtype() == sit->GetSubtype()) {
1223  if (found) {
1224  // already have one, remove the others
1225  dit = dst.SetSubtype().erase(dit);
1226  } else {
1227  // replace value for this one
1228  found = true;
1229  (*dit)->SetName(sit->GetName());
1230  dit++;
1231  }
1232  } else {
1233  dit++;
1234  }
1235  }
1236  if (!found) {
1237  // add a new value
1238  CRef<CSubSource> cpy(new CSubSource());
1239  cpy->Assign(*sit);
1240  dst.SetSubtype().push_back(cpy);
1241  }
1242  found_first[sit->GetSubtype()] = true;
1243  }
1244  }
1245  }
1246 }
1247 
1248 
1250 {
1251  bool any_changes = false;
1252  for (CBioseq_CI bi(m_Seh, mol); bi; ++bi) {
1253  CRef<CSeqdesc> new_desc(new CSeqdesc());
1254  new_desc->Assign(desc);
1255  CSeqdesc_CI di(*bi, desc.Which());
1256  if (di) {
1257  // edit existing descriptor
1258  if (!di->Equals(desc)) {
1259  CRef<CCmdChangeSeqdesc> chg(new CCmdChangeSeqdesc(di.GetSeq_entry_Handle(), *di, *new_desc));
1260  cmd.AddCommand(*chg);
1261  any_changes = true;
1262  }
1263  } else {
1264  // create new descriptor on this sequence
1265  CIRef<IEditCommand> cmdAddDesc(new CCmdCreateDesc(bi->GetParentEntry(), *new_desc));
1266  cmd.AddCommand(*cmdAddDesc);
1267  any_changes = true;
1268  }
1269  }
1270  return any_changes;
1271 }
1272 
1273 
1275 {
1276  if (!desc.IsMolinfo()) {
1277  return false;
1278  }
1279  const CMolInfo& molinfo = desc.GetMolinfo();
1280  bool any_changes = false;
1281  if (molinfo.IsSetBiomol() && molinfo.GetBiomol() == CMolInfo::eBiomol_peptide) {
1282  // apply to proteins
1284  } else {
1285  // apply to nucleotides
1287  }
1288  return any_changes;
1289 }
1290 
1291 
1293 {
1294  bool any_changes = false;
1295  bool found_any = false;
1296  if (!user.IsSetType()) {
1297  // reject
1298  return false;
1299  }
1300 
1301  for (CBioseq_CI bi(m_Seh, CSeq_inst::eMol_na); bi; ++bi) {
1302  bool found = false;
1303  for (CSeqdesc_CI di(*bi, CSeqdesc::e_User); di; ++di) {
1304  const CUser_object& this_user = di->GetUser();
1305  if (this_user.IsSetType() && this_user.GetType().Equals(user.GetType())) {
1307  // merge
1308  CRef<CSeqdesc> cpy(new CSeqdesc());
1309  cpy->SetUser().Assign(this_user);
1310  bool merge = x_MergeDBLink(user, cpy->SetUser());
1311  if (merge) {
1312  CRef<CCmdChangeSeqdesc> chg(new CCmdChangeSeqdesc(di.GetSeq_entry_Handle(), *di, *cpy));
1313  cmd.AddCommand(*chg);
1314  any_changes = true;
1315  }
1316  found = true;
1318  string template_prefix = CComment_rule::GetStructuredCommentPrefix(user);
1319  string this_prefix = CComment_rule::GetStructuredCommentPrefix(this_user);
1320  if (NStr::Equal(template_prefix, this_prefix)) {
1321  found = true;
1322  }
1323  } else {
1324  // don't overwrite
1325  found = true;
1326  }
1327  break;
1328  }
1329  }
1330  if (!found && !add_to_set) {
1331  // create new descriptor on this sequence or on the nuc-prot that contains it
1332  CRef<CSeqdesc> new_desc(new CSeqdesc());
1333  new_desc->SetUser().Assign(user);
1334  CBioseq_set_Handle parent = bi->GetParentBioseq_set();
1335  if (parent && parent.IsSetClass() && parent.GetClass() == CBioseq_set::eClass_nuc_prot) {
1336  CIRef<IEditCommand> cmdAddDesc(new CCmdCreateDesc(parent.GetParentEntry(), *new_desc));
1337  cmd.AddCommand(*cmdAddDesc);
1338  } else {
1339  CIRef<IEditCommand> cmdAddDesc(new CCmdCreateDesc(bi->GetParentEntry(), *new_desc));
1340  cmd.AddCommand(*cmdAddDesc);
1341  }
1342  any_changes = true;
1343  } else if (found) {
1344  found_any = true;
1345  }
1346  }
1347  if (!found_any && add_to_set && !s_IsEmptyStructuredComment(user)) {
1348  CRef<CSeqdesc> new_desc(new CSeqdesc());
1349  new_desc->SetUser().Assign(user);
1350  CIRef<IEditCommand> cmdAddDesc(new CCmdCreateDesc(m_Seh, *new_desc));
1351  cmd.AddCommand(*cmdAddDesc);
1352  any_changes = true;
1353  }
1354  return any_changes;
1355 }
1356 
1357 bool CSubmissionWizard::x_MergeDBLink(const CUser_object& template_user, CUser_object& existing_user)
1358 {
1359  if (!template_user.IsSetData()) {
1360  return false;
1361  }
1362  bool any_change = false;
1363  for (auto t_it : template_user.GetData()) {
1364  if (t_it->IsSetLabel() && t_it->IsSetData() && (t_it->GetData().IsStr() || t_it->GetData().IsStrs())) {
1365  bool found = false;
1366  for (auto& e_it : existing_user.SetData()) {
1367  if (e_it->IsSetLabel() && e_it->GetLabel().Equals(t_it->GetLabel())) {
1368  if (t_it->GetData().IsStr()) {
1369  any_change |= s_AddStringToField(t_it->GetData().GetStr(), *e_it);
1370  } else {
1371  for (auto s : t_it->GetData().GetStrs()) {
1372  any_change |= s_AddStringToField(s, *e_it);
1373  }
1374  }
1375  }
1376  }
1377  }
1378  }
1379  return any_change;
1380 }
1381 
1382 void CSubmissionWizard::ExportTemplate( wxCommandEvent& event )
1383 {
1384  ApplyCommand();
1385 
1386  // make a few changes before exporting
1387  // if authors empty, need to put in dummy name or cannot save ASN.1
1388  if (!m_SubmitBlock->IsSetCit() || !m_SubmitBlock->GetCit().IsSetAuthors() ||
1389  !m_SubmitBlock->GetCit().GetAuthors().IsSetNames() ||
1390  (m_SubmitBlock->GetCit().GetAuthors().GetNames().IsStd() &&
1391  !m_SubmitBlock->GetCit().GetAuthors().GetNames().GetStd().front()->GetName().GetName().IsSetLast())) {
1392  if (m_SubmitBlock->IsSetContact() && m_SubmitBlock->GetContact().IsSetContact()) {
1393  CRef<CAuthor> copy(new CAuthor());
1394  copy->Assign(m_SubmitBlock->GetContact().GetContact());
1395  m_SubmitBlock->SetCit().SetAuthors().SetNames().SetStd().push_back(copy);
1396  } else {
1397  m_SubmitBlock->SetCit().SetAuthors().SetNames().SetStr().push_back("?");
1398  }
1399  }
1400 
1401 
1402  wxFileDialog asn_save_file(this, wxT("Export to file"), m_WorkDir, wxEmptyString,
1403  _("SBT files (*.sbt)|*.sbt|") +
1406  wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
1407 
1408  if (asn_save_file.ShowModal() == wxID_OK)
1409  {
1410  wxString path = asn_save_file.GetPath();
1411  if (!path.IsEmpty())
1412  {
1413  //m_WorkDir = wxFileName::DirName(path).GetPath();
1414  ios::openmode mode = ios::out;
1415  CNcbiOfstream os(path.fn_str(), mode);
1416  os << MSerial_AsnText;
1417 
1418  os << m_SubmitBlock;
1419  for (auto it : m_Descriptors) {
1420  if (it->IsUser()) {
1421  // only write out if it has fields
1422  // and is not an empty structured comment
1423  const CUser_object& user = it->GetUser();
1424  if (user.IsSetData() && !user.GetData().empty() &&
1425  !s_IsEmptyStructuredComment(user)) {
1426  os << it;
1427  }
1428  }
1429  else if (it->IsSource()) {
1430  // only write out if non-empty
1431  if (!s_IsEmptySource(it->GetSource())) {
1432  os << it;
1433  }
1434  } else if (it->IsPub()) {
1435  // only write out if non-empty
1436  const CPubdesc& pub = it->GetPub();
1437  if (pub.IsSetPub() && pub.GetPub().IsSet() && !pub.GetPub().Get().empty() &&
1438  !IsEmptyRefPub(*(pub.GetPub().Get().front()))) {
1439  os << it;
1440  }
1441  } else {
1442  os << it;
1443  }
1444  }
1445  }
1446  }
1447 
1448 }
1449 
1451 
1453  CRef<CGBProjectHandle> ph, CRef<CProjectItem> pi, wxWindowID id,
1454  const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
1455 {
1456  if (!m_Instance)
1457  {
1458  m_Instance = new CSubmissionWizard(parent, wb, ph, pi, id, caption, pos, size, style);
1459  m_Instance->Show(true);
1460  LOG_POST(Info << "Opened the submission wizard");
1461  }
1462  else
1463  {
1464  m_Instance->Refresh();
1465  }
1467  return m_Instance;
1468 }
1469 
1470 
1472 {
1473  CGBDocument* doc = dynamic_cast<CGBDocument*>(m_ProjectHandle.GetPointer());
1474  if (!doc)
1475  return;
1476  doc->AddListener(this);
1477 }
1478 
1479 
1481 {
1482  CGBDocument* doc = dynamic_cast<CGBDocument*>(m_ProjectHandle.GetPointer());
1483  if (!doc)
1484  return;
1485  doc->RemoveListener(this);
1486 }
1487 
1489 {
1490  if (!evt)
1491  return;
1492  CProjectViewEvent *prj_evt = dynamic_cast<CProjectViewEvent*>(evt);
1493  if (!prj_evt)
1494  return;
1495  switch (prj_evt->GetSubtype())
1496  {
1502  Refresh();
1503  //RaiseWindow();
1504  break;
1506  Close();
1507  break;
1508  default:
1509  break;
1510  }
1511 }
1512 
1514 {
1518  for (size_t i = 0; i < m_Notebook->GetPageCount(); ++i) {
1519  m_Notebook->GetPage(i)->TransferDataToWindow();
1520  }
1521 
1522  return true;
1523 }
1524 
1526 {
1527  if (m_IsBusy)
1528  {
1529  wxEndBusyCursor();
1530  m_IsBusy = false;
1531  }
1532 }
1533 
1535 {
1536  wxWindow *win = m_Notebook->GetCurrentPage();
1537  if (!win)
1538  return;
1539  ISubmissionPage* page = dynamic_cast<ISubmissionPage*>(win);
1540  if (!page)
1541  return;
1542  page->ApplyCommand();
1543 }
1544 
1545 void CSubmissionWizard::OnHelp( wxHyperlinkEvent& event )
1546 {
1547  wxWindow *win = m_Notebook->GetCurrentPage();
1548  if (!win)
1549  return;
1550  ISubmissionPage* page = dynamic_cast<ISubmissionPage*>(win);
1551  if (!page)
1552  return;
1553 
1554  wxString anchor = page->GetAnchor();
1555  if (anchor.IsEmpty())
1556  return;
1557 
1558  wxURI help_url (wxT("https://www.ncbi.nlm.nih.gov/tools/gbench/manual6/#") + anchor);
1559  wxString help_encoded_url = help_url.BuildURI();
1560  wxLaunchDefaultBrowser(help_encoded_url, 0); // wxBROWSER_NEW_WINDOW
1561 }
1562 
1563 
1565 {
1566  if (!m_Seh)
1567  {
1568  wxMessageBox (_("Unable to find submission data"));
1569  return false;
1570  }
1571 
1573  if (m_SeqSubmit)
1574  {
1575  so = m_SeqSubmit;
1576  }
1577  else
1578  {
1579  int answer = wxMessageBox (_("You need to add contact information before submitting to GenBank - save incomplete file?"),
1580  _("Save Incomplete File"), wxYES_NO | wxICON_QUESTION);
1581  if (answer == wxYES)
1582  {
1583  so = m_Seh.GetCompleteSeq_entry();
1584  }
1585  }
1586  if (!so)
1587  return false;
1588  if (ReportMissingFields())
1589  return false;
1590 
1591  try {
1592  CRef<CCmdComposite> cleanup_cmd = CleanupCommand(m_Seh, true, false);
1593  if (cleanup_cmd)
1594  m_CmdProcessor->Execute(cleanup_cmd);
1595  }
1596  catch (const CException& e) {
1597  LOG_POST(Error << "Cleanup command failed: " << e.GetMsg());
1598  }
1599 
1600  wxFileDialog asn_save_file(this, wxT("Save Submission File"), m_WorkDir, wxEmptyString,
1603  wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
1604 
1605  if (asn_save_file.ShowModal() == wxID_OK)
1606  {
1607  wxString path = asn_save_file.GetPath();
1608  if( !path.IsEmpty())
1609  {
1610  ios::openmode mode = ios::out;
1611  CNcbiOfstream os(path.fn_str(), mode);
1612  os << MSerial_AsnText;
1613  os << *so;
1614  return true;
1615  }
1616  }
1617  return false;
1618 }
1619 
1621 {
1622  string text;
1623  for (size_t i = 0; i < m_Notebook->GetPageCount(); ++i)
1624  {
1625  wxWindow* win = m_Notebook->GetPage(i);
1626  ISubmissionPage* page = dynamic_cast<ISubmissionPage*>(win);
1627  page->ReportMissingFields(text);
1628  }
1629  if (text.empty())
1630  return false;
1631  wxString msg;
1632  msg << "The following fields are missing.\n";
1633  msg << "This file should not be submitted to GenBank without this information.\n";
1634  msg << text;
1635  CGenericReportDlg* report = new CGenericReportDlg(NULL);
1636  report->SetTitle(wxT("Missing Fields"));
1637  report->SetText(msg);
1638  report->Show(true);
1639  return true;
1640 }
1641 
1643 {
1645  CRaiseWindowTask* task = new CRaiseWindowTask(this);
1646  taskService->AddTask(*task);
1647 }
1648 
1650 
1651 
1652 
1653 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CAppTaskService - Application Task Service.
CAppTask - default implementation of IAppTask, use it as a base class for custom tasks.
@Auth_list.hpp User-defined methods of the data storage class.
Definition: Auth_list.hpp:57
CAuthor –.
Definition: Author.hpp:59
CBioseq_CI –.
Definition: bioseq_ci.hpp:69
CBioseq_set_Handle –.
bool IsNa(void) const
Definition: Bioseq.cpp:345
static string GetStructuredCommentPrefix(const CUser_object &user, bool normalize=true)
Definition: Date.hpp:53
void SetToTime(const CTime &time, EPrecision prec=ePrecision_second)
Definition: Date.cpp:57
@ ePrecision_day
Definition: Date.hpp:58
CEventHandler.
CEvent - generic event implementation TODO TODO - Attachments.
Definition: event.hpp:86
static wxString GetDialogFilter(EFileType fileType)
EFormat
The formats are checked in the same order as declared here.
@ eBinaryASN
Binary ASN.1.
@ eUnknown
unknown format
@ eTextASN
Text ASN.1.
static const char * GetFormatName(EFormat format)
static EFormat Format(const string &path, EOnError onerror=eDefault)
Guess file format.
CGBDocument.
Definition: document.hpp:113
wxString GetWorkDir() const
Definition: document.cpp:1364
CUndoManager & GetUndoManager()
Definition: document.hpp:158
virtual CScope * GetScope() const
virtual void ApplySubmitBlock(objects::CSubmit_block &block)
virtual void ApplyDescriptor(objects::CSeqdesc &desc)
virtual void SetSeqEntryHandle(objects::CSeq_entry_Handle seh)
void SetText(const wxString &text)
virtual void ApplyDescriptor(objects::CSeqdesc &desc)
virtual void SetSeqEntryHandle(objects::CSeq_entry_Handle seh)
@Name_std.hpp User-defined methods of the data storage class.
Definition: Name_std.hpp:56
CObject –.
Definition: ncbiobj.hpp:180
virtual void ApplyDescriptor(objects::CSeqdesc &desc)
virtual void SetSeqEntryHandle(objects::CSeq_entry_Handle seh)
CProjectViewEvent.
Definition: document.hpp:62
EEventSubtype GetSubtype() const
Definition: document.hpp:96
Definition: Pub.hpp:56
@Pubdesc.hpp User-defined methods of the data storage class.
Definition: Pubdesc.hpp:54
CRaiseWindowTask(wxWindow *win)
virtual IAppTask::ETaskState x_Run()
override this function in derived classes
virtual void ApplySubmitBlock(objects::CSubmit_block &block)
virtual void SetSeqEntryHandle(objects::CSeq_entry_Handle seh)
virtual void ApplyDescriptor(objects::CSeqdesc &desc)
CScope –.
Definition: scope.hpp:92
@Seq_descr.hpp User-defined methods of the data storage class.
Definition: Seq_descr.hpp:55
CSeq_entry_Handle –.
Definition: Seq_entry.hpp:56
CSeqdesc_CI –.
Definition: seqdesc_ci.hpp:65
virtual void SetSeqEntryHandle(objects::CSeq_entry_Handle seh)
virtual void SetSeqEntryHandle(objects::CSeq_entry_Handle seh)
void SetProjectItem(objects::CProjectItem *pi)
~CSubmissionWizard()
Destructor.
virtual void UpdateOnPageChange(wxWindow *current_page)
void OnPageChanging(wxBookCtrlEvent &event)
CSubmitterPanel * m_SubmitterPanel
COrganismInfoPanel * m_OrgPanel
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void OnDataChanged(CEvent *evt)
void CreateControls()
Creates the controls and sizers.
void x_ExtractDescriptorsFromSeqEntry(const objects::CSeq_entry &entry, bool &first_ref_pub)
CGenomeInfoPanel * m_GenomePanel
CRef< objects::CSubmit_block > m_SubmitBlock
CConstRef< objects::CSeq_submit > m_SeqSubmit
void ImportTemplate(wxCommandEvent &event)
virtual void ApplySubmitCommand()
static CSubmissionWizard * GetInstance(wxWindow *parent, IWorkbench *wb, CRef< CGBProjectHandle > ph, CRef< CProjectItem > pi, wxWindowID id=ID_CSUBMISSIONWIZARD, const wxString &caption=_("Submission Wizard"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(650, 548), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxCLOSE_BOX)
vector< CRef< objects::CSeqdesc > > m_Descriptors
bool x_ApplyMolinfoToRecords(const objects::CSeqdesc &desc, CCmdComposite &cmd)
void OnBackbtnClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CSUBMISSIONBACKBTN
wxBoxSizer * m_BottomSizer
void OnHelp(wxHyperlinkEvent &event)
void OnPageChanged(wxBookCtrlEvent &event)
void Init()
Initialises member variables.
void ApplySubmitBlock(const objects::CSubmit_block &block)
CSubmissionWizard()
Constructors.
void x_ExtractDescriptors(const objects::CSeq_descr &descr, bool &first_ref_pub)
void OnContinuebtnClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CSUBMISSIONCONTBTN
static CSubmissionWizard * m_Instance
bool x_ApplyDescriptorToRecord(const objects::CSeqdesc &desc, CCmdComposite &cmd)
ICommandProccessor * m_CmdProcessor
bool x_ApplySourceDescriptorToRecord(const objects::CBioSource &src, CCmdComposite &cmd)
bool Create(wxWindow *parent, wxWindowID id=ID_CSUBMISSIONWIZARD, const wxString &caption=_("Submission Wizard"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(650, 548), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxCLOSE_BOX)
Creation.
static bool ShowToolTips()
Should we show tooltips?
bool x_MergeDBLink(const objects::CUser_object &template_user, objects::CUser_object &existing_user)
bool x_ApplyOrReplaceDescriptorToRecord(const objects::CSeqdesc &desc, CCmdComposite &cmd, objects::CSeq_inst::TMol mol)
CRef< CProjectItem > m_ProjectItem
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void ExtractDescriptor(const objects::CSeqdesc &desc, bool first_pub)
CRef< CGBProjectHandle > m_ProjectHandle
CSubAnnotationPanel * m_AnnotationPanel
CReferencePanel * m_ReferencePanel
void ExportTemplate(wxCommandEvent &event)
virtual bool TransferDataToWindow()
bool x_ApplyUserDescriptorToRecord(const objects::CUser_object &user, bool add_to_set, CCmdComposite &cmd)
void x_TransferImportedSubSources(const objects::CBioSource &src, objects::CBioSource &dst)
CSubValidateDiscPanel * m_ValidatePanel
CGeneralPanel * m_GeneralPanel
objects::CSeq_entry_Handle m_Seh
CSubMolinfoPanel * m_MoleculePanel
CSubmit_block –.
virtual void ApplySubmitBlock(objects::CSubmit_block &block)
void SetObjectType(EObjectType obj_type)
@ eObjectType_StructuredComment
EObjectType GetObjectType() const
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
virtual bool IsLastPage() const
virtual bool IsFirstPage() const
virtual void ReportMissingFields(string &text)
virtual void ApplyDescriptor(objects::CSeqdesc &desc)
virtual wxString GetName() const
virtual void ApplySubmitBlock(objects::CSubmit_block &block)
virtual wxString GetAnchor()
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
Definition: set.hpp:45
#define _(proto)
Definition: ct_nlmzip_i.h:78
CChangeUnindexedObjectCommand< objects::CSubmit_block > CChangeSubmitBlockCommand
std::ofstream out("events_result.xml")
main entry point for tests
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
static void Init(void)
Definition: cursor6.c:76
void GetGBenchVersionInfo(size_t &ver_major, size_t &ver_minor, size_t &ver_patch_level, CTime &build_date)
@ eTakeOwnership
An object can take ownership of another.
Definition: ncbi_types.h:136
#define NULL
Definition: ncbistd.hpp:225
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
Definition: ncbidiag.hpp:226
void Error(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1197
const string & GetMsg(void) const
Get message string.
Definition: ncbiexpt.cpp:461
void Info(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1185
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
void AddTask(IAppTask &task)
Add a task to the queue.
ETaskState
List of task states defining the task management FSM.
Definition: app_task.hpp:87
@ eCompleted
successfully finished
Definition: app_task.hpp:92
const float pi
Definition: math.hpp:54
virtual void RemoveListener(CEventHandler *listener)
Remove a listener.
static void GetLabel(const CObject &obj, string *label, ELabelType type=eDefault)
Definition: label.cpp:140
#define ON_EVENT(type, id, handler)
#define END_EVENT_MAP()
Ends definition of Command Map.
#define BEGIN_EVENT_MAP(thisClass, baseClass)
Begins definition of Command Map for CEventHandler-derived class.
virtual void AddListener(CEventHandler *listener, int pool_name=ePool_Default)
Add a listener.
@ eDefault
Definition: label.hpp:73
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define MSerial_AsnText
I/O stream manipulators –.
Definition: serialbase.hpp:696
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
ESerialDataFormat
Data file format.
Definition: serialdef.hpp:71
@ eSerial_AsnText
ASN.1 text.
Definition: serialdef.hpp:73
@ eSerial_Xml
XML.
Definition: serialdef.hpp:75
@ eSerial_None
Definition: serialdef.hpp:72
@ eSerial_AsnBinary
ASN.1 binary.
Definition: serialdef.hpp:74
pair< TObjectPtr, TTypeInfo > ObjectInfo(C &obj)
Definition: objectinfo.hpp:762
static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)
Create serial object reader and attach it to an input stream.
Definition: objistr.cpp:195
CSeq_entry_Handle GetSeq_entryHandle(CDataLoader *loader, const TBlobId &blob_id, EMissing action=eMissing_Default)
Get Seq-entry handle by its blob-id, with possible loading.
Definition: scope.cpp:113
@ eMissing_Null
Definition: scope.hpp:157
TClass GetClass(void) const
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
CSeq_entry_Handle GetParentEntry(void) const
Return a handle for the parent seq-entry of the bioseq.
bool IsSetClass(void) const
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Definition: seqdesc_ci.cpp:326
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:1439
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
TObjectType & GetNCObject(void) const
Get object.
Definition: ncbiobj.hpp:1187
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
Definition: ncbistre.hpp:500
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
Definition: ncbistre.hpp:439
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:5084
static bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
Definition: ncbistr.hpp:5384
CTime CurrentTime(CTime::ETimeZone tz=CTime::eLocal, CTime::ETimeZonePrecision tzp=CTime::eTZPrecisionDefault)
Definition: ncbitime.hpp:2184
static const char label[]
bool IsSetAuthors(void) const
Check if a value has been assigned to Authors data member.
Definition: Cit_gen_.hpp:623
const TAuthors & GetAuthors(void) const
Get the Authors member data.
Definition: Cit_gen_.hpp:635
bool IsSetAffil(void) const
Check if a value has been assigned to Affil data member.
Definition: Author_.hpp:464
const TName & GetName(void) const
Get the Name member data.
Definition: Author_.hpp:352
bool IsSetNames(void) const
Check if a value has been assigned to Names data member.
Definition: Auth_list_.hpp:464
bool IsSetName(void) const
Author, Primary or Secondary Check if a value has been assigned to Name data member.
Definition: Author_.hpp:340
const TNames & GetNames(void) const
Get the Names member data.
Definition: Auth_list_.hpp:478
const TStd & GetStd(void) const
Get the variant data.
Definition: Auth_list_.hpp:410
E_Choice Which(void) const
Which variant is currently selected.
Definition: Auth_list_.hpp:375
bool IsStd(void) const
Check if variant Std is selected.
Definition: Auth_list_.hpp:404
@ e_not_set
No variant selected.
Definition: Auth_list_.hpp:112
const TSubtype & GetSubtype(void) const
Get the Subtype member data.
Definition: BioSource_.hpp:539
bool IsSetOrg(void) const
Check if a value has been assigned to Org data member.
Definition: BioSource_.hpp:497
bool IsSetSubtype(void) const
Check if a value has been assigned to Subtype data member.
Definition: BioSource_.hpp:527
const TOrg & GetOrg(void) const
Get the Org member data.
Definition: BioSource_.hpp:509
void SetOrg(TOrg &value)
Assign a value to Org data member.
Definition: BioSource_.cpp:108
TSubtype & SetSubtype(void)
Assign a value to Subtype data member.
Definition: BioSource_.hpp:545
bool IsSetItem(void) const
Check if a value has been assigned to Item data member.
bool IsSetLabel(void) const
user-defined label Check if a value has been assigned to Label data member.
TDescr & SetDescr(void)
Assign a value to Descr data member.
bool IsSubmit(void) const
Check if variant Submit is selected.
void SetLabel(const TLabel &value)
Assign a value to Label data member.
const TLabel & GetLabel(void) const
Get the Label member data.
const TItem & GetItem(void) const
Get the Item member data.
const TDescr & GetDescr(void) const
Get the Descr member data.
bool IsEntry(void) const
Check if variant Entry is selected.
void SetItem(TItem &value)
Assign a value to Item data member.
const TEntry & GetEntry(void) const
Get the variant data.
const TSubmit & GetSubmit(void) const
Get the variant data.
const TStr & GetStr(void) const
Get the variant data.
bool IsSetData(void) const
the object itself Check if a value has been assigned to Data data member.
bool IsSetType(void) const
type of object within class Check if a value has been assigned to Type data member.
bool IsStrs(void) const
Check if variant Strs is selected.
const TStrs & GetStrs(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
bool IsName(void) const
Check if variant Name is selected.
Definition: Person_id_.hpp:359
bool IsStr(void) const
Check if variant Str is selected.
bool IsSetLast(void) const
Check if a value has been assigned to Last data member.
Definition: Name_std_.hpp:410
TData & SetData(void)
Assign a value to Data data member.
const TData & GetData(void) const
Get the Data member data.
void SetData(TData &value)
Assign a value to Data data member.
const TType & GetType(void) const
Get the Type member data.
const TLast & GetLast(void) const
Get the Last member data.
Definition: Name_std_.hpp:422
const TName & GetName(void) const
Get the variant data.
Definition: Person_id_.cpp:137
const TMod & GetMod(void) const
Get the Mod member data.
Definition: OrgName_.hpp:839
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
Definition: Org_ref_.hpp:372
bool IsSetMod(void) const
Check if a value has been assigned to Mod data member.
Definition: OrgName_.hpp:827
bool IsSetOrgname(void) const
Check if a value has been assigned to Orgname data member.
Definition: Org_ref_.hpp:529
bool IsSetTaxname(void) const
preferred formal name Check if a value has been assigned to Taxname data member.
Definition: Org_ref_.hpp:360
const TOrgname & GetOrgname(void) const
Get the Orgname member data.
Definition: Org_ref_.hpp:541
bool IsSet(void) const
Check if a value has been assigned to data member.
Definition: Pub_equiv_.hpp:153
const Tdata & Get(void) const
Get the member data.
Definition: Pub_equiv_.hpp:165
const TGen & GetGen(void) const
Get the variant data.
Definition: Pub_.cpp:167
bool IsGen(void) const
Check if variant Gen is selected.
Definition: Pub_.hpp:584
const TSeq & GetSeq(void) const
Get the variant data.
Definition: Seq_entry_.cpp:102
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
bool IsSet(void) const
Check if variant Set is selected.
Definition: Seq_entry_.hpp:263
@ eClass_nuc_prot
nuc acid and coded proteins
Definition: Bioseq_set_.hpp:99
const TUser & GetUser(void) const
Get the variant data.
Definition: Seqdesc_.cpp:384
bool IsMolinfo(void) const
Check if variant Molinfo is selected.
Definition: Seqdesc_.hpp:1196
void SetPub(TPub &value)
Assign a value to Pub data member.
Definition: Pubdesc_.cpp:72
TPub & SetPub(void)
Select the variant.
Definition: Seqdesc_.cpp:362
const TSource & GetSource(void) const
Get the variant data.
Definition: Seqdesc_.cpp:566
const TPub & GetPub(void) const
Get the variant data.
Definition: Seqdesc_.cpp:356
bool IsSource(void) const
Check if variant Source is selected.
Definition: Seqdesc_.hpp:1190
bool IsSetBiomol(void) const
Check if a value has been assigned to Biomol data member.
Definition: MolInfo_.hpp:422
const Tdata & Get(void) const
Get the member data.
Definition: Seq_descr_.hpp:166
TSource & SetSource(void)
Select the variant.
Definition: Seqdesc_.cpp:572
bool IsSetDescr(void) const
descriptors Check if a value has been assigned to Descr data member.
Definition: Bioseq_.hpp:303
bool IsSet(void) const
Check if a value has been assigned to data member.
Definition: Seq_descr_.hpp:154
TBiomol GetBiomol(void) const
Get the Biomol member data.
Definition: MolInfo_.hpp:447
EMol
molecule class in living organism
Definition: Seq_inst_.hpp:108
bool IsPub(void) const
Check if variant Pub is selected.
Definition: Seqdesc_.hpp:1096
bool IsSetPub(void) const
the citation(s) Check if a value has been assigned to Pub data member.
Definition: Pubdesc_.hpp:593
TUser & SetUser(void)
Select the variant.
Definition: Seqdesc_.cpp:390
E_Choice Which(void) const
Which variant is currently selected.
Definition: Seqdesc_.hpp:903
const TPub & GetPub(void) const
Get the Pub member data.
Definition: Pubdesc_.hpp:605
const TDescr & GetDescr(void) const
Get the Descr member data.
Definition: Bioseq_.hpp:315
const TMolinfo & GetMolinfo(void) const
Get the variant data.
Definition: Seqdesc_.cpp:588
bool IsUser(void) const
Check if variant User is selected.
Definition: Seqdesc_.hpp:1122
@ e_User
user defined object
Definition: Seqdesc_.hpp:124
@ e_Source
source of materials, includes Org-ref
Definition: Seqdesc_.hpp:133
@ eMol_na
just a nucleic acid
Definition: Seq_inst_.hpp:113
bool IsSetData(void) const
Check if a value has been assigned to Data data member.
void SetSub(TSub &value)
Assign a value to Sub data member.
const TEntrys & GetEntrys(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
void SetData(TData &value)
Assign a value to Data data member.
const TSub & GetSub(void) const
Get the Sub member data.
bool IsEntrys(void) const
Check if variant Entrys is selected.
END_EVENT_TABLE()
int i
static void text(MDB_val *v)
Definition: mdb_dump.c:62
static int version
Definition: mdb_load.c:29
#define wxT(x)
Definition: muParser.cpp:41
void ReportSubWizardUsage(const string &action_name)
Report usage of the submission wizard dialog.
mdb_mode_t mode
Definition: lmdb++.h:38
const struct ncbi::grid::netcache::search::fields::SIZE size
static Format format
Definition: njn_ioutil.cpp:53
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
Definition: njn_matrix.hpp:613
The Object manager core.
static static static wxID_ANY
USING_SCOPE(objects)
unique_ptr< CObjectIStream > xCreateASNStream(CFormatGuess::EFormat format, unique_ptr< istream > &instream)
static void restoreRecursivelyAllToolTips(wxWindow *win)
CRef< CCmdComposite > CleanupCommand(objects::CSeq_entry_Handle orig_seh, bool extended, bool do_tax)
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
Modified on Wed May 22 11:29:25 2024 by modify_doxy.py rev. 669887