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

Go to the SVN repository for this file.

1 /* $Id: convert_feat_dlg.cpp 47479 2023-05-02 13:24:02Z ucko $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Colleen Bollin
27  */
28 
29 
30 #include <ncbi_pch.hpp>
31 
32 ////@begin includes
33 ////@end includes
34 
35 #include <objmgr/bioseq_handle.hpp>
36 #include <objmgr/bioseq_ci.hpp>
46 
47 #include <wx/stattext.h>
48 #include <wx/textctrl.h>
49 #include <wx/choice.h>
50 #include <wx/combobox.h>
51 #include <wx/msgdlg.h>
52 
53 ////@begin XPM images
54 ////@end XPM images
55 
58 
59 /*!
60  * CConvertFeatDlg type definition
61  */
62 
63 IMPLEMENT_DYNAMIC_CLASS( CConvertFeatDlg, CBulkCmdDlg )
64 
65 
66 /*!
67  * CConvertFeatDlg event table definition
68  */
69 
70 BEGIN_EVENT_TABLE( CConvertFeatDlg, CBulkCmdDlg )
71 
72 ////@begin CConvertFeatDlg event table entries
74 ////@end CConvertFeatDlg event table entries
75 
77 
78 
79 /*!
80  * CConvertFeatDlg constructors
81  */
82 
84 {
85  Init();
86 }
87 
88 CConvertFeatDlg::CConvertFeatDlg( wxWindow* parent, IWorkbench* wb, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
89  : CBulkCmdDlg(wb), m_Converter(NULL)
90 {
91  Init();
92  Create(parent, id, caption, pos, size, style);
93 }
94 
95 
96 /*!
97  * CConvertFeatDlg creator
98  */
99 
100 bool CConvertFeatDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
101 {
102 ////@begin CConvertFeatDlg creation
103  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
104  CBulkCmdDlg::Create( parent, id, caption, pos, size, style );
105 
106  CreateControls();
107  if (GetSizer())
108  {
109  GetSizer()->SetSizeHints(this);
110  }
111  Centre();
112 ////@end CConvertFeatDlg creation
113  return true;
114 }
115 
116 
117 /*!
118  * CConvertFeatDlg destructor
119  */
120 
122 {
123 ////@begin CConvertFeatDlg destruction
124 ////@end CConvertFeatDlg destruction
125 }
126 
127 
128 /*!
129  * Member initialisation
130  */
131 
133 {
134 ////@begin CConvertFeatDlg member initialisation
142  m_Constraint = NULL;
143  m_OkCancel = NULL;
144 ////@end CConvertFeatDlg member initialisation
145 }
146 
147 
148 /*!
149  * Control creation for CConvertFeatDlg
150  */
151 
153 {
154 ////@begin CConvertFeatDlg content construction
155  CConvertFeatDlg* itemCBulkCmdDlg1 = this;
156 
157  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
158  itemCBulkCmdDlg1->SetSizer(itemBoxSizer2);
159 
160  m_FeatureChoiceSizer = new wxFlexGridSizer(0, 3, 0, 0);
161  itemBoxSizer2->Add(m_FeatureChoiceSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
162 
163  wxStaticText* itemStaticText4 = new wxStaticText( itemCBulkCmdDlg1, wxID_STATIC, _("From"), wxDefaultPosition, wxDefaultSize, 0 );
164  m_FeatureChoiceSizer->Add(itemStaticText4, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
165 
166  wxStaticText* itemStaticText5 = new wxStaticText( itemCBulkCmdDlg1, wxID_STATIC, _("To"), wxDefaultPosition, wxDefaultSize, 0 );
167  m_FeatureChoiceSizer->Add(itemStaticText5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
168 
169  wxStaticText* itemStaticText6 = new wxStaticText( itemCBulkCmdDlg1, wxID_STATIC, _("Conversion Function"), wxDefaultPosition, wxDefaultSize, 0 );
170  m_FeatureChoiceSizer->Add(itemStaticText6, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
171 
172  m_FeatureTypeFrom = new CFeatureTypePanel( itemCBulkCmdDlg1, ID_CF_FEATURETYPEFROM, wxDefaultPosition, wxSize(100, 100), 0 );
173  m_FeatureChoiceSizer->Add(m_FeatureTypeFrom, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
174 
175  m_FeatureTypeTo = new CFeatureTypePanel( itemCBulkCmdDlg1, ID_CF_FEATURETYPETO, wxDefaultPosition, wxSize(100, 100), 0 );
176  m_FeatureChoiceSizer->Add(m_FeatureTypeTo, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
181 
182  m_FunctionDescriptionTxt = new wxTextCtrl( itemCBulkCmdDlg1, ID_CF_FUNCTION_DESC, wxEmptyString, wxDefaultPosition, wxSize(180, -1), wxTE_MULTILINE|wxTE_READONLY );
183  m_FeatureChoiceSizer->Add(m_FunctionDescriptionTxt, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL, 5);
184 
185  m_OptionsSizer = new wxFlexGridSizer(0, 3, 0, 0);
186  itemBoxSizer2->Add(m_OptionsSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
187 
188  wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
189  itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
190 
191  m_LeaveOriginal = new wxCheckBox( itemCBulkCmdDlg1, ID_CF_LEAVE_ORIGINAL, _("Leave original feature"), wxDefaultPosition, wxDefaultSize, 0 );
192  m_LeaveOriginal->SetValue(false);
193  itemBoxSizer3->Add(m_LeaveOriginal, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
194 
195  m_AddUnverified = new wxCheckBox( itemCBulkCmdDlg1, ID_CF_ADD_UNVERIFIED, _("Add unverified"), wxDefaultPosition, wxDefaultSize, 0 );
196  m_AddUnverified->SetValue(false);
197  itemBoxSizer3->Add(m_AddUnverified, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
198 
199  m_Constraint = new CStringConstraintPanel(itemCBulkCmdDlg1, false, ID_CF_CONSTRAINT, wxDefaultPosition, wxDefaultSize, 0);
200  itemBoxSizer2->Add(m_Constraint, 0, wxALIGN_CENTER_HORIZONTAL|wxFIXED_MINSIZE|wxALL, 0);
201 
202  m_OkCancel = new COkCancelPanel( itemCBulkCmdDlg1, ID_CF_OKC, wxDefaultPosition, wxSize(100, 100), 0 );
203  itemBoxSizer2->Add(m_OkCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
204 
205 ////@end CConvertFeatDlg content construction
206 }
207 
208 
209 /*!
210  * Should we show tooltips?
211  */
212 
214 {
215  return true;
216 }
217 
218 /*!
219  * Get bitmap resources
220  */
221 
222 wxBitmap CConvertFeatDlg::GetBitmapResource( const wxString& name )
223 {
224  // Bitmap retrieval
225 ////@begin CConvertFeatDlg bitmap retrieval
226  wxUnusedVar(name);
227  return wxNullBitmap;
228 ////@end CConvertFeatDlg bitmap retrieval
229 }
230 
231 /*!
232  * Get icon resources
233  */
234 
235 wxIcon CConvertFeatDlg::GetIconResource( const wxString& name )
236 {
237  // Icon retrieval
238 ////@begin CConvertFeatDlg icon retrieval
239  wxUnusedVar(name);
240  return wxNullIcon;
241 ////@end CConvertFeatDlg icon retrieval
242 }
243 
244 
246 {
248 
250  m_ErrorMessage = "You must select a supported conversion function.";
251  return cmd;
252  }
253 
254  x_SetOptions();
255 
256  string feat_type = m_FeatureTypeFrom->GetFieldName();
257  if (NStr::EqualNocase(feat_type, "any")) {
258  feat_type = "";
259  }
260  string field_name = "";
261  if (NStr::IsBlank(feat_type)) {
262  field_name = kPartialStart;
263  } else {
264  field_name = feat_type + " " + kPartialStart;
265  }
266 
267  CRef<CMiscSeqTableColumn> col(new CMiscSeqTableColumn(field_name));
268 
269 
271  set<string> qual_list = GetQualList();
272 
273  vector<CConstRef<CObject> > objs;
274 
276  bool ignore_selected = true;
277  if (!sel_objs.empty()) {
278  bool any_feat = false;
279  vector<CConstRef<CObject> > sel_no_match;
280  NON_CONST_ITERATE (TConstScopedObjects, it, sel_objs) {
281  const CSeq_feat * f = dynamic_cast<const CSeq_feat *>((*it).object.GetPointer());
282  if (f) {
283  any_feat = true;
284  if (m_Converter->CanConvertFrom(f->GetData().GetSubtype())) {
285  if (DoesObjectAllQualsMatchFieldConstraint (*((*it).object), qual_list, string_constraint, (*it).scope)) {
286  objs.push_back(it->object);
287  } else {
288  sel_no_match.push_back(it->object);
289  }
290  }
291  }
292  }
293  if (objs.empty() && any_feat) {
294  if (!sel_no_match.empty()) {
295  int answer = wxMessageBox(wxT("Selected features do not match constraint - apply to selected feature anyway?"),
296  wxT("Error"), wxYES_NO | wxICON_QUESTION, this);
297  if (answer == wxYES) {
298  objs = sel_no_match;
299  }
300  } else {
301  int answer = wxMessageBox(wxT("No selected features are of the correct type. Search all features?"),
302  wxT("Error"), wxYES_NO | wxICON_QUESTION, this);
303  if (answer == wxNO) {
304  m_ErrorMessage = "No features found!";
305  return cmd;
306  }
307  }
308  }
309  }
310 
311  CRef<CScope> scope(&m_TopSeqEntry.GetScope());
312 
313  if (objs.empty()) {
314  CBioseq_CI bi (m_TopSeqEntry, objects::CSeq_inst::eMol_na);
315  while (bi) {
316  vector<CConstRef<CObject> > these_objs = col->GetObjects(*bi);
317  ITERATE (vector<CConstRef<CObject> >, it, these_objs) {
318  if (DoesObjectAllQualsMatchFieldConstraint (**it, qual_list, string_constraint, scope)) {
319  objs.push_back (*it);
320  }
321  }
322  ++bi;
323  }
324  }
325 
326  if (objs.size() == 0) {
327  m_ErrorMessage = "No features found!";
328  return cmd;
329  }
330 
331  bool any_change = false;
332  set<CSeq_entry_Handle> already_done;
333  cmd.Reset(new CCmdComposite("Convert Features"));
334  bool create_general_only = objects::edit::IsGeneralIdProtPresent(m_TopSeqEntry);
335  m_Converter->SetCreateGeneralOnly(create_general_only);
336  map<CBioseq_Handle, int> bioseq_to_offset;
337  ITERATE(vector<CConstRef<CObject> >, it, objs) {
338  const CSeq_feat* f = dynamic_cast<const CSeq_feat* >((*it).GetPointer());
339  CBioseq_Handle bsh;
340  if (f->IsSetLocation())
341  {
342  bsh = scope->GetBioseqHandle(f->GetLocation());
343  if (bioseq_to_offset.find(bsh) == bioseq_to_offset.end())
344  bioseq_to_offset[bsh] = 1;
345  m_Converter->SetOffset(&bioseq_to_offset[bsh]);
346  }
347  CRef<CCmdComposite> subcmd = m_Converter->Convert(*f, m_LeaveOriginal->GetValue(), *scope);
348  if (subcmd) {
349  cmd->AddCommand(*subcmd);
350  if (bsh && m_AddUnverified->GetValue())
351  x_AddUnverified(bsh, cmd, already_done);
352  any_change = true;
353  }
354  }
355  if (!any_change) {
356  m_ErrorMessage = "All conversions failed.";
357  cmd.Reset(NULL);
358  }
359  return cmd;
360 }
361 
363 {
365  if (seh && already_done.find(seh) == already_done.end())
366  {
367  already_done.insert(seh);
368  CRef<CUser_object> user(new CUser_object());
370  user->AddUnverifiedFeature();
371  CRef<objects::CSeqdesc> new_desc( new objects::CSeqdesc );
372  new_desc->SetUser(*user);
373  cmd->AddCommand( *CRef<CCmdCreateDesc>(new CCmdCreateDesc(seh, *new_desc)) );
374  }
375 }
376 
378 {
379  set<string> res;
381  for (CEnumeratedTypeValues::TValues::const_iterator i = qual_names.begin(); i != qual_names.end(); ++i)
382  {
383  string qual_name = i->first;
384  NStr::ReplaceInPlace(qual_name,"-","_");
385  if (NStr::EqualNocase(qual_name, "gene")) {
386  qual_name = "locus";
387  }
388 
389  res.insert(qual_name);
390  }
391  res.insert("product");
392  res.insert("note");
393  return res;
394 }
395 
397 {
398  if (!string_constraint)
399  return true;
400 
401  bool negation = string_constraint->GetNegation();
402  bool res = negation;
403  string feat_type = m_FeatureTypeFrom->GetFieldName();
404  for (set<string>::const_iterator qi = qual_list.begin(); qi != qual_list.end(); ++qi)
405  {
406  string field_name = feat_type + " " + *qi;
407  CRef<CMiscSeqTableColumn> col(new CMiscSeqTableColumn(field_name));
408  if (!col) {
409  return false;
410  }
411 
412  vector<string> val_list;
413  vector<CConstRef<CObject> > objs = col->GetRelatedObjects (object, scope);
414  ITERATE(vector<CConstRef<CObject> >, it, objs)
415  {
416  vector<string> add = col->GetVals(**it);
417  val_list.insert(val_list.end(), add.begin(), add.end());
418  }
419  if (!val_list.empty())
420  {
421  if (negation)
422  res = res && string_constraint->DoesListMatch(val_list);
423  else
424  res = res || string_constraint->DoesListMatch(val_list);
425  }
426  }
427  return res;
428 }
429 
431 {
432  return m_ErrorMessage;
433 }
434 
435 
437 {
438  CSeqFeatData::ESubtype subtype;
439  if (NStr::EqualNocase(key, "gene")) {
440  subtype = CSeqFeatData::eSubtype_gene;
441  } else if (NStr::EqualNocase(key, "site")) {
442  subtype = CSeqFeatData::eSubtype_site;
443  } else if (NStr::EqualNocase(key, "region")) {
445  } else if (NStr::EqualNocase(key, "sno_RNA")) {
447  } else if (NStr::EqualNocase(key, "preprotein")) {
449  } else if (NStr::EqualNocase(key, "Mature Peptide AA")) {
451  } else if (NStr::EqualNocase(key, "Signal Peptide AA")) {
453  } else if (NStr::EqualNocase(key, "Transit Peptide AA")) {
455  } else {
457  }
458  return subtype;
459 }
460 
461 
463 {
464  string feature_from = m_FeatureTypeFrom->GetFieldName();
465  string feature_to = m_FeatureTypeTo->GetFieldName();
466 
467  if (NStr::IsBlank(feature_from) || NStr::IsBlank(feature_to)) {
468  } else {
469  CSeqFeatData::ESubtype from_subtype = s_GetFeatureSubtypeFromString(feature_from);
470  CSeqFeatData::ESubtype to_subtype = s_GetFeatureSubtypeFromString(feature_to);
471 
472  m_Converter = CConvertFeatureBaseFactory::Create(from_subtype, to_subtype);
474  }
475  x_UpdateOptions();
476 }
477 
478 void CConvertFeatDlg::ProcessUpdateFeatEvent( wxCommandEvent& event )
479 {
480  UpdateChildrenFeaturePanels(this->GetSizer());
481 }
482 
484 {
485  while (m_OptionsSizer->GetItemCount() > 0) {
486  int pos = 0;
487  m_OptionsSizer->GetItem(pos)->DeleteWindows();
488  m_OptionsSizer->Remove(pos);
489  }
490 
491  if (m_Converter) {
492  int col = 0;
493  int num_cols = m_OptionsSizer->GetCols();
495  if ((*it)->IsBool()) {
496  wxCheckBox* opt = new wxCheckBox( this, wxID_ANY, ToWxString((*it)->GetLabel()), wxDefaultPosition, wxDefaultSize, 0 );
497  m_OptionsSizer->Add(opt, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
498  opt->SetValue((*it)->GetBool()->GetDefaultVal());
499  col++;
500  } else if ((*it)->IsString()) {
501  int remaining = num_cols - col;
502  if (remaining < 2) {
503  for (int i = 0; i < remaining; i++) {
504  // add spacers
505  m_OptionsSizer->Add(5, 15, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
506  }
507  }
508 
509  wxStaticText* label = new wxStaticText( this, wxID_STATIC, ToWxString((*it)->GetLabel()), wxDefaultPosition, wxDefaultSize, 0 );
510  m_OptionsSizer->Add(label, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
511  const vector<string>& suggested_values = (*it)->GetString()->GetSuggestedValues();
512  if (suggested_values.size() == 0) {
513  wxTextCtrl* val = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(300, -1), 0 );
514  m_OptionsSizer->Add(val, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
515  val->SetValue((*it)->GetString()->GetDefaultVal());
516  } else if ((*it)->GetString()->GetOnlySuggested()) {
517  wxArrayString choice_strings;
518  ITERATE(vector<string>, sit, suggested_values) {
519  choice_strings.Add(ToWxString(*sit));
520  }
521  wxChoice* val = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, choice_strings, 0 );
522  m_OptionsSizer->Add(val, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
523  val->SetStringSelection((*it)->GetString()->GetDefaultVal());
524  } else {
525  wxArrayString choice_strings;
526  ITERATE(vector<string>, sit, suggested_values) {
527  choice_strings.Add(ToWxString(*sit));
528  }
529  wxComboBox* val = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, choice_strings, 0 );
530  m_OptionsSizer->Add(val, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
531  val->SetStringSelection((*it)->GetString()->GetDefaultVal());
532  }
533  col += 2;
534  }
535  col = col % num_cols;
536  }
537  }
538  m_OptionsSizer->Layout();
539  x_FixLayout();
540 }
541 
542 
544 {
545  Layout();
546  Fit();
547  Refresh();
548 }
549 
550 
552 {
553  if (!m_Converter) {
554  return;
555  }
556  size_t option_pos = 0;
558  for (size_t pos = 0; pos < m_OptionsSizer->GetItemCount() && option_pos < options.size(); pos++) {
559  wxWindow* w = m_OptionsSizer->GetItem(pos)->GetWindow();
560  wxCheckBox* checkbox = dynamic_cast<wxCheckBox*>(w);
561  if (checkbox) {
562  if (options[option_pos]->IsBool()) {
563  options[option_pos]->SetBool()->SetVal(checkbox->GetValue());
564  }
565  option_pos++;
566  } else {
567  wxTextCtrl* val = dynamic_cast<wxTextCtrl*>(w);
568  if (val) {
569  if (options[option_pos]->IsString()) {
570  options[option_pos]->SetString()->SetVal(ToStdString(val->GetValue()));
571  }
572  option_pos++;
573  } else {
574  wxComboBox* combo = dynamic_cast<wxComboBox*>(w);
575  if (combo) {
576  if (options[option_pos]->IsString()) {
577  options[option_pos]->SetString()->SetVal(ToStdString(combo->GetStringSelection()));
578  }
579  option_pos++;
580  } else {
581  wxChoice* choice = dynamic_cast<wxChoice*>(w);
582  if (choice) {
583  if (options[option_pos]->IsString()) {
584  options[option_pos]->SetString()->SetVal(ToStdString(choice->GetStringSelection()));
585  }
586  option_pos++;
587  }
588  }
589  }
590  }
591 
592  }
593 }
594 
595 
bool IsGeneralIdProtPresent(objects::CSeq_entry_Handle tse)
CBioseq_CI –.
Definition: bioseq_ci.hpp:69
CBioseq_Handle –.
TConstScopedObjects GetSelectedObjects()
objects::CSeq_entry_Handle m_TopSeqEntry
bool Create(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE, const wxString &name=wxFrameNameStr)
string m_ErrorMessage
bool GetTopLevelSeqEntryAndProcessor()
void UpdateChildrenFeaturePanels(wxSizer *sizer)
virtual CRef< CCmdComposite > GetCommand()
void ProcessUpdateFeatEvent(wxCommandEvent &event)
wxCheckBox * m_AddUnverified
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxFlexGridSizer * m_OptionsSizer
bool DoesObjectAllQualsMatchFieldConstraint(const CObject &object, const set< string > &qual_list, CRef< edit::CStringConstraint > string_constraint, CRef< CScope > scope)
void CreateControls()
Creates the controls and sizers.
COkCancelPanel * m_OkCancel
CFeatureTypePanel * m_FeatureTypeFrom
void Init()
Initialises member variables.
void x_AddUnverified(objects::CBioseq_Handle bsh, CRef< CCmdComposite > cmd, set< objects::CSeq_entry_Handle > &already_done)
CConvertFeatDlg()
Constructors.
wxFlexGridSizer * m_FeatureChoiceSizer
~CConvertFeatDlg()
Destructor.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
virtual string GetErrorMessage()
wxCheckBox * m_LeaveOriginal
bool Create(wxWindow *parent, wxWindowID id=10147, const wxString &caption=_("Convert Features"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
wxTextCtrl * m_FunctionDescriptionTxt
virtual void UpdateEditor()
CStringConstraintPanel * m_Constraint
set< string > GetQualList(void)
CFeatureTypePanel * m_FeatureTypeTo
CRef< CConvertFeatureBase > m_Converter
static bool ShowToolTips()
Should we show tooltips?
static CRef< CConvertFeatureBase > Create(objects::CSeqFeatData::ESubtype subtype_from, objects::CSeqFeatData::ESubtype subtype_to)
void SetCreateGeneralOnly(bool flag)
virtual bool CanConvertFrom(objects::CSeqFeatData::ESubtype subtype)
void SetOffset(int *offset)
virtual CRef< CCmdComposite > Convert(const objects::CSeq_feat &orig, bool keep_orig, objects::CScope &scope)
TOptions & SetOptions()
const TOptions & GetOptions() const
virtual string GetDescription()
vector< CRef< CConversionOption > > TOptions
void SetListAllFeats(bool flag)
virtual string GetFieldName(const bool subfield=false)
Returns the name of the field as selected in the panel.
void ListPresentFeaturesFirst(const objects::CSeq_entry_Handle &entry, vector< const objects::CFeatListItem * > *featlist=nullptr)
vector< CConstRef< CObject > > GetRelatedObjects(const CObject &object, CRef< objects::CScope > scope)
vector< string > GetVals(const CObject &object)
vector< CConstRef< CObject > > GetObjects(objects::CBioseq_Handle bsh)
CObject –.
Definition: ncbiobj.hpp:180
@ eSubtype_transit_peptide_aa
static ESubtype SubtypeNameToValue(CTempString sName)
Turn a string into its ESubtype which is NOT necessarily related to the identifier of the enum.
CSeq_entry_Handle –.
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
CRef< edit::CStringConstraint > GetStringConstraint()
void SetObjectType(EObjectType obj_type)
void AddUnverifiedFeature()
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
const_iterator end() const
Definition: map.hpp:152
const_iterator find(const key_type &key) const
Definition: map.hpp:153
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
const_iterator begin() const
Definition: set.hpp:135
const_iterator find(const key_type &key) const
Definition: set.hpp:137
const_iterator end() const
Definition: set.hpp:136
static const string kConversionNotSupported
USING_SCOPE(objects)
static CSeqFeatData::ESubtype s_GetFeatureSubtypeFromString(const string &key)
#define ID_CF_OKC
#define ID_CF_LEAVE_ORIGINAL
#define ID_CF_FEATURETYPEFROM
#define ID_CF_ADD_UNVERIFIED
#define ID_CF_FUNCTION_DESC
#define ID_CF_FEATURETYPETO
#define ID_CF_CONSTRAINT
#define _(proto)
Definition: ct_nlmzip_i.h:78
#define wxFIXED_MINSIZE
const string kPartialStart
#define EVT_UPDATE_FEATURE_LIST(id, fn)
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
static void Init(void)
Definition: cursor6.c:76
#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
list< pair< string, TEnumValueType > > TValues
Definition: enumvalues.hpp:54
vector< SConstScopedObject > TConstScopedObjects
Definition: objects.hpp:65
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
Definition: scope.cpp:95
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
Definition: ncbistr.cpp:106
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 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[]
EFeat_qual_legal
Access to EFeat_qual_legal's attributes (values, names) as defined in spec.
END_EVENT_TABLE()
int i
#define wxT(x)
Definition: muParser.cpp:41
const struct ncbi::grid::netcache::search::fields::SIZE size
const struct ncbi::grid::netcache::search::fields::KEY key
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
static static static wxID_ANY
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
Modified on Tue Apr 23 07:39:17 2024 by modify_doxy.py rev. 669887