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

Go to the SVN repository for this file.

1 /* $Id: subprep_panel.cpp 47485 2023-05-02 14:46:59Z 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: Colleen Bollin, based on a file by Roman Katargin
27  */
28 
29 
30 #include <ncbi_pch.hpp>
31 
37 #include <objects/biblio/Affil.hpp>
45 #include <objects/pub/Pub.hpp>
54 #include <objects/seq/Bioseq.hpp>
55 #include <objects/seq/Pubdesc.hpp>
59 #include <objmgr/seqdesc_ci.hpp>
60 #include <objmgr/bioseq_ci.hpp>
61 #include <objmgr/feat_ci.hpp>
83 #include <wx/sizer.h>
84 #include <wx/statbox.h>
85 #include <wx/radiobox.h>
86 #include <wx/msgdlg.h>
87 #include <wx/choice.h>
88 #include <wx/filedlg.h>
89 
96 #include <gui/utils/app_popup.hpp>
101 #include "subprep_event.hpp"
103 
104 // includes for validation and cleanup
106 #include <objmgr/object_manager.hpp>
110 
112 
113 
114 
115 ////@begin XPM images
116 ////@end XPM images
117 
118 
120 
121 
122 /*!
123  * CSubPrep_panel type definition
124  */
125 
126 IMPLEMENT_DYNAMIC_CLASS( CSubPrep_panel, wxScrolledWindow )
127 
128 
129 /*!
130  * CSubPrep_panel event table definition
131  */
132 
133 BEGIN_EVENT_TABLE( CSubPrep_panel, wxScrolledWindow )
134 
135 ////@begin CSubPrep_panel event table entries
136  EVT_NOTEBOOK_PAGE_CHANGED( ID_NOTEBOOK, CSubPrep_panel::OnNotebookPageChanged )
137 
139 
140  EVT_BUTTON( ID_ADD_SEQUENCE_BTN, CSubPrep_panel::OnAddSequenceBtnClick )
141 
142  EVT_BUTTON( ID_REORDER_SEQ, CSubPrep_panel::OnReorderSeqClick )
143 
145 
147 
148  EVT_BUTTON( ID_PREV_BTN, CSubPrep_panel::OnPrevBtnClick )
149 
150  EVT_BUTTON( ID_NEXT_BTN, CSubPrep_panel::OnNextBtnClick )
151 
152  EVT_BUTTON( ID_FLATFILE, CSubPrep_panel::OnFlatfileClick )
153 
154  EVT_BUTTON( ID_LOOKUP_TAXONOMY, CSubPrep_panel::OnLookupTaxonomyClick )
155 
156  EVT_BUTTON( ID_VALIDATE, CSubPrep_panel::OnValidateClick )
157 
159 
160  EVT_BUTTON( ID_START_NEW, CSubPrep_panel::OnStartNewClick )
161 
162 ////@end CSubPrep_panel event table entries
163 
165 
167 
168 
169 /*!
170  * CSubPrep_panel constructors
171  */
172 
174  : m_IsSingle(false), m_CmdProcessor()
175 {
176  Init();
177 }
178 
179 CSubPrep_panel::CSubPrep_panel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
180  : m_IsSingle(false), m_CmdProcessor(), m_SubmissionOk(false), m_DataIsSaved(false), m_SubmissionErrors("")
181 {
182  Init();
183  Create(parent, id, pos, size, style);
184 }
185 
186 
187 /*!
188  * CSubPrep_panel creator
189  */
190 
191 bool CSubPrep_panel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
192 {
193 ////@begin CSubPrep_panel creation
194  wxScrolledWindow::Create( parent, id, pos, size, style );
195 
196  CreateControls();
197  if (GetSizer())
198  {
199  GetSizer()->SetSizeHints(this);
200  }
201  Centre();
202 ////@end CSubPrep_panel creation
203 
204  wxClientDC dc(this);
205  SetScrollRate(dc.GetCharWidth(),dc.GetCharHeight());
206 
207  return true;
208 }
209 
210 
211 /*!
212  * CSubPrep_panel destructor
213  */
214 
216 {
217 ////@begin CSubPrep_panel destruction
218 ////@end CSubPrep_panel destruction
219 }
220 
221 
222 /*!
223  * Member initialisation
224  */
234 };
235 static int num_keywords = sizeof (s_keywords) / sizeof (CSubPrep_panel::TWizardKeyword);
236 
237 
239 {
240 ////@begin CSubPrep_panel member initialisation
241  m_Status = NULL;
242  m_Book = NULL;
247  m_PrevBtn = NULL;
248  m_NextBtn = NULL;
254 ////@end CSubPrep_panel member initialisation
255 
257 
258  m_Keywords.clear();
259  for (int i = 0; i < num_keywords; i++) {
260  m_Keywords.push_back(s_keywords[i]);
261  }
262  m_SaveFileDir = wxT("");
263  m_SaveFileName = wxT("");
264  m_MainPanel = NULL;
265 }
266 
267 
268 /*!
269  * Control creation for CSubPrep_panel
270  */
271 
273 {
274 ////@begin CSubPrep_panel content construction
275  CSubPrep_panel* itemScrolledWindow1 = this;
276 
277  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
278  itemScrolledWindow1->SetSizer(itemBoxSizer2);
279 
280  m_Status = new wxStaticText( itemScrolledWindow1, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxSize(550, -1), wxALIGN_RIGHT|wxST_NO_AUTORESIZE );
281  m_Status->SetFont(wxFont(14, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma")));
282  itemBoxSizer2->Add(m_Status, 0, wxALIGN_LEFT|wxALL, 5);
283 
284  wxFlexGridSizer* itemFlexGridSizer4 = new wxFlexGridSizer(0, 4, 0, 0);
285  itemBoxSizer2->Add(itemFlexGridSizer4, 0, wxALIGN_LEFT|wxALL, 5);
286 
287  m_Book = new wxNotebook( itemScrolledWindow1, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxBK_DEFAULT );
288 
289  itemBoxSizer2->Add(m_Book, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
290 
291  m_SequenceCount = new wxStaticText( itemScrolledWindow1, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
292  itemBoxSizer2->Add(m_SequenceCount, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
293 
294  wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
295  itemBoxSizer2->Add(itemBoxSizer7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
296 
297  wxButton* itemButton8 = new wxButton( itemScrolledWindow1, ID_BUTTON17, _("Open Existing Submission"), wxDefaultPosition, wxDefaultSize, 0 );
298  itemBoxSizer7->Add(itemButton8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
299 
300  wxButton* itemButton9 = new wxButton( itemScrolledWindow1, ID_ADD_SEQUENCE_BTN, _("Add Sequences"), wxDefaultPosition, wxDefaultSize, 0 );
301  itemBoxSizer7->Add(itemButton9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
302 
303  m_ReorderSequencesBtn = new wxButton( itemScrolledWindow1, ID_REORDER_SEQ, _("Reorder Sequences"), wxDefaultPosition, wxDefaultSize, 0 );
304  m_ReorderSequencesBtn->Enable(false);
305  itemBoxSizer7->Add(m_ReorderSequencesBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
306 
307  m_RemoveSequencesBtn = new wxButton( itemScrolledWindow1, ID_BUTTON16, _("Remove Sequences"), wxDefaultPosition, wxDefaultSize, 0 );
308  m_RemoveSequencesBtn->Enable(false);
309  itemBoxSizer7->Add(m_RemoveSequencesBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
310 
311  m_VectorTrimBtn = new wxButton( itemScrolledWindow1, ID_BUTTON13, _("Vector Trim Tool"), wxDefaultPosition, wxDefaultSize, 0 );
312  m_VectorTrimBtn->Enable(false);
313  itemBoxSizer7->Add(m_VectorTrimBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
314 
315  wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxHORIZONTAL);
316  itemBoxSizer2->Add(itemBoxSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
317 
318  m_PrevBtn = new wxButton( itemScrolledWindow1, ID_PREV_BTN, _("Prev"), wxDefaultPosition, wxDefaultSize, 0 );
319  m_PrevBtn->Enable(false);
320  itemBoxSizer13->Add(m_PrevBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
321 
322  m_NextBtn = new wxButton( itemScrolledWindow1, ID_NEXT_BTN, _("Next"), wxDefaultPosition, wxDefaultSize, 0 );
323  m_NextBtn->Enable(false);
324  itemBoxSizer13->Add(m_NextBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
325 
326  m_StarExplanation = new wxBoxSizer(wxHORIZONTAL);
327  itemBoxSizer2->Add(m_StarExplanation, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
328 
329  wxStaticText* itemStaticText17 = new wxStaticText( itemScrolledWindow1, wxID_STATIC, _("*"), wxDefaultPosition, wxDefaultSize, 0 );
330  itemStaticText17->SetForegroundColour(wxColour(255, 0, 0));
331  m_StarExplanation->Add(itemStaticText17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
332 
333  wxStaticText* itemStaticText18 = new wxStaticText( itemScrolledWindow1, wxID_STATIC, _("Indicates required information has not been provided"), wxDefaultPosition, wxDefaultSize, 0 );
334  m_StarExplanation->Add(itemStaticText18, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
335 
336  wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxHORIZONTAL);
337  itemBoxSizer2->Add(itemBoxSizer19, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
338 
339  m_FlatfileButton = new wxButton( itemScrolledWindow1, ID_FLATFILE, _("Show Flatfile"), wxDefaultPosition, wxDefaultSize, 0 );
340  itemBoxSizer19->Add(m_FlatfileButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
341 
342  m_TaxonomyButton = new wxButton( itemScrolledWindow1, ID_LOOKUP_TAXONOMY, _("Lookup Taxonomy"), wxDefaultPosition, wxDefaultSize, 0 );
343  itemBoxSizer19->Add(m_TaxonomyButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
344 
345  m_ValidateButton = new wxButton( itemScrolledWindow1, ID_VALIDATE, _("Validate"), wxDefaultPosition, wxDefaultSize, 0 );
346  itemBoxSizer19->Add(m_ValidateButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
347 
348  wxButton* itemButton23 = new wxButton( itemScrolledWindow1, ID_SAVE_BTN, _("Save"), wxDefaultPosition, wxDefaultSize, 0 );
349  itemBoxSizer19->Add(itemButton23, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
350 
351  wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxHORIZONTAL);
352  itemBoxSizer2->Add(itemBoxSizer24, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
353 
354  m_StartNewBtn = new wxButton( itemScrolledWindow1, ID_START_NEW, _("Start New Submission"), wxDefaultPosition, wxDefaultSize, 0 );
355  itemBoxSizer24->Add(m_StartNewBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
356 
357 ////@end CSubPrep_panel content construction
358 
360  m_Book->AddPage(m_IntroPanel, wxT("Submission Overview"));
361  if (m_TopSeqEntry
362  && (m_TopSeqEntry.IsSeq()
363  || (m_TopSeqEntry.IsSet()
364  && !m_TopSeqEntry.GetSet().IsEmptySeq_set()))) {
366  m_Book->AddPage(m_MainPanel, wxT("Submission Details"));
367  }
368 }
369 
370 
372 {
373  wxSize size = m_Book->GetSize();
374  size.IncBy(1);
375  m_Book->SetSize(size);
376  return wxScrolledWindow::Layout();
377 }
378 
379 
380 static const string kAssemblyDescription = "Assembly Description";
381 
383 {
384  if (m_MainPanel) {
386  }
387 
388  m_DBLinkFields.clear();
389  m_DBLinkUrls.clear();
390  m_DBLinkRequired.clear();
391 
394 
395  if (m_TopSeqEntry
396  && (m_TopSeqEntry.IsSeq()
397  || (m_TopSeqEntry.IsSet()
398  && !m_TopSeqEntry.GetSet().IsEmptySeq_set()))) {
399  x_CreateMoleculeOptions(wizard_type, src_type);
400  x_CreateGenomeOptions (wizard_type, src_type);
401  if (m_MainPanel) {
403  }
404 
405  // TODO: wizard-specific options
406  switch (wizard_type) {
409  break;
413  break;
415  if (m_MainPanel) {
417  }
418  break;
419  default:
420  break;
421  }
422 
424 
425  }
426 
427  if (m_MainPanel) {
429  }
430 
431  // update
432  Layout();
433  FitInside();
434  Refresh();
435 }
436 
437 
439 {
441  if (!m_TopSeqEntry) {
442  return cmd;
443  } else if (m_TopSeqEntry.IsSet()
444  && m_TopSeqEntry.GetSet().IsEmptySeq_set()) {
445  return cmd;
446  }
447  vector<CTableFieldCommandConverter*> converter_list;
448 
449  switch (wizard_type) {
451  converter_list.push_back(new CPrimerTableCommandConverter());
452  break;
454  converter_list.push_back(new CCommentDescriptorTableCommandConverter(kAssemblyDescription));
455  converter_list.push_back(new CDBLinkTableCommandConverter (m_DBLinkFields));
456  break;
457  default:
458  break;
459  }
460 
461  bool any_data = false;
462  for (size_t i = 0; i < converter_list.size(); i++) {
463  CRef<objects::CSeq_table> table = converter_list[i]->GetValuesTableFromSeqEntry(m_TopSeqEntry);
464  ITERATE (objects::CSeq_table::TColumns, cit, table->GetColumns()) {
465  if ((*cit)->IsSetData() && !(*cit)->GetData().IsId() && AreAnyColumnValuesPresent(*cit)) {
466  any_data = true;
467  break;
468  }
469  }
470  }
471 
472  if (any_data) {
473  cmd = new CCmdComposite("Clear Wizard-Specific Data");
474  for (size_t i = 0; i < converter_list.size(); i++) {
475  CRef<CCmdComposite> subcmd = converter_list[i]->ClearAllValues(m_TopSeqEntry);
476  if (subcmd) {
477  cmd->AddCommand(*subcmd);
478  }
479  }
480  }
481 
482  for (size_t i = 0; i < converter_list.size(); i++) {
483  delete converter_list[i];
484  }
485  return cmd;
486 }
487 
488 
489 
490 #if 0
492 {
493  bool needed = true;
494  if (wizard_type == CSourceRequirements::eWizardType_microsatellite || wizard_type == CSourceR) {
497  if (AreAllColumnValuesTheSame (col, "linear")) {
498  string first_val = "linear";
499  if (col->IsSetData() && col->GetData().GetString().size() > 0) {
500  first_val = col->GetData().GetString().front();
501  if (NStr::IsBlank(first_val)) {
502  first_val = "linear";
503  }
504  }
505  if (NStr::Equal(first_val, "linear")) {
506  needed = false;
507  }
508  }
509  }
510  return needed;
511 }
512 #endif
513 
516 {
517  if (m_MainPanel) {
518  CMolInfoTableCommandConverter* mol_converter = new CMolInfoTableCommandConverter (wizard_type);
519  CMolInfoTableCommandConverter* top_converter = new CMolInfoTableCommandConverter (wizard_type);
520  bool must_choose = !NStr::Equal("Yes", GetWizardFieldFromSeqEntry(m_TopSeqEntry, string(kMoleculeType) + " Confirmed"));
521  if (wizard_type == CSourceRequirements::eWizardType_d_loop) {
522  must_choose = false;
523  }
524  m_MainPanel->AddField (m_TopSeqEntry, m_CmdProcessor, m_Workbench, kMoleculeType, kMoleculeType, mol_converter, must_choose, true, "");
525  m_MainPanel->AddField (m_TopSeqEntry, m_CmdProcessor, m_Workbench, kTopology, kTopology, top_converter, false, false, "linear");
526  }
527 
528 }
529 
530 
532 {
534  if (m_MainPanel) {
535  m_MainPanel->AddField (m_TopSeqEntry, m_CmdProcessor, m_Workbench, "Primer Type", "Primer Type", converter,
536  false, true);
537  }
538 }
539 
540 
541 
542 void CSubPrep_panel::x_CreateCommentOptions (const string& comment_label)
543 {
544  if (m_MainPanel) {
546  m_MainPanel->AddField(m_TopSeqEntry, m_CmdProcessor, m_Workbench, comment_label, comment_label,
547  converter, false, false, "");
548  }
549 }
550 
551 
552 const string kChimeraLabel = "Program and Version";
553 const string kChimeraField = "Chimera Screening";
554 
556 {
557  if (m_MainPanel) {
559  }
560 }
561 
562 
564 {
566 
567  m_DBLinkFields.push_back ("BioProject");
568  m_DBLinkUrls.push_back("https://dsubmit.ncbi.nlm.nih.gov/subs/SUB002235/submitter");
569  m_DBLinkRequired.push_back(true);
570  m_DBLinkFields.push_back ("Sequence Read Archive");
571  m_DBLinkUrls.push_back("https://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=announcement");
572  m_DBLinkRequired.push_back(false);
573  m_DBLinkFields.push_back ("BioSample");
574  m_DBLinkUrls.push_back("https://dsubmit.ncbi.nlm.nih.gov/subs/SUB002236/submitter");
575  m_DBLinkRequired.push_back(false);
576 
578 
579  int pos = 0;
580  for (vector<string>::iterator it = m_DBLinkFields.begin(); it != m_DBLinkFields.end(); it++, pos++) {
581  if (m_MainPanel) {
583  false, m_DBLinkRequired[pos], "", m_DBLinkUrls[pos], false);
584  }
585 
586  }
587  Layout();
588 }
589 
590 
591 const string kGenome = "genome";
592 
595 {
596  if (m_MainPanel) {
597  // add to main panel
598  CGenomeTableCommandConverter* converter = new CGenomeTableCommandConverter (wizard_type, src_type);
599  m_MainPanel->AddField (m_TopSeqEntry, m_CmdProcessor, m_Workbench, kLocation, kGenome, converter, false, false, "genomic");
600  }
601 
602 }
603 
604 
605 bool CSubPrep_panel::x_IsSequencingTechnologyRequired (objects::CSeq_entry_Handle entry, CSourceRequirements::EWizardType wizard_type)
606 {
607  if (wizard_type == CSourceRequirements::eWizardType_tsa) {
608  return true;
609  }
610  if (entry.IsSet()) {
611  CConstRef<objects::CBioseq_set> set = entry.GetSet().GetCompleteBioseq_set();
612  if (set && set->IsSetSeq_set() && set->GetSeq_set().size() >= 500) {
613  return true;
614  }
615  }
616 
617  if (m_SeqSubmit && m_SeqSubmit->IsSetSub()
618  && m_SeqSubmit->GetSub().IsSetCit()
619  && m_SeqSubmit->GetSub().GetCit().IsSetDescr()) {
620  string title = m_SeqSubmit->GetSub().GetCit().GetDescr();
621  if (NStr::Find(title, "454") != string::npos
622  || NStr::Find(title, "Complete Genomics") != string::npos
623  || NStr::Find(title, "Helicos") != string::npos
624  || NStr::Find(title, "Illumina") != string::npos
625  || NStr::Find(title, "IonTorrent") != string::npos
626  || NStr::Find(title, "PacBio") != string::npos
627  || NStr::Find(title, "Pacific Biosciences") != string::npos
628  || NStr::Find(title, "SOLiD") != string::npos
629  || NStr::Find(title, "pyrosequencing") != string::npos
630  || NStr::Find(title, "HiSeq") != string::npos
631  || NStr::Find(title, "transcriptome") != string::npos
632  || NStr::Find(title, "solexa") != string::npos
633  || NStr::Find(title, "deep sequencing") != string::npos
634  || NStr::Find(title, "deep-sequencing") != string::npos
635  || NStr::Find(title, "transcriptom") != string::npos
636  || NStr::Find(title, "next-gen") != string::npos
637  || NStr::Find(title, "RNA-Seq") != string::npos
638  || NStr::Find(title, "RNASeq") != string::npos
639  || NStr::Find(title, "RNA Seq") != string::npos
640  || NStr::Find(title, "high-throughput") != string::npos
641  || NStr::Find(title, "high throughput") != string::npos
642  || NStr::Find(title, "metagenom") != string::npos
643  || NStr::Find(title, "assembl") != string::npos
644  || NStr::Find(title, "raw seq") != string::npos
645  || NStr::Find(title, "next gen") != string::npos) {
646  return true;
647  }
648  }
649  return false;
650 }
651 
652 
654 {
655  return x_IsSequencingTechnologyRequired (m_TopSeqEntry, wizard_type);
656 }
657 
658 
660 {
661  // todo - if wizard is WGS, use other structured comment
662  CStructuredCommentCommandConverter converter("##Assembly-Data-START##", GetAssemblyDataFields());
664  return table;
665 }
666 
667 
669 {
671  bool found = false;
672 
673  objects::CBioseq_CI b_iter(entry, objects::CSeq_inst::eMol_na);
674  for ( ; b_iter && !found; ++b_iter ) {
675  objects::CSeqdesc_CI it (*b_iter, objects::CSeqdesc::e_Source);
676  while (it && !found) {
677  if (it->GetSource().IsSetSubtype()) {
678  ITERATE (objects::CBioSource::TSubtype, sit, it->GetSource().GetSubtype()) {
679  if ((*sit)->IsSetSubtype()
680  && (*sit)->GetSubtype() == objects::CSubSource::eSubtype_other
681  && (*sit)->IsSetName()) {
682  string note = (*sit)->GetName();
683  size_t pos = NStr::FindNoCase (note, " wizard");
684  while (pos != string::npos && !found) {
685  for (int i = 0; i < num_keywords; i++) {
686  size_t k_len = s_keywords[i].second.length();
687  if (pos > k_len && NStr::EqualNocase(note.substr(pos - k_len, k_len), s_keywords[i].second)) {
688  wizard = s_keywords[i].first;
689  found = true;
690  break;
691  }
692  }
693  if (!found) {
694  note = note.substr(pos + 7);
695  pos = NStr::FindNoCase (note, " wizard");
696  }
697  }
698  }
699  }
700  }
701  ++it;
702  }
703  }
704  return wizard;
705 }
706 
707 const string kWizardType = "WizardType";
708 const string kSrcType = "SrcType";
709 
710 string CSubPrep_panel::GetWizardFieldFromSeqEntry (objects::CSeq_entry_Handle entry, string field_name)
711 {
712  objects::CSeqdesc_CI it (entry, objects::CSeqdesc::e_User);
713 
714  while (it) {
715  if (IsWizardObject(it->GetUser())) {
716  string wizard_str = GetFieldFromWizardObject(it->GetUser(), field_name);
717  return wizard_str;
718  }
719  ++it;
720  }
721  return "";
722 }
723 
724 
725 CRef<CCmdComposite> CSubPrep_panel::SetWizardFieldInSeqEntry(objects::CSeq_entry_Handle entry, string field_name, string value)
726 {
727  CRef<CCmdComposite> cmd(new CCmdComposite("Wizard Object Edit") );
728  bool found = false;
729 
730  for (objects::CSeqdesc_CI desc_ci( entry, objects::CSeqdesc::e_User);
731  desc_ci;
732  ++desc_ci) {
733  const objects::CUser_object& u = desc_ci->GetUser();
734  if (IsWizardObject (u)) {
735  CRef<objects::CSeqdesc> new_desc( new objects::CSeqdesc );
736  CRef<objects::CUser_object> new_user (new objects::CUser_object());
737  new_user->Assign (u);
738  new_desc->SetUser(*new_user);
739  objects::CUser_field& new_field = new_user->SetField(field_name);
740  new_field.SetData().SetStr(value);
741  CRef<CCmdChangeSeqdesc> ecmd(new CCmdChangeSeqdesc(desc_ci.GetSeq_entry_Handle(), *desc_ci, *new_desc));
742  cmd->AddCommand (*ecmd);
743  found = true;
744  }
745  }
746  if (!found) {
747  CRef<objects::CSeqdesc> new_desc( new objects::CSeqdesc );
749  new_desc->SetUser(*new_user);
750  objects::CUser_field& new_field = new_user->SetField(field_name);
751  new_field.SetData().SetStr(value);
752  cmd->AddCommand( *CRef<CCmdCreateDesc>(new CCmdCreateDesc(entry, *new_desc)) );
753  }
754  return cmd;
755 }
756 
757 
758 
760 {
761  objects::CSeqdesc_CI it (entry, objects::CSeqdesc::e_User);
762 
763  while (it) {
764  if (IsWizardObject(it->GetUser())) {
765  string wizard_str = GetFieldFromWizardObject(it->GetUser(), kWizardType);
766  return GetWizardTypeFromName(wizard_str);
767  }
768  ++it;
769  }
770  return GuessWizardTypefromSeqEntry(entry);
771 }
772 
773 
775 {
776  string value = "";
777  objects::CSeqdesc_CI it (m_TopSeqEntry, objects::CSeqdesc::e_User);
778 
779  while (it) {
780  if (IsWizardObject(it->GetUser())) {
781  value = GetFieldFromWizardObject(it->GetUser(), kWizardType);
782  break;
783  }
784  ++it;
785  }
786  return value;
787 }
788 
789 
791 {
792  string value = "";
793  objects::CSeqdesc_CI it (m_TopSeqEntry, objects::CSeqdesc::e_User);
794 
795  while (it) {
796  if (IsWizardObject(it->GetUser())) {
797  value = GetFieldFromWizardObject(it->GetUser(), kSrcType);
798  break;
799  }
800  ++it;
801  }
802  return value;
803 }
804 
805 
807 {
808  if (!m_MainPanel) {
810  }
811  string value = "";
812  objects::CSeqdesc_CI it (entry, objects::CSeqdesc::e_User);
813 
814  while (it) {
815  if (IsWizardObject(it->GetUser())) {
816  value = GetFieldFromWizardObject(it->GetUser(), kSrcType);
817  break;
818  }
819  ++it;
820  }
822 }
823 
824 
826 {
827  if (m_IntroPanel) {
829  } else {
831  }
832 }
833 
834 
835 string CSubPrep_panel::GetWizardTypeName (unsigned int wizard_type)
836 {
837  switch (wizard_type) {
839  return "Standard";
840  break;
842  return "Viruses";
843  break;
845  return "Uncultured Samples";
846  break;
848  return "rRNA-ITS-IGS sequences";
849  break;
851  return "TSA";
852  break;
854  return "Intergenic Spacer (IGS) sequences";
855  break;
857  return "Microsatellite sequences";
858  break;
860  return "D-loops and control regions";
861  break;
862  default:
863  return "Unknown";
864  break;
865  }
866 }
867 
868 
870 {
871  if (m_MainPanel) {
872  m_MainPanel->SetSourceTypeOptions(wizard_type);
873  }
874 }
875 
876 
878 {
879  if (m_MainPanel) {
880  m_MainPanel->SetSourceType(src_type);
881  }
882 }
883 
884 
886 {
887  if (m_MainPanel) {
889  return m_MainPanel->GetWizardSrcTypeFromCtrls(wizard_type);
890  } else {
892  }
893 }
894 
895 
897 {
899 }
900 
901 
903 {
904  string qual_report = "";
906  CSourceRequirements *requirements = GetSrcRequirements (wizard_type, x_GetWizardSrcTypeFromCtrls(), values_table);
907  CRef<objects::CSeqTable_column> problems = requirements->CheckSourceQuals(values_table);
909  delete requirements;
910  if (m_MainPanel) {
912  }
913 
914  for (int row = 0; row < values_table->GetNum_rows(); row++) {
915  if (!NStr::IsBlank(problems->GetData().GetString()[row])) {
916  string id_label;
917  if (id_col) {
918  id_col->GetData().GetId()[row]->GetLabel(&id_label, objects::CSeq_id::eContent);
919  } else {
920  id_label = NStr::NumericToString(row + 1);
921  }
922  if (!NStr::IsBlank(qual_report)) {
923  qual_report += "; ";
924  }
925  qual_report += id_label + ":" + problems->GetData().GetString()[row];
926  m_SubmissionOk = false;
927  if (m_MainPanel) {
929  }
930  }
931  }
932 
933  if (NStr::IsBlank(qual_report)) {
934  qual_report = "No Source Qualifier Problems Found";
935  }
936  return qual_report;
937 }
938 
939 
941 {
942  if (m_IntroPanel) {
944  }
945 }
946 
947 
949 {
950  bool has_problem = false;
951  bool features_ok = false;
952  string status = CheckFeatureAnnotation(m_TopSeqEntry, features_ok);
953  if (!features_ok && wizard_type != CSourceRequirements::eWizardType_tsa) {
954  has_problem = true;
955  }
958  if (fi) {
960  if (converter) {
962  CRef<CSeqTable_column> problems = converter->MakeProblemsColumn(values);
963  if (problems) {
964  vector<string> problem_strings;
966  if (!NStr::IsBlank(*it)) {
967  problem_strings.push_back(*it);
968  }
969  }
970  problem_strings = SortUniqueStrings(problem_strings);
971  ITERATE(vector<string>, it, problem_strings) {
972  status += *it;
973  status += "\n";
974  has_problem = true;
975  }
976  }
977  delete converter;
978  }
979  }
980  }
981 
982  m_MainPanel->SetFeaturesLabel(status);
983  m_MainPanel->ShowFeaturesStar(has_problem);
984  if (has_problem) {
985  SetSubmissionNotReady(status);
986  }
987 }
988 
989 
991 {
994  m_SubmissionOk = false;
995 
996  if (m_TopSeqEntry) {
997  m_SubmissionOk = true;
998  m_SubmissionErrors = "";
1001  if (m_IntroPanel) {
1003  }
1004  if (!m_MainPanel && m_TopSeqEntry
1005  && (m_TopSeqEntry.IsSeq()
1006  || (m_TopSeqEntry.IsSet()
1007  && !m_TopSeqEntry.GetSet().IsEmptySeq_set()))) {
1009  m_Book->AddPage(m_MainPanel, wxT("Submission Details"));
1010  }
1011 
1013  x_SetSourceType (src_type);
1014  if (m_MainPanel) {
1015  m_MainPanel->UpdateSeqTechCtrls(wizard_type);
1016  }
1017 
1018  if (!m_TopSeqEntry.IsSet()) {
1019  m_IsSingle = true;
1020  }
1021  if (m_MainPanel) {
1022  x_UpdateFeatureStatus(wizard_type);
1023  }
1024  } else {
1025  if (m_IntroPanel) {
1027  }
1028  }
1029 
1030  if (m_MainPanel) {
1032  }
1038 }
1039 
1040 
1041 /*!
1042  * Transfer data to the window
1043  */
1044 
1046 {
1047  m_TopSeqEntry.Reset();
1048  m_SeqSubmit.Reset();
1049  m_SubmissionOk = false;
1050  if (m_InputObjects) {
1052  const CObject* ptr = it->object.GetPointer();
1053 
1054  /// CSeq_entry
1055  const objects::CSeq_entry* seqEntry = dynamic_cast<const objects::CSeq_entry*>(ptr);
1056  objects::CSeq_entry_Handle seh;
1057  if (seqEntry) {
1058  seh = it->scope->GetSeq_entryHandle (*seqEntry);
1059  } else {
1060  const objects::CSeq_submit* seqsubmit = dynamic_cast<const objects::CSeq_submit*>(ptr);
1061  if (seqsubmit) {
1062  m_SeqSubmit = const_cast<objects::CSeq_submit*>(seqsubmit);
1063  if (seqsubmit->IsEntrys()) {
1064  seh = it->scope->GetSeq_entryHandle(*(seqsubmit->GetData().GetEntrys().front()));
1065  }
1066  } else {
1067  const objects::CSeq_id* seqid = dynamic_cast<const objects::CSeq_id*>(ptr);
1068  if (seqid) {
1069  objects::CBioseq_Handle bsh = it->scope->GetBioseqHandle(*seqid);if (bsh) {
1070  seh = bsh.GetSeq_entry_Handle();
1071  }
1072  }
1073  }
1074  }
1075  if (seh) {
1076  m_TopSeqEntry = seh;
1078  }
1079  }
1080  }
1081  // only show the New Submission button if this was launched from the edit perspective and not a specific object
1082  if (!m_TopSeqEntry.IsSet() || !m_TopSeqEntry.GetSet().IsEmptySeq_set()) {
1083  m_StartNewBtn->Show(false);
1084  }
1085  return wxPanel::TransferDataToWindow();
1086 }
1087 
1088 
1089 /*!
1090  * Transfer data from the window
1091  */
1092 
1093 static const char *kTableTag = "Table";
1094 
1096 {
1097  if (!m_RegPath.empty()) {
1099  string reg_path = CGuiRegistryUtil::MakeKey(m_RegPath, kTableTag);
1100  CRegistryWriteView table_view = gui_reg.GetWriteView(reg_path);
1101  }
1102 }
1103 
1104 
1106 {
1107  if (!m_RegPath.empty()) {
1109  string reg_path;
1110  CRegistryReadView table_view;
1111 
1113  table_view = gui_reg.GetReadView(reg_path);
1114  }
1115 }
1116 
1117 
1118 /*!
1119  * Should we show tooltips?
1120  */
1121 
1123 {
1124  return true;
1125 }
1126 
1127 /*!
1128  * Get bitmap resources
1129  */
1130 
1131 wxBitmap CSubPrep_panel::GetBitmapResource( const wxString& name )
1132 {
1133  // Bitmap retrieval
1134 ////@begin CSubPrep_panel bitmap retrieval
1135  wxUnusedVar(name);
1136  return wxNullBitmap;
1137 ////@end CSubPrep_panel bitmap retrieval
1138 }
1139 
1140 /*!
1141  * Get icon resources
1142  */
1143 
1144 wxIcon CSubPrep_panel::GetIconResource( const wxString& name )
1145 {
1146  // Icon retrieval
1147 ////@begin CSubPrep_panel icon retrieval
1148  wxUnusedVar(name);
1149  return wxNullIcon;
1150 ////@end CSubPrep_panel icon retrieval
1151 }
1152 
1153 
1155 {
1156  size_t num_pages = m_Book->GetPageCount();
1157  if (num_pages < 2) {
1158  m_NextBtn->Enable(false);
1159  m_PrevBtn->Enable(false);
1160  } else {
1161  int selection = m_Book->GetSelection();
1162  if (selection < num_pages - 1 && m_IntroPanel != NULL && m_IntroPanel->IsComplete()) {
1163  m_NextBtn->Enable(true);
1164  } else {
1165  m_NextBtn->Enable(false);
1166  }
1167  if (selection > 0) {
1168  m_PrevBtn->Enable(true);
1169  } else {
1170  m_PrevBtn->Enable(false);
1171  }
1172  }
1173 }
1174 
1175 
1177 {
1178  bool any_seq = false;
1179  bool multi_seq = false;
1180  if (m_TopSeqEntry) {
1182  if (bi) {
1183  any_seq = true;
1184  ++bi;
1185  if (bi) {
1186  multi_seq = true;
1187  }
1188  }
1189 
1190  }
1191  m_ReorderSequencesBtn->Enable(multi_seq);
1192  m_RemoveSequencesBtn->Enable(multi_seq);
1193  m_VectorTrimBtn->Enable(any_seq);
1194  m_ValidateButton->Enable(any_seq);
1195  m_FlatfileButton->Enable(any_seq);
1196  m_TaxonomyButton->Enable(any_seq);
1197 }
1198 
1199 
1201 {
1202  size_t count = 0;
1203  if (m_TopSeqEntry) {
1205  while (bi) {
1206  count++;
1207  ++bi;
1208  }
1209  }
1210  if (count == 0) {
1211  m_SequenceCount->SetLabel(wxEmptyString);
1212  } else {
1213  string message = "Submission contains " + NStr::NumericToString(count) + " sequences.";
1214  m_SequenceCount->SetLabel(ToWxString(message));
1215  }
1216 }
1217 
1218 
1220 {
1221  m_SubmissionOk = true;
1222  m_SubmissionErrors = "";
1224 
1225  if (!m_MainPanel) {
1226  if (m_TopSeqEntry
1227  && (m_TopSeqEntry.IsSeq()
1228  || (m_TopSeqEntry.IsSet()
1229  && !m_TopSeqEntry.GetSet().IsEmptySeq_set()))) {
1231  m_Book->AddPage(m_MainPanel, wxT("Submission Details"));
1233  }
1234  }
1235 
1236  if (m_MainPanel) {
1237  m_MainPanel->UpdateSeqTechCtrls(wizard_type);
1240  x_UpdateFeatureStatus(wizard_type);
1241  } else {
1242  m_SubmissionOk = false;
1243  }
1244 
1251  m_DataIsSaved = false;
1252 }
1253 
1254 
1256 {
1257  m_SubmissionOk = false;
1258  if (!NStr::IsBlank(error)) {
1259  NStr::ReplaceInPlace(error, "\n", " ");
1262  string last_char = m_SubmissionErrors.substr(m_SubmissionErrors.length() - 1);
1263  if (!ispunct(last_char.c_str()[0])) {
1264  m_SubmissionErrors += ";";
1265  }
1266  m_SubmissionErrors += " ";
1267  }
1269  }
1270 }
1271 
1272 
1274 {
1275  if (m_SubmissionOk) {
1276  m_Status->SetLabel("Submission is ready!");
1277  m_Status->SetForegroundColour(*wxBLACK);
1278  } else {
1279  m_Status->SetLabel(wxT("Submission is incomplete!"));
1280  m_Status->SetForegroundColour(*wxRED);
1281  }
1282 }
1283 
1284 
1285 objects::CSeqdesc_CI CSubPrep_panel::GetCitSubPub()
1286 {
1287  objects::CSeqdesc_CI it(m_TopSeqEntry, objects::CSeqdesc::e_Pub);
1288  while (it) {
1289  if (it->GetPub().IsSetPub()
1290  && it->GetPub().GetPub().Get().size() > 0
1291  && it->GetPub().GetPub().Get().front()->IsGen()) {
1292  const objects::CCit_gen& orig_gen = it->GetPub().GetPub().Get().front()->GetGen();
1293  if (orig_gen.IsSetCit() && NStr::Equal(orig_gen.GetCit(), "Unpublished")) {
1294  break;
1295  }
1296  }
1297  ++it;
1298  }
1299  return it;
1300 }
1301 
1302 
1304 {
1305  CRef<objects::CSubmit_block> orig_block(new objects::CSubmit_block());
1306  if (m_SeqSubmit) {
1307  orig_block->Assign(m_SeqSubmit->GetSub());
1308  }
1309  return orig_block;
1310 }
1311 
1312 
1314 {
1315  CRef<objects::CSeq_submit> seq_submit (new objects::CSeq_submit());
1316  m_SeqSubmit = seq_submit;
1317  /// CSeq_entry
1318  CRef<objects::CSeq_entry> entry(const_cast<objects::CSeq_entry*>(m_TopSeqEntry.GetCompleteSeq_entry().GetPointer()));
1319 
1320  seq_submit->SetData().SetEntrys().push_back(entry);
1322  Send(&evt, ePool_Parent);
1323 }
1324 
1325 
1327 {
1328  CRef<objects::CSubmit_block> orig_block(new objects::CSubmit_block());
1329  if (m_SeqSubmit) {
1330  orig_block->Assign(m_SeqSubmit->GetSub());
1331  }
1332  objects::CSeqdesc_CI orig_citsub = GetCitSubPub();
1333  CRef<objects::CCit_gen> gen(new objects::CCit_gen());
1334  if (orig_citsub) {
1335  gen->Assign(orig_citsub->GetPub().GetPub().Get().front()->GetGen());
1336  }
1337 
1338  if (new_block) {
1339  // if this was not previously a Seq-submit, convert it
1340  if (!m_SeqSubmit) {
1342  }
1343  m_SeqSubmit->SetSub(*new_block);
1344  }
1345  if (new_gen) {
1346  CRef<objects::CSeqdesc> new_desc(new objects::CSeqdesc());
1347  CRef<objects::CPub> new_pub(new objects::CPub());
1348  new_pub->SetGen(*new_gen);
1349  new_desc->SetPub().SetPub().Set().push_back(new_pub);
1350  CRef<CCmdComposite> cmd(new CCmdComposite("Edit Submitter Info"));
1351 
1352  if (orig_citsub) {
1353  // edit existing descriptor
1354  CRef<CCmdChangeSeqdesc> ecmd(new CCmdChangeSeqdesc(orig_citsub.GetSeq_entry_Handle(), *orig_citsub, *new_desc));
1355  cmd->AddCommand(*ecmd);
1356  } else {
1357  // create new descriptor
1358  CRef<CCmdCreateDesc> ecmd(new CCmdCreateDesc(m_TopSeqEntry, *new_desc));
1359  cmd->AddCommand(*ecmd);
1360  }
1361 
1362  // generate create-date descriptor
1363  if (new_gen->IsSetDate()) {
1364  CRef<objects::CSeqdesc> new_create_desc(new objects::CSeqdesc());
1365  new_create_desc->SetCreate_date().Assign(new_gen->GetDate());
1366  objects::CSeqdesc_CI it(m_TopSeqEntry, objects::CSeqdesc::e_Create_date);
1367  if (it) {
1368  CRef<CCmdChangeSeqdesc> ecmd(new CCmdChangeSeqdesc(it.GetSeq_entry_Handle(), *it, *new_create_desc));
1369  cmd->AddCommand(*ecmd);
1370  } else {
1371  // create new descriptor
1372  CRef<CCmdCreateDesc> ecmd(new CCmdCreateDesc(m_TopSeqEntry, *new_create_desc));
1373  cmd->AddCommand(*ecmd);
1374  }
1375  }
1376 
1378  }
1379  SetAltEmailAddress(alt_email);
1381 }
1382 
1383 
1385 {
1387  CSeqTechDlg *dlg = new CSeqTechDlg(NULL, m_TopSeqEntry, wizard_type);
1388  HandleBulkCmdDlg(dlg);
1389 }
1390 
1391 
1393 {
1394  // todo - if wizard is WGS, use other structured comment
1395  CStructuredCommentCommandConverter converter("##Assembly-Data-START##", GetAssemblyDataFields());
1399 }
1400 
1401 
1403 {
1404  CStructuredCommentCommandConverter converter("##Assembly-Data-START##", GetAssemblyDataFields());
1405 
1406  bool ok_to_bulk_edit = true;
1408 
1409  if (table) {
1410  for (size_t i = 1; i < table->GetColumns().size() && ok_to_bulk_edit; i++) {
1411  string title = table->GetColumns()[i]->GetHeader().GetTitle();
1412  if (!AreAllColumnValuesTheSame(table->SetColumns()[i], "")) {
1413  ok_to_bulk_edit = false;
1414  }
1415  }
1416  }
1417  return ok_to_bulk_edit;
1418 }
1419 
1420 
1422 {
1424  SrcEditDialog dlg(NULL, m_TopSeqEntry, m_Workbench, m_SeqSubmit); // wizard_type, x_GetWizardSrcTypeFromCtrls());
1425  if (dlg.ShowModal() == wxID_OK) {
1428  dlg.Close();
1429  }
1430 }
1431 
1432 
1434 {
1435  vector<string> qual_names;
1436  qual_names.push_back("taxname");
1437  qual_names.push_back("clone");
1438 
1440  if (!src_table || src_table->GetNum_rows() == 0) {
1441  return true;
1442  }
1443  CRef<objects::CSeqTable_column> tax_col = FindSeqTableColumnByName (src_table, "taxname");
1444  CRef<objects::CSeqTable_column> clone_col = FindSeqTableColumnByName (src_table, "clone");
1445  vector<string> vals;
1446  for (int i = 0; i < src_table->GetNum_rows(); i++) {
1447  string row_val = "";
1448  if (tax_col && tax_col->GetData().GetSize() > i) {
1449  row_val += tax_col->GetData().GetString()[i];
1450  }
1451  if (clone_col && clone_col->GetData().GetSize() > i) {
1452  row_val += clone_col->GetData().GetString()[i];
1453  }
1454  if (NStr::IsBlank(row_val)) {
1455  // blank row
1456  return true;
1457  } else {
1458  vals.push_back(row_val);
1459  }
1460  }
1461 
1462  vector<string> sorted_vals = FindNonUniqueStrings(vals);
1463 
1464  if (sorted_vals.size() > 0) {
1465  return true;
1466  } else {
1467  return false;
1468  }
1469 }
1470 
1471 
1473 {
1474  vector<size_t> lens;
1475 
1477  ITERATE(objects::CSeqTable_column::TData::TId, it, col->GetData().GetId()) {
1478  objects::CBioseq_Handle bsh = m_TopSeqEntry.GetScope().GetBioseqHandle(**it);
1479  lens.push_back(bsh.GetBioseqLength());
1480  }
1481  return lens;
1482 }
1483 
1484 
1486 {
1487  CRef<objects::CSeq_feat> feat(new objects::CSeq_feat());
1488  feat->SetData().SetImp().SetKey("repeat_region");
1489  feat->SetQual().push_back(CRef<objects::CGb_qual>(new objects::CGb_qual("satellite", "microsatellite")));
1490  feat->SetQual().push_back(CRef<objects::CGb_qual>(new objects::CGb_qual("rpt_type", "tandem")));
1494  opts.push_back(CRef<CFeatureSeqTableColumnBase>( new CRptUnitSeqColumn()));
1495  CFeatureTableCommandConverter* tmp_converter = new CFeatureTableCommandConverter(*feat, reqs, opts);
1497  vector<size_t> lens = x_GetSequenceLengths(table);
1498  delete tmp_converter;
1499  opts.push_back(CRef<CFeatureSeqTableColumnBase>( new CRptUnitRangeColumn(lens)));
1500  CFeatureTableCommandConverter* converter = new CFeatureTableCommandConverter(*feat, reqs, opts);
1501  return converter;
1502 }
1503 
1504 
1506 {
1510  CTblEditDlg *dlg = new CTblEditDlg(this, m_TopSeqEntry, converter, NULL, SYMBOL_CTBLEDITDLG_IDNAME, wxT("Microsatellites"));
1511  HandleBulkCmdDlg(dlg);
1512  } else {
1514  HandleBulkCmdDlg(dlg);
1515  }
1516 }
1517 
1518 
1520 {
1521  wxWindow* main_window = NULL;
1522  CWorkbench* wb_frame = dynamic_cast<CWorkbench*>(m_Workbench);
1523  if (wb_frame)
1524  main_window = wb_frame->GetMainWindow();
1525  CVectorTrimDlg* dlg = new CVectorTrimDlg(main_window, m_TopSeqEntry, m_CmdProcessor);
1526  dlg->Show(true);
1527 }
1528 
1529 
1531 {
1533 }
1534 
1535 
1537 {
1539 
1541  if (cmd) {
1542  string message = "Do you want to clear " + GetWizardTypeName(prev_wizard_type) + "-specific data?";
1543  wxMessageDialog dlg(this, ToWxString (message), wxT("Clear Data"), wxYES_NO|wxCANCEL|wxYES_DEFAULT);
1544  int answer = dlg.ShowModal();
1545  if (answer == wxID_CANCEL) {
1546  return prev_wizard_type;
1547  } else if (answer == wxID_NO) {
1548  cmd.Reset(NULL);
1549  }
1550  }
1551 
1552  if (m_TopSeqEntry) {
1553  string val = GetWizardFieldFromSeqEntry(m_TopSeqEntry, string(kMoleculeType) + " Confirmed");
1554  if (!NStr::EqualNocase(val, "Yes")) {
1555  if (wizard_type == CSourceRequirements::eWizardType_d_loop) {
1556  CMolInfoTableCommandConverter *converter = new CMolInfoTableCommandConverter(wizard_type);
1559  bool all_same = AreAllColumnValuesTheSame(col, "");
1560  bool any_missing = AreAnyColumnValuesMissing (col);
1561  if (all_same && any_missing) {
1563  if (cmd) {
1564  cmd->AddCommand(*(converter->GetCommandFromValuesTable(table, m_TopSeqEntry, false)));
1565  } else {
1566  cmd = converter->GetCommandFromValuesTable(table, m_TopSeqEntry, false);
1567  }
1568  }
1569  delete converter;
1570  } else if (prev_wizard_type == CSourceRequirements::eWizardType_d_loop) {
1571  CMolInfoTableCommandConverter *converter = new CMolInfoTableCommandConverter(wizard_type);
1574  bool all_same = AreAllColumnValuesTheSame(col, "");
1575  bool any_missing = AreAnyColumnValuesMissing (col);
1576  if (all_same && !any_missing && NStr::EqualNocase(col->GetData().GetString()[0], kDefaultMoleculeType)) {
1577  SetColumnValue(col, "");
1578  if (cmd) {
1579  cmd->AddCommand(*(converter->GetCommandFromValuesTable(table, m_TopSeqEntry, false)));
1580  } else {
1581  cmd = converter->GetCommandFromValuesTable(table, m_TopSeqEntry, false);
1582  }
1583  }
1584  delete converter;
1585  }
1586  }
1587  }
1588 
1590 
1591  if (m_MainPanel) {
1593 
1594  switch (wizard_type) {
1603  break;
1604  default:
1606  break;
1607  }
1608  }
1609 
1610  if (cmd) {
1612  } else {
1614  }
1615  // if only one set type allowed, set it here
1617  || wizard_type == CSourceRequirements::eWizardType_tsa) {
1618  if (m_TopSeqEntry.IsSet()
1619  && (!m_TopSeqEntry.GetSet().IsSetClass()
1620  || m_TopSeqEntry.GetSet().GetClass() == objects::CBioseq_set::eClass_not_set)) {
1621  objects::CBioseq_set_Handle beh = m_TopSeqEntry.GetSet();
1622  // create command
1623  CRef<objects::CBioseq_set> new_set(new objects::CBioseq_set());
1624  new_set->Assign(*(beh.GetCompleteBioseq_set()));
1625  new_set->SetClass(objects::CBioseq_set::eClass_genbank);
1626  CCmdChangeBioseqSet *set_cmd = new CCmdChangeBioseqSet(beh, *new_set);
1627  cmd->AddCommand(*set_cmd);
1628  }
1629  }
1631  return wizard_type;
1632 }
1633 
1634 
1635 void CSubPrep_panel::SetSourceType(string src_type)
1636 {
1639 }
1640 
1641 
1642 /*!
1643  * wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_SET_CHOICE
1644  */
1645 
1646 void CSubPrep_panel::OnChangeSet( wxCommandEvent& event )
1647 {
1648  if (m_TopSeqEntry && m_TopSeqEntry.IsSet()) {
1649  objects::CBioseq_set::TClass old_class = objects::CBioseq_set::eClass_not_set;
1650  if (m_TopSeqEntry.GetSet().IsSetClass()) {
1651  old_class = m_TopSeqEntry.GetSet().GetClass();
1652  }
1653  objects::CBioseq_set::TClass new_class = objects::CBioseq_set::eClass_not_set;
1654  string new_val = ToStdString(event.GetString());
1655  if (NStr::Find (new_val, "Population") != string::npos) {
1656  new_class = objects::CBioseq_set::eClass_pop_set;
1657  } else if (NStr::Find (new_val, "Phylogenetic") != string::npos) {
1658  new_class = objects::CBioseq_set::eClass_phy_set;
1659  } else if (NStr::Find (new_val, "Mutation") != string::npos) {
1660  new_class = objects::CBioseq_set::eClass_mut_set;
1661  } else if (NStr::Find (new_val, "Environmental set") != string::npos) {
1662  new_class = objects::CBioseq_set::eClass_eco_set;
1663  } else if (NStr::Find (new_val, "Batch") != string::npos) {
1664  new_class = objects::CBioseq_set::eClass_genbank;
1665  }
1666 
1667  if (new_class != old_class && new_class != objects::CBioseq_set::eClass_not_set) {
1668  objects::CBioseq_set_Handle beh = m_TopSeqEntry.GetSet();
1669  // create command
1670  CRef<objects::CBioseq_set> new_set(new objects::CBioseq_set());
1671  new_set->Assign(*(beh.GetCompleteBioseq_set()));
1672  new_set->SetClass(new_class);
1673  CCmdChangeBioseqSet *cmd = new CCmdChangeBioseqSet(beh, *new_set);
1674 
1675  // execute command
1677  }
1678  }
1679 }
1680 
1681 
1682 static bool s_MatchesFieldName (string field_name, string label)
1683 {
1684  NStr::ReplaceInPlace(label, " ", "");
1685  NStr::ReplaceInPlace(label, "\n", "");
1686  NStr::ReplaceInPlace(field_name, " ", "");
1687  NStr::ReplaceInPlace(field_name, "\n", "");
1688  return NStr::EqualNocase(field_name, label);
1689 }
1690 
1691 
1693 {
1694  CTableCommandConverter* converter = NULL;
1695  if (NStr::FindNoCase(field_name, "primer") != string::npos) {
1696  converter = new CPrimerTableCommandConverter();
1697  } else if (s_MatchesFieldName(field_name, kChimeraLabel)) {
1700  } else if (s_MatchesFieldName(field_name, kAssemblyDescription)) {
1702  } else if (s_MatchesFieldName(field_name, kMoleculeType) || s_MatchesFieldName(field_name, kTopology)) {
1704  converter = new CMolInfoTableCommandConverter(wizard_type);
1705  } else if (s_MatchesFieldName(field_name, kLocation) || s_MatchesFieldName(field_name, kGenome)) {
1708  converter = new CGenomeTableCommandConverter (wizard_type, src_type);
1709  }
1710  if (!converter) {
1711  for (vector<string>::iterator it = m_DBLinkFields.begin(); it != m_DBLinkFields.end(); it++) {
1712  if (NStr::EqualNocase(*it, field_name)) {
1713  vector<string> fields;
1714  fields.push_back(field_name);
1715  converter = new CDBLinkTableCommandConverter(fields);
1716  break;
1717  }
1718  }
1719  }
1720 
1721  return converter;
1722 }
1723 
1724 
1726 {
1727  dlg->Show(true);
1728 /* bool done = false;
1729  while (!done) {
1730  if (dlg.ShowModal() == wxID_OK) {
1731  CRef<CCmdComposite> cmd = dlg.GetCommand();
1732  if (cmd) {
1733  if (!NStr::IsBlank(label)) {
1734  cmd->AddCommand(*SetWizardFieldInSeqEntry(m_TopSeqEntry, label + " Confirmed", "Yes"));
1735  }
1736  m_CmdProcessor->Execute(cmd);
1737  dlg.Close();
1738  done = true;
1739  } else {
1740  wxString error = ToWxString(dlg.GetErrorMessage());
1741  wxMessageBox(error, wxT("Error"),
1742  wxOK | wxICON_ERROR, this);
1743  }
1744  } else {
1745  done = true;
1746  }
1747  }
1748 */
1749 }
1750 
1751 
1753 {
1755  GetProductToCDSMap(m_TopSeqEntry.GetScope(), product_to_cds);
1756  CRef<CCmdComposite> delete_features_cmd(new CCmdComposite("Remove All Features"));
1757  size_t count = 0;
1758  // only delete features on nucleotide sequences, protein features are automatically removed with the coding region
1759  CBioseq_CI bi(m_TopSeqEntry, objects::CSeq_inst::eMol_na);
1760  while (bi) {
1761  CFeat_CI it(*bi);
1762  while (it) {
1763  CRef<CCmdComposite> cmd = GetDeleteFeatureCommand(it->GetSeq_feat_Handle(), true, product_to_cds);
1764  delete_features_cmd->AddCommand(*cmd);
1765  count++;
1766  ++it;
1767  }
1768  ++bi;
1769  }
1770  if (count > 0) {
1771  if (wxMessageBox(ToWxString("Are you sure you want to remove " + NStr::NumericToString(count) + " features?"), wxT("Are you sure?"),
1772  wxOK | wxCANCEL, this) == wxOK) {
1773  m_CmdProcessor->Execute(delete_features_cmd);
1774  }
1775  } else {
1776  wxMessageBox(_("No features found!"), wxT("Error"),
1777  wxOK | wxICON_ERROR, this);
1778  }
1779 }
1780 
1781 
1782 /*!
1783  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON13
1784  */
1785 
1786 void CSubPrep_panel::OnClickVectorTrim( wxCommandEvent& event )
1787 {
1789 }
1790 
1791 
1793 {
1794  CImportFeatTable::ShowTableInfo(); // show informative message
1797  if (!cmd)
1798  return;
1799 
1801 }
1802 
1803 
1805 {
1807  validator::CValidator validator(*objmgr);
1808  unsigned int options = validator::CValidator::eVal_validate_id_set
1809  | validator::CValidator::eVal_use_entrez;
1810  CConstRef<CValidError> eval = validator.Validate(m_TopSeqEntry, options);
1811  if (eval->TotalSize() > 0) {
1812  wxMessageBox(wxT("File has been saved, but validation errors were found. Please try to correct these before submitting."), wxT("Error"),
1813  wxOK | wxICON_ERROR, this);
1814  }
1815 
1816 }
1817 
1818 
1819 const string kNotReadyForSubmission = "Warning: This submission is not ready to be submitted to GenBank. Do not submit this file until all required information is provided.";
1820 const string kSubmissionStatus = "Submission Status";
1821 const string kSubmissionOk = "OK";
1822 
1823 /*!
1824  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SAVE_BTN
1825  */
1826 
1827 void CSubPrep_panel::OnSaveBtnClick( wxCommandEvent& event )
1828 {
1829  // clean before saving
1830  CCleanup cleanup;
1831  CScope& scope = m_TopSeqEntry.GetScope();
1832  cleanup.SetScope(&scope);
1833 
1834  // perform BasicCleanup
1835  try {
1836  CConstRef<CCleanupChange> changes = cleanup.BasicCleanup (const_cast<CSeq_entry& >(*(m_TopSeqEntry.GetCompleteSeq_entry())));
1837  } catch (CException& e) {
1838  LOG_POST(Error << "error in cleanup: " << e.GetMsg());
1839  }
1840 
1841  if (!m_SubmissionOk) {
1842  if (wxMessageBox(ToWxString(kNotReadyForSubmission + " Do you want to save an intermediate file to complete later?"), wxT("Warning"),
1843  wxOK | wxCANCEL | wxICON_WARNING, this) == wxCANCEL) {
1844  return;
1845  }
1847  } else {
1849  }
1850 
1851  wxString extensions = GetAsnSqnExtensions();
1852  wxFileDialog asn_save_file(this, wxT("Select a file"), m_SaveFileDir, m_SaveFileName,
1853  //CFileExtensions::GetDialogFilter(CFileExtensions::kASN) + wxT("|") +
1854  wxT("ASN.1 files (")+extensions + wxT(")|") + extensions + wxT("|") +
1856  wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
1857 
1858  if (asn_save_file.ShowModal() == wxID_OK)
1859  {
1860  wxString path = asn_save_file.GetPath();
1861  wxString name = asn_save_file.GetFilename();
1862 
1863  name.Trim(false);
1864  name.Trim(true);
1865 
1866  if (name.IsEmpty())
1867  {
1868  wxMessageBox(wxT("Please, select file name"), wxT("Error"),
1869  wxOK | wxICON_ERROR, this);
1870  return;
1871  }
1872 
1873  if (name.Find(wxUniChar('.')) == wxNOT_FOUND)
1874  {
1875  path += wxT(".sqn");
1876  name += wxT(".sqn");
1877  }
1878 
1879  ios::openmode mode = ios::out;
1880  CNcbiOfstream os(path.fn_str(), mode);
1881  if (!os)
1882  {
1883  wxMessageBox(wxT("Cannot open file ")+name, wxT("Error"),
1884  wxOK | wxICON_ERROR, this);
1885  return;
1886  }
1887  os << MSerial_AsnText;
1888 
1889  const CSerialObject* so = NULL;
1890  CConstRef<CSeq_entry> seq_entry;
1891  if (m_SeqSubmit) so = m_SeqSubmit.GetPointer();
1892  else
1893  {
1894  if (m_TopSeqEntry)
1895  seq_entry = m_TopSeqEntry.GetSeq_entryCore();
1896  if (seq_entry)
1897  so = seq_entry.GetPointer();
1898  }
1899 
1900  if (so)
1901  os << *so;
1902  m_SaveFileDir = asn_save_file.GetDirectory();
1903  m_SaveFileName = name;
1904  m_DataIsSaved = true;
1905  if (m_SubmissionOk) {
1907  }
1908  }
1909 }
1910 
1911 
1912 /*!
1913  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON16
1914  */
1915 
1916 void CSubPrep_panel::OnRemoveSequencesClick( wxCommandEvent& event )
1917 {
1919 
1920  if (dlg.ShowModal() == wxID_OK) {
1922  if (cmd) {
1924  }
1925  }
1926 
1927 }
1928 
1929 
1930 /*!
1931  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ADD_SEQUENCE_BTN
1932  */
1933 
1934 void CSubPrep_panel::OnAddSequenceBtnClick( wxCommandEvent& event )
1935 {
1936  CRef<CFileLoadWizard> fileManager(new CFileLoadWizard());
1937  vector<string> format_ids;
1938  format_ids.push_back("file_loader_fasta");
1939  format_ids.push_back("file_loader_asn");
1940  format_ids.push_back("file_loader_text_align");
1941  fileManager->LoadFormats(format_ids);
1942 
1943  vector<CIRef<IOpenObjectsPanelClient> > loadManagers;
1944  loadManagers.push_back(CIRef<IOpenObjectsPanelClient>(fileManager.GetPointer()));
1945 
1946  COpenObjectsDlg dlg(NULL);
1947  dlg.SetSize(710, 480);
1948 
1949  dlg.SetRegistryPath("Dialogs.Edit.OpenTable");
1950  dlg.SetManagers(loadManagers);
1951 
1952  if (dlg.ShowModal() == wxID_OK) {
1953  CIRef<IObjectLoader> object_loader(dlg.GetObjectLoader());
1954  if (!object_loader) {
1955  wxMessageBox(wxT("Failed to get object loader"), wxT("Error"),
1956  wxOK | wxICON_ERROR);
1957  } else {
1958  IExecuteUnit* execute_unit = dynamic_cast<IExecuteUnit*>(object_loader.GetPointer());
1959  if (execute_unit) {
1960  if (!execute_unit->PreExecute())
1961  return;
1962 
1963  if (!GUI_AsyncExecUnit(*execute_unit, wxT("Reading file(s)...")))
1964  return; // Canceled
1965 
1966  if (!execute_unit->PostExecute())
1967  return;
1968  }
1969  CRef<CCmdComposite> cmd (new CCmdComposite("Import File"));
1970  const IObjectLoader::TObjects& objects = object_loader->GetObjects();
1971  bool has_nuc = false;
1972  bool has_prot = false;
1973  bool success = true;
1974  CRef<objects::CSeq_entry> entry_to_add(new objects::CSeq_entry());
1975  entry_to_add->SetSet().SetClass(objects::CBioseq_set::eClass_genbank);
1976  CRef<objects::CSubmit_block> block_to_add(NULL);
1978  const CObject& ptr = obj_it->GetObject();
1979  const objects::CSeq_entry* entry = dynamic_cast<const objects::CSeq_entry*>(&ptr);
1980  if (entry) {
1981  CRef<objects::CSeq_entry> add(new objects::CSeq_entry());
1982  add->Assign(*entry);
1983  entry_to_add->SetSet().SetSeq_set().push_back(add);
1984  } else {
1985  const objects::CSeq_submit* submit = dynamic_cast<const objects::CSeq_submit*>(&ptr);
1986  if (submit) {
1987  ITERATE (objects::CSeq_submit::TData::TEntrys, sit, submit->GetData().GetEntrys()) {
1988  CRef<objects::CSeq_entry> add(new objects::CSeq_entry());
1989  add->Assign(**sit);
1990  entry_to_add->SetSet().SetSeq_set().push_back(add);
1991  }
1992  if (submit->IsSetSub() && !m_SeqSubmit && !block_to_add) {
1993  if (!block_to_add) {
1994  block_to_add.Reset(new objects::CSubmit_block());
1995  block_to_add->Assign(submit->GetSub());
1996  }
1997  }
1998  } else {
1999  const objects::CSubmit_block* block = dynamic_cast<const objects::CSubmit_block*>(&ptr);
2000  if (block) {
2001  if (!block_to_add) {
2002  block_to_add.Reset(new objects::CSubmit_block());
2003  block_to_add->Assign(*block);
2004  }
2005  } else {
2006  const objects::CSeqdesc* desc = dynamic_cast<const objects::CSeqdesc*>(&ptr);
2007  if (desc) {
2008  CRef<objects::CSeqdesc> new_desc(new objects::CSeqdesc());
2009  new_desc->Assign(*desc);
2010  CIRef<IEditCommand> cmdAddDesc(new CCmdCreateDesc(m_TopSeqEntry, *new_desc));
2011  cmd->AddCommand(*cmdAddDesc);
2012  }
2013  }
2014  }
2015  }
2016  if (!success) {
2017  break;
2018  }
2019  }
2020  if (objects.size() == 0) {
2021  success = false;
2022  wxMessageBox(wxT("Unable to read from file"), wxT("Error"),
2023  wxOK | wxICON_ERROR, this);
2024  } else {
2025  if (entry_to_add->GetSet().IsSetSeq_set() && entry_to_add->GetSet().GetSeq_set().size() > 0) {
2026  CRef<objects::CSeq_table> new_ids = GetIdsFromSeqEntry(*entry_to_add);
2027  CRef<objects::CSeq_table> old_ids = GetIdsFromSeqEntry(*(m_TopSeqEntry.GetCompleteSeq_entry()));
2028  CRef<objects::CSeqTable_column> problems = GetSeqIdProblems(new_ids, old_ids, 100);
2029  if (problems) {
2030  if (wxMessageBox(ToWxString(SummarizeIdProblems(problems) + " Do you want to fix the new sequence IDs?"), wxT("Error"),
2031  wxOK | wxCANCEL | wxICON_ERROR, this) == wxCANCEL) {
2032  success = false;
2033  } else {
2034  CSeqIdFixDlg dlg(NULL, entry_to_add, m_TopSeqEntry.GetCompleteSeq_entry());
2035  bool done = false;
2036  while (!done) {
2037  if (dlg.ShowModal() == wxID_OK) {
2039  if (repl_ids) {
2040  ApplyReplacementIds (*entry_to_add, repl_ids);
2041  dlg.Close();
2042  done = true;
2043  }
2044  } else {
2045  done = true;
2046  success = false;
2047  }
2048  }
2049  }
2050  }
2051  if (success) {
2052  bool create_general_only = objects::edit::IsGeneralIdProtPresent(m_TopSeqEntry);
2053  success = AddSeqEntryToSeqEntry(entry_to_add, m_TopSeqEntry, cmd, has_nuc, has_prot, create_general_only);
2054  }
2055  }
2056  }
2057  if (success) {
2058  if (block_to_add) {
2059  if (!m_SeqSubmit) {
2061  }
2062  m_SeqSubmit->SetSub().Assign(*block_to_add);
2063  }
2066  }
2067  }
2068  }
2069 }
2070 
2071 
2072 /*!
2073  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_REORDER_SEQ
2074  */
2075 
2076 void CSubPrep_panel::OnReorderSeqClick( wxCommandEvent& event )
2077 {
2079  if (dlg.ShowModal() == wxID_OK)
2080  {
2082  if (cmd) m_CmdProcessor->Execute(cmd);
2083  dlg.Close();
2084  }
2085 }
2086 
2087 
2088 /*!
2089  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FLATFILE
2090  */
2091 
2092 void CSubPrep_panel::OnFlatfileClick( wxCommandEvent& event )
2093 {
2094  static const string sViewType("Text View");
2095 
2097  if (m_SeqSubmit) {
2098  objects.push_back(SConstScopedObject(m_SeqSubmit, &m_TopSeqEntry.GetScope()));
2099  } else {
2100  objects.push_back(SConstScopedObject(m_TopSeqEntry.GetCompleteObject(), &m_TopSeqEntry.GetScope()));
2101  }
2102 
2103  if (!objects.front().object)
2104  return;
2105 
2107  IProjectView* projectView = prjSrv->FindView(*objects.front().object, sViewType);
2108  if (projectView != 0) {
2109  prjSrv->ActivateProjectView(projectView);
2110  } else {
2111  CRef<CUser_object> params(new CUser_object());
2113  type->SetStr("TextViewParams");
2114  params->SetType(*type);
2115 
2116  CUser_object::TData& data = params->SetData();
2117 
2118  {{
2119  CRef<CUser_field> param(new CUser_field());
2121  label->SetStr("TextViewType");
2122  param->SetLabel(*label);
2123  param->SetData().SetStr("Flat File");
2124  data.push_back(param);
2125  }}
2126 
2127  {{
2128  CRef<CUser_field> param(new CUser_field());
2130  label->SetStr("ExpandAll");
2131  param->SetLabel(*label);
2132  param->SetData().SetBool(true);
2133  data.push_back(param);
2134  }}
2135 
2136  {{
2137  CRef<CUser_field> param(new CUser_field());
2139  label->SetStr("TrackSelection");
2140  param->SetLabel(*label);
2141  param->SetData().SetBool(true);
2142  data.push_back(param);
2143  }}
2144 
2145  prjSrv->AddProjectView(sViewType, objects, params);
2146  }
2147 }
2148 
2149 
2150 /*!
2151  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PREV_BTN
2152  */
2153 
2154 void CSubPrep_panel::OnPrevBtnClick( wxCommandEvent& event )
2155 {
2156  m_Book->AdvanceSelection(false);
2157 }
2158 
2159 
2160 /*!
2161  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_NEXT_BTN
2162  */
2163 
2164 void CSubPrep_panel::OnNextBtnClick( wxCommandEvent& event )
2165 {
2166  m_Book->AdvanceSelection(true);
2167 }
2168 
2169 
2170 /*!
2171  * wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED event handler for ID_NOTEBOOK
2172  */
2173 
2174 void CSubPrep_panel::OnNotebookPageChanged( wxNotebookEvent& event )
2175 {
2176  x_SetNextPrevBtns();
2177 }
2178 
2179 
2180 /*!
2181  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_VALIDATE
2182  */
2183 
2184 void CSubPrep_panel::OnValidateClick( wxCommandEvent& event )
2185 {
2186  static const string sViewType("Validate Table View");
2187 
2189  if (m_SeqSubmit) {
2190  objects->GetData().push_back(SConstScopedObject(m_SeqSubmit, &m_TopSeqEntry.GetScope()));
2191  } else {
2192  objects->GetData().push_back(SConstScopedObject(m_TopSeqEntry.GetCompleteObject(), &m_TopSeqEntry.GetScope()));
2193  }
2194 
2195  if (!objects->GetData().front().object)
2196  return;
2197 
2199  IProjectView* projectView = prjSrv->FindView(*(objects->GetData().front().object), sViewType);
2200  if (projectView != 0) {
2201  prjSrv->ActivateProjectView(projectView);
2202  //!! send this message only when it's known that validated data has been really changed,
2203  //!! otherwise unneeded validations may take place
2204  if(true) {
2205  // send a message to the validate view that is it should re-read it's data and refresh itself
2207  Send(&evt, ePool_Default);
2208  }
2209  } else {
2210  prjSrv->AddProjectView(sViewType, objects->GetData(), 0);
2211  }
2212 }
2213 
2214 
2215 /*!
2216  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_START_NEW
2217  */
2218 
2219 void CSubPrep_panel::OnStartNewClick( wxCommandEvent& event )
2220 {
2221  if (m_TopSeqEntry.IsSet() && m_TopSeqEntry.GetSet().IsEmptySeq_set() && !m_TopSeqEntry.GetSet().IsSetDescr()) {
2222  wxMessageDialog dlg(this, wxT("No information to clear. You may start entering data now."), wxT("Clear Data"), wxOK);
2223  dlg.ShowModal();
2224  return;
2225  }
2226 
2227  if (!m_DataIsSaved) {
2228  wxMessageDialog dlg(this, wxT("You have not saved the most recent changes to this submission. Are you sure you want to abandon this and start a new submission?"), wxT("Clear Data"), wxOK|wxCANCEL);
2229  int answer = dlg.ShowModal();
2230  if (answer == wxID_CANCEL) {
2231  return;
2232  }
2233  }
2234  m_Book->RemovePage(1);
2235  m_MainPanel = NULL;
2236  m_SeqSubmit.Reset();
2237  objects::CSeq_entry_EditHandle th = m_TopSeqEntry.GetEditHandle();
2238  th.SetSet().Reset();
2239  while (!m_TopSeqEntry.GetSet().IsEmptySeq_set()) {
2240  CRef<objects::CSeq_entry> e = m_TopSeqEntry.GetSet().GetCompleteBioseq_set()->GetSeq_set().front();
2241  objects::CSeq_entry_EditHandle eh = m_TopSeqEntry.GetScope().GetSeq_entryEditHandle(*e);
2242  eh.Remove();
2243  }
2245 
2246 }
2247 
2248 
2249 /*!
2250  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LOOKUP_TAXONOMY
2251  */
2252 
2253 void CSubPrep_panel::OnLookupTaxonomyClick( wxCommandEvent& event )
2254 {
2257 }
2258 
2259 
2260 /*!
2261  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON17
2262  */
2263 
2264 void CSubPrep_panel::OnButton17Click( wxCommandEvent& event )
2265 {
2266  if (m_TopSeqEntry.IsSet() && m_TopSeqEntry.GetSet().IsEmptySeq_set() && !m_TopSeqEntry.GetSet().IsSetDescr()) {
2267  // nothing to clear
2268  } else {
2269  if (!m_DataIsSaved) {
2270  wxMessageDialog dlg(this, wxT("You have not saved the most recent changes to this submission. Are you sure you want to abandon this and start a new submission?"), wxT("Clear Data"), wxOK|wxCANCEL);
2271  int answer = dlg.ShowModal();
2272  if (answer == wxID_CANCEL) {
2273  return;
2274  }
2275  }
2276  if (m_MainPanel != NULL) {
2277  m_Book->RemovePage(1);
2278  m_MainPanel = NULL;
2279  }
2280  m_SeqSubmit.Reset();
2281  objects::CSeq_entry_EditHandle th = m_TopSeqEntry.GetEditHandle();
2282  th.SetSet().Reset();
2283  while (!m_TopSeqEntry.GetSet().IsEmptySeq_set()) {
2284  CRef<objects::CSeq_entry> e = m_TopSeqEntry.GetSet().GetCompleteBioseq_set()->GetSeq_set().front();
2285  objects::CSeq_entry_EditHandle eh = m_TopSeqEntry.GetScope().GetSeq_entryEditHandle(*e);
2286  eh.Remove();
2287  }
2289  }
2290  OnAddSequenceBtnClick(event);
2291 }
2292 
2293 
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.
bool GUI_AsyncExecUnit(IExecuteUnit &exec_unit, const wxString &msg)
Definition: async_call.cpp:53
bool IsGeneralIdProtPresent(objects::CSeq_entry_Handle tse)
CBioseq_CI –.
Definition: bioseq_ci.hpp:69
void AddCommand(IEditCommand &command)
virtual void SetRegistryPath(const string &path)
Definition: dialog.cpp:59
CFeat_CI –.
Definition: feat_ci.hpp:64
virtual CRef< objects::CSeq_table > GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh)
virtual CRef< objects::CSeqTable_column > MakeProblemsColumn(CRef< objects::CSeq_table > values_table)
static wxString GetDialogFilter(EFileType fileType)
static string MakeKey(const string &section, const string &key, const string &delim=CGuiRegistry::kDecimalDot)
create a key from a section and a subkey
Definition: registry.cpp:504
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
CRegistryReadView GetReadView(const string &section) const
get a read-only view at a particular level.
Definition: registry.cpp:428
CIRef< IEditCommand > ImportFeaturesFromFile(const wxString &workDir=wxEmptyString, const string &format_id=kEmptyStr)
static void ShowTableInfo()
virtual CRef< objects::CSeq_table > GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh)
virtual CRef< CCmdComposite > GetCommandFromValuesTable(CRef< objects::CSeq_table >, objects::CSeq_entry_Handle seh)
CObjectFor –.
Definition: ncbiobj.hpp:2335
CObject –.
Definition: ncbiobj.hpp:180
IObjectLoader * GetObjectLoader()
void SetManagers(vector< CIRef< IOpenObjectsPanelClient > > &managers)
CProjectService - a service providing API for operations with Workspaces and Projects.
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
CRef< CCmdComposite > GetCommand()
CRef< CCmdComposite > GetCommand()
virtual bool Show(bool show=1)
Report opening events in dialogs used in the editing package.
CScope –.
Definition: scope.hpp:92
CRef< objects::CSeq_table > GetReplacementTable()
Definition: Seq_entry.hpp:56
Base class for all serializable objects.
Definition: serialbase.hpp:150
CRef< objects::CSeqTable_column > CheckSourceQuals(CRef< objects::CSeq_table > values_table)
virtual CRef< CCmdComposite > ClearAllValues(objects::CSeq_entry_Handle seh)
virtual CRef< objects::CSeq_table > GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh)
CSourceRequirements::EWizardType GetWizardTypeFromCtrl()
void OnButton17Click(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON17
static bool ShowToolTips()
Should we show tooltips?
string x_CheckSourceQuals(CSourceRequirements::EWizardType wizard_type)
CSubPrepIntroPanel * m_IntroPanel
CSubmissionPrepMainPanel * m_MainPanel
static string GetWizardTypeName(unsigned int wizard_type)
wxBoxSizer * m_StarExplanation
static string GetWizardFieldFromSeqEntry(objects::CSeq_entry_Handle entry, string field_name)
CRef< objects::CSubmit_block > GetSubmitBlock()
wxStaticText * m_SequenceCount
CRef< objects::CSeq_table > x_BuildValuesTable()
void x_CreateGenomeOptions(CSourceRequirements::EWizardType wizard_type, CSourceRequirements::EWizardSrcType src_type)
void OnStartNewClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_START_NEW
CRef< CCmdComposite > x_ClearWizardSpecificData(CSourceRequirements::EWizardType wizard_type)
wxButton * m_ValidateButton
void x_UpdateSequenceCountLabel()
static CSourceRequirements::EWizardType GetWizardTypefromSeqEntry(objects::CSeq_entry_Handle entry)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
vector< size_t > x_GetSequenceLengths(CRef< objects::CSeq_table > table)
void OnSaveBtnClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SAVE_BTN
void ImportFeatureTableFile()
CRef< objects::CSeq_submit > m_SeqSubmit
void SetSubmissionNotReady(string error)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void OnRemoveSequencesClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON16
bool x_NeedTopology(CSourceRequirements::EWizardType wizard_type, CMolInfoTableCommandConverter *converter)
wxStaticText * m_Status
void OnAddSequenceBtnClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ADD_SEQUENCE_BTN
CSubPrep_panel()
Constructors.
string GetWizardTypeField()
bool OkToBulkEditSeqTech()
wxButton * m_VectorTrimBtn
bool Create(wxWindow *parent, wxWindowID id=ID_CSUBPREP_PANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
Creation.
virtual void SaveSettings() const
void HandleBulkCmdDlg(CBulkCmdDlg *dlg, string label="")
void CreateControls()
Creates the controls and sizers.
void SetAltEmailAddress(string alt_email)
void x_ConvertToSeqSubmit()
objects::CSeqdesc_CI GetCitSubPub()
virtual void LoadSettings()
void x_SetSourceTypeOptionsForWizardType(CSourceRequirements::EWizardType wizard_type)
void OnLookupTaxonomyClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LOOKUP_TAXONOMY
static CSourceRequirements::EWizardType GuessWizardTypefromSeqEntry(objects::CSeq_entry_Handle entry)
pair< CSourceRequirements::EWizardType, string > TWizardKeyword
void OnNotebookPageChanged(wxNotebookEvent &event)
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED event handler for ID_NOTEBOOK
wxButton * m_RemoveSequencesBtn
void OnPrevBtnClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PREV_BTN
CSourceRequirements::EWizardSrcType x_GetWizardSrcTypeFromCtrls()
void OnFlatfileClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FLATFILE
void x_RefreshSubmitterInfoStatus()
bool IsSequencingTechnologyRequired(CSourceRequirements::EWizardType wizard_type)
void OnChangeSet(wxCommandEvent &event)
wxString m_SaveFileName
~CSubPrep_panel()
Destructor.
void x_CreateCommentOptions(const string &comment_label)
CTableCommandConverter * GetConverterForFieldName(string field_name)
wxButton * m_FlatfileButton
void x_LaunchVectorTrimEditor()
void OnClickVectorTrim(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON13
void Init()
Initialises member variables.
void UpdateForSeqEntryChange()
void x_CreateDBLinkOptions()
static CRef< CCmdComposite > SetWizardFieldInSeqEntry(objects::CSeq_entry_Handle entry, string field_name, string value)
void x_SetSubmissionStatus()
CSourceRequirements::EWizardType SetWizardType(CSourceRequirements::EWizardType wizard_type)
string GetWizardSrcTypeField()
TConstScopedObjects * m_InputObjects
void x_UpdateFeatureStatus(CSourceRequirements::EWizardType wizard_type)
CFeatureTableCommandConverter * x_GetMicrosatelliteTableConverter()
CRef< objects::CSeq_table > GetSeqTechTable()
wxButton * m_NextBtn
void x_CreatePrimerOptions()
void LaunchSeqTechEditor()
TWizardKeywordList m_WizardNames
bool x_IsSequencingTechnologyRequired(objects::CSeq_entry_Handle entry, CSourceRequirements::EWizardType wizard_type)
wxNotebook * m_Book
vector< bool > m_DBLinkRequired
virtual bool Layout()
vector< string > m_DBLinkUrls
void x_CreateChimeraOptions()
void SetSourceType(string src_type)
void OnNextBtnClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_NEXT_BTN
virtual bool TransferDataToWindow()
Transfer data to the window.
wxButton * m_ReorderSequencesBtn
void x_CreateWizardExtras()
wxButton * m_TaxonomyButton
objects::CSeq_entry_Handle m_TopSeqEntry
void x_CreateMoleculeOptions(CSourceRequirements::EWizardType wizard_type, CSourceRequirements::EWizardSrcType src_type)
wxString m_SaveFileDir
string m_SubmissionErrors
void OnValidateClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_VALIDATE
ICommandProccessor * m_CmdProcessor
TWizardKeywordList m_Keywords
vector< string > m_DBLinkFields
bool x_NeedUniqueMicrosatelliteNames()
wxButton * m_PrevBtn
void UpdateSubmitBlock(CRef< objects::CSubmit_block > new_block, CRef< objects::CCit_gen > new_gen, string alt_email)
IWorkbench * m_Workbench
wxButton * m_StartNewBtn
CSourceRequirements::EWizardType x_GetWizardTypeFromCtrl()
CSourceRequirements::EWizardType GetWizardType()
CSourceRequirements::EWizardSrcType x_GetWizardSrcTypefromSeqEntry(objects::CSeq_entry_Handle entry)
void x_SetSourceType(CSourceRequirements::EWizardSrcType src_type)
void OnReorderSeqClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_REORDER_SEQ
void AddField(objects::CSeq_entry_Handle seh, ICommandProccessor *processor, IWorkbench *workbench, string label, string column_name, CTableFieldCommandConverter *converter, bool must_choose=false, bool required=false, string default_val="", string url="", bool allow_mix=true)
void ShowSourceLabelStar(bool val)
CSourceRequirements::EWizardSrcType GetWizardSrcTypeFromCtrls(CSourceRequirements::EWizardType wizard_type)
void SetSourceType(CSourceRequirements::EWizardSrcType src_type)
void SetFeaturesLabel(string label)
void SetSourceTypeOptions(CSourceRequirements::EWizardType wizard_type)
CSourceRequirements::EWizardSrcType GetWizardSrcTypeFromName(string name)
void CreateSetChoice(CSourceRequirements::EWizardType wizard_type, objects::CSeq_entry_Handle seh)
void UpdateSeqTechCtrls(CSourceRequirements::EWizardType wizard_type)
void SetSourceLabel(string label)
void CreateVirusMoleculeOptions(objects::CSeq_entry_Handle seh, ICommandProccessor *processor)
void ShowChimera(objects::CSeq_entry_Handle seh, ICommandProccessor *processor, IWorkbench *workbench, bool show)
SIZE_TYPE TotalSize() const
Definition: ValidError.hpp:234
CWorkbench - default implementation of IWorkbench.
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
virtual bool PreExecute()=0
virtual bool PostExecute()=0
vector< SObject > TObjects
class IProjectView defines the abstract interface for views observing projects.
CRef< CCmdComposite > GetCommand()
Definition: map.hpp:338
Definition: set.hpp:45
size_type size() const
Definition: set.hpp:132
#define _(proto)
Definition: ct_nlmzip_i.h:78
#define ID_BUTTON16
#define ID_BUTTON13
#define ID_BUTTON17
std::ofstream out("events_result.xml")
main entry point for tests
vector< CRef< CFeatureSeqTableColumnBase > > TFeatureSeqTableColumnList
const char * kLocation
const char * kTopology
const char * kMoleculeType
const char * kDefaultMoleculeType
const char * kSequenceIdColLabel
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
static void cleanup(void)
Definition: ct_dynamic.c:30
#define false
Definition: bool.h:36
static void Init(void)
Definition: cursor6.c:76
static int type
Definition: getdata.c:31
char data[12]
Definition: iconv.c:80
#define ID_SAVE_BTN
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
Definition: ncbimisc.hpp:822
#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
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
virtual wxFrame * GetMainWindow()
returns a pointer to the main application frame window
vector< SConstScopedObject > TConstScopedObjects
Definition: objects.hpp:65
virtual bool Send(CEvent *evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default)
Sends an event synchronously.
#define MSerial_AsnText
I/O stream manipulators –.
Definition: serialbase.hpp:696
@ eContent
Definition: feature.hpp:87
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
const CSeq_feat_Handle & GetSeq_feat_Handle(void) const
Get original feature handle.
Definition: mapped_feat.hpp:71
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:1684
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
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
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
Definition: ncbistre.hpp:500
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
Definition: ncbistr.cpp:2993
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
Definition: ncbistr.cpp:106
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string (in-place)
Definition: ncbistr.cpp:3201
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
Definition: ncbistr.cpp:2891
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
Definition: ncbistr.hpp:5353
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
Definition: ncbistr.hpp:673
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
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
Definition: ncbistr.cpp:3405
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 TString & GetString(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
@ eMol_na
just a nucleic acid
Definition: Seq_inst_.hpp:113
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n th
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
END_EVENT_TABLE()
int i
#define ID_NOTEBOOK
CRef< objects::CSeq_table > BuildDBLinkValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh)
#define wxT(x)
Definition: muParser.cpp:41
mdb_mode_t mode
Definition: lmdb++.h:38
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
int ispunct(Uchar c)
Definition: ncbictype.hpp:68
The Object manager core.
#define fi
CRef< CSeqTable_column > FindSeqTableColumnByName(CRef< objects::CSeq_table > values_table, string column_name)
void SetColumnValue(CRef< CSeqTable_column > col, string val)
CSourceRequirements * GetSrcRequirements(CSourceRequirements::EWizardType wizard_type, CSourceRequirements::EWizardSrcType source_type, CRef< objects::CSeq_table > values_table)
CRef< objects::CSeq_table > GetSeqTableForSrcQualFromSeqEntry(objects::CSeq_entry_Handle seh, vector< string > qual_names)
CRef< objects::CSeq_table > GetSeqTableFromSeqEntry(objects::CSeq_entry_Handle seh)
#define row(bind, expected)
Definition: string_bind.c:73
Definition: type.c:6
static CSubPrep_panel::TWizardKeyword s_keywords[]
const string kSubmissionOk
static bool s_MatchesFieldName(string field_name, string label)
const string kChimeraLabel
const string kWizardType
const string kNotReadyForSubmission
static const string kAssemblyDescription
const string kChimeraField
const string kGenome
const string kSrcType
static int num_keywords
const string kSubmissionStatus
static const char * kTableTag
#define ID_SET_CHOICE
const string kReleaseDateConfirmed
vector< string > FindNonUniqueStrings(const vector< string > &values)
bool AreAnyColumnValuesMissing(CRef< objects::CSeqTable_column > col)
bool AreAllColumnValuesTheSame(CRef< objects::CSeqTable_column > col, string default_val="")
bool AddSeqEntryToSeqEntry(const objects::CSeq_entry *entry, objects::CSeq_entry_Handle seh, CRef< CCmdComposite > cmd, bool &has_nuc, bool &has_prot, bool create_general_only)
CSourceRequirements::EWizardType GetWizardTypeFromName(string wizard_name)
CRef< objects::CUser_object > MakeWizardObject()
CRef< objects::CSeq_table > GetIdsFromSeqEntry(const objects::CSeq_entry &entry)
vector< string > SortUniqueStrings(const vector< string > &values)
bool IsWizardObject(const objects::CUser_object &user)
void SetWizardFieldInSeqEntryNoUndo(objects::CSeq_entry_Handle entry, string field_name, string value)
wxString GetAsnSqnExtensions()
string SummarizeIdProblems(CRef< objects::CSeqTable_column > problems)
string GetFieldFromWizardObject(const objects::CUser_object &user, string field_name)
void ApplyReplacementIds(objects::CSeq_entry &entry, CRef< objects::CSeq_table > table)
bool AreAnyColumnValuesPresent(CRef< objects::CSeqTable_column > col, string default_val="")
string CheckFeatureAnnotation(objects::CSeq_entry_Handle entry, bool &is_ok)
CRef< objects::CSeqTable_column > GetSeqIdProblems(CRef< objects::CSeq_table > new_ids, CRef< objects::CSeq_table > old_ids, size_t max_len)
TWizardNameList GetWizardNameList()
#define SYMBOL_CTBLEDITDLG_IDNAME
vector< string > GetAssemblyDataFields()
done
Definition: token1.c:1
void GetProductToCDSMap(objects::CScope &scope, map< objects::CBioseq_Handle, set< objects::CSeq_feat_Handle > > &product_to_cds)
CRef< CCmdComposite > TaxonomyLookupCommand(objects::CSeq_entry_Handle seh)
CRef< CCmdComposite > GetDeleteFeatureCommand(const objects::CSeq_feat_Handle &fh, bool remove_proteins=true)
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
Modified on Fri Apr 26 16:28:35 2024 by modify_doxy.py rev. 669887