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

Go to the SVN repository for this file.

1 /* $Id: trna_from_gene.cpp 41872 2018-10-31 15:16:50Z asztalos $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Igor Filippov
27  */
28 
29 
30 #include <ncbi_pch.hpp>
31 
32 ////@begin includes
33 ////@end includes
34 
35 #include <wx/stattext.h>
36 #include <wx/msgdlg.h>
37 #include <wx/statbox.h>
38 
42 #include <objmgr/seq_vector.hpp>
43 #include <objmgr/util/sequence.hpp>
51 
52 ////@begin XPM images
53 ////@end XPM images
54 
56 
58 
59 /*!
60  * CtRNAFromGene type definition
61  */
62 
63 IMPLEMENT_DYNAMIC_CLASS( CtRNAFromGene, CBulkCmdDlg )
64 
65 
66 /*!
67  * CtRNAFromGene event table definition
68  */
69 
70 BEGIN_EVENT_TABLE( CtRNAFromGene, CBulkCmdDlg )
71 
72 ////@begin CtRNAFromGene event table entries
73 
74 ////@end CtRNAFromGene event table entries
77 
78 
79 /*!
80  * CtRNAFromGene constructors
81  */
82 
84 {
85  Init();
86 }
87 
88 CtRNAFromGene::CtRNAFromGene( wxWindow* parent, IWorkbench* wb, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
89  : CBulkCmdDlg(wb)
90 {
91  Init();
92  Create(parent, id, caption, pos, size, style);
93 }
94 
95 
96 /*!
97  * CtRNAFromGene creator
98  */
99 
100 bool CtRNAFromGene::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
101 {
102 ////@begin CtRNAFromGene 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 CtRNAFromGene creation
113  return true;
114 }
115 
116 
117 /*!
118  * CtRNAFromGene destructor
119  */
120 
122 {
123 ////@begin CtRNAFromGene destruction
124 ////@end CtRNAFromGene destruction
125 }
126 
127 
128 /*!
129  * Member initialisation
130  */
131 
133 {
134 ////@begin CtRNAFromGene member initialisation
136  m_OkCancel = NULL;
137 ////@end CtRNAFromGene member initialisation
138  m_ErrorMessage = "";
141 }
142 
143 
144 /*!
145  * Control creation for CtRNAFromGene
146  */
147 
149 {
150 ////@begin CtRNAFromGene content construction
151  CtRNAFromGene* itemCBulkCmdDlg1 = this;
152 
153  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
154  itemCBulkCmdDlg1->SetSizer(itemBoxSizer2);
155 
156 
158 
159  wxArrayString feat_strings;
160  feat_strings.Add(_("tRNA"));
161  feat_strings.Add(_("rRNA"));
162  m_FeatureType = new wxChoice( itemCBulkCmdDlg1, wxID_ANY, wxDefaultPosition, wxDefaultSize, feat_strings, 0 );
163  m_FeatureType->SetSelection(0);
164  itemBoxSizer2->Add(m_FeatureType, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
165 
166  wxStaticBox* itemStaticBoxSizer7Static = new wxStaticBox(itemCBulkCmdDlg1, wxID_ANY, _("Source for new tRNA/rRNA product"));
167  wxStaticBoxSizer* itemBoxSizer7 = new wxStaticBoxSizer(itemStaticBoxSizer7Static, wxVERTICAL);
168  itemBoxSizer2->Add(itemBoxSizer7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
169 
170  wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
171  itemBoxSizer7->Add(itemBoxSizer8, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
172 
173  wxStaticText* stattext2 = new wxStaticText( this, wxID_STATIC, _("1st Choice"), wxDefaultPosition, wxDefaultSize, 0 );
174  itemBoxSizer8->Add(stattext2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
175  wxArrayString choice_strings;
176  choice_strings.Add(_("None"));
177  choice_strings.Add(_("locus"));
178  choice_strings.Add(_("description"));
179  choice_strings.Add(_("comment"));
180  choice_strings.Add(_("allele"));
181  choice_strings.Add(_("maploc"));
182  choice_strings.Add(_("locus_tag"));
183  choice_strings.Add(_("synonym"));
184  choice_strings.Add(_("old_locus_tag"));
185 
186 
187  m_FeatQual = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, choice_strings, 0 );
188  m_FeatQual->SetSelection(0);
189  itemBoxSizer8->Add(m_FeatQual, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
190  m_FeatQual->Bind(wxEVT_CHOICE, &CtRNAFromGene::OnSelectFeatQual, this);
191  m_Remove = new wxCheckBox( itemCBulkCmdDlg1, wxID_ANY, _("Remove if used"), wxDefaultPosition, wxDefaultSize, 0 );
192  m_Remove->SetValue(false);
193  itemBoxSizer8->Add(m_Remove, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
194 
195 
196  wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxHORIZONTAL);
197  itemBoxSizer7->Add(itemBoxSizer9, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
198  m_2ndChoice = new wxStaticText( this, wxID_STATIC, _("2nd Choice"), wxDefaultPosition, wxDefaultSize, 0 );
199  itemBoxSizer9->Add(m_2ndChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
200  m_FeatQual2 = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, choice_strings, 0 );
201  m_FeatQual2->SetSelection(0);
202  itemBoxSizer9->Add(m_FeatQual2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
203  m_FeatQual2->Bind(wxEVT_CHOICE, &CtRNAFromGene::OnSelectFeatQual, this);
204  m_FeatQual2->Disable();
205  m_Remove2 = new wxCheckBox( itemCBulkCmdDlg1, wxID_ANY, _("Remove if used"), wxDefaultPosition, wxDefaultSize, 0 );
206  m_Remove2->SetValue(false);
207  itemBoxSizer9->Add(m_Remove2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
208  m_Remove2->Disable();
209 
210  wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxHORIZONTAL);
211  itemBoxSizer7->Add(itemBoxSizer10, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
212  m_3rdChoice = new wxStaticText( this, wxID_STATIC, _("3rd Choice"), wxDefaultPosition, wxDefaultSize, 0 );
213  itemBoxSizer10->Add(m_3rdChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
214  m_FeatQual3 = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, choice_strings, 0 );
215  m_FeatQual3->SetSelection(0);
216  itemBoxSizer10->Add(m_FeatQual3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
217  m_FeatQual3->Disable();
218  m_Remove3 = new wxCheckBox( itemCBulkCmdDlg1, wxID_ANY, _("Remove if used"), wxDefaultPosition, wxDefaultSize, 0 );
219  m_Remove3->SetValue(false);
220  itemBoxSizer10->Add(m_Remove3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
221  m_Remove3->Disable();
222 
223  m_CapChangeOptions = new CCapChangePanel( itemCBulkCmdDlg1, wxID_ANY, wxDefaultPosition, wxSize(100, 100), wxSIMPLE_BORDER );
224  itemBoxSizer2->Add(m_CapChangeOptions, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
225 
226  wxStaticText* stattext4 = new wxStaticText( this, wxID_STATIC, _("Append text to name"), wxDefaultPosition, wxDefaultSize, 0 );
227  itemBoxSizer2->Add(stattext4, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
228  m_StrQual = new wxTextCtrl( itemCBulkCmdDlg1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(100, -1), 0 );
229  itemBoxSizer2->Add(m_StrQual, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxBOTTOM, 5);
230 
231 
232  m_SingleInterval = new wxCheckBox( itemCBulkCmdDlg1, wxID_ANY, _("Fuse multiple intervals for new tRNA/rRNA"), wxDefaultPosition, wxDefaultSize, 0 );
233  m_SingleInterval->SetValue(false);
234  itemBoxSizer2->Add(m_SingleInterval, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
235 
236 
237  m_FeatureConstraint = new CFeatureFieldNamePanel(itemCBulkCmdDlg1, NULL, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0);
238  itemBoxSizer2->Add(m_FeatureConstraint, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
240 
241  m_StringConstraintPanel = new CStringConstraintPanel( itemCBulkCmdDlg1, false, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
242  itemBoxSizer2->Add(m_StringConstraintPanel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxFIXED_MINSIZE, 0);
243 
244  m_OkCancel = new COkCancelPanel( itemCBulkCmdDlg1, wxID_ANY, wxDefaultPosition, wxSize(100, 100), 0 );
245  itemBoxSizer2->Add(m_OkCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
246 
247  m_CapChangeOptions->Disable();
248 ////@end CtRNAFromGene content construction
249 }
250 
251 
252 /*!
253  * Should we show tooltips?
254  */
255 
257 {
258  return true;
259 }
260 
261 /*!
262  * Get bitmap resources
263  */
264 
265 wxBitmap CtRNAFromGene::GetBitmapResource( const wxString& name )
266 {
267  // Bitmap retrieval
268 ////@begin CtRNAFromGene bitmap retrieval
269  wxUnusedVar(name);
270  return wxNullBitmap;
271 ////@end CtRNAFromGene bitmap retrieval
272 }
273 
274 /*!
275  * Get icon resources
276  */
277 
278 wxIcon CtRNAFromGene::GetIconResource( const wxString& name )
279 {
280  // Icon retrieval
281 ////@begin CtRNAFromGene icon retrieval
282  wxUnusedVar(name);
283  return wxNullIcon;
284 ////@end CtRNAFromGene icon retrieval
285 }
286 
287 
288 
290 {
291  return m_ErrorMessage;
292 }
293 
294 
296 {
298 
299  string feat_type;
300  int sel_feat = m_FeatureType->GetSelection();
301  if (sel_feat != wxNOT_FOUND)
302  {
303  feat_type = m_FeatureType->GetString(sel_feat).ToStdString();
304  }
305 
306  string field_name = "Gene " + kPartialStart;
307 
308  CRef<CMiscSeqTableColumn> col(new CMiscSeqTableColumn(field_name));
309 
311  string constraint_field = m_FeatureConstraint->GetFieldName(false);
312 
313 
314  vector<CConstRef<CObject> > objs;
315  objs = col->GetObjects(m_TopSeqEntry, constraint_field, string_constraint);
316 
317  if (objs.empty()) {
318  wxMessageBox(wxT("No features found!"), wxT("Error"),
319  wxOK | wxICON_ERROR, NULL);
320  return cmd;
321  }
322 
323  bool any_change = false;
324  CScope &scope = m_TopSeqEntry.GetScope();
325 
326 
327  bool single_interval = m_SingleInterval->GetValue();
329  cmd.Reset(new CCmdComposite("tRNA/rRNA from Gene"));
330  ITERATE(vector<CConstRef<CObject> >, it, objs)
331  {
332  const CSeq_feat* f = dynamic_cast<const CSeq_feat* >((*it).GetPointer());
333  if (f)
334  {
335  CBioseq_Handle bsh = scope.GetBioseqHandle(f->GetLocation());
336  features[bsh].push_back(f);
337  }
338  }
339 
340  for (auto &bsh_pair : features)
341  {
342  CBioseq_Handle bsh = bsh_pair.first;
343  for (size_t i = 0; i < bsh_pair.second.size(); i++)
344  {
345  const CSeq_feat* f = bsh_pair.second[i];
346  CRef<CSeq_loc> loc(new CSeq_loc());
347  loc->Assign(f->GetLocation());
348 
349  if (single_interval)
350  {
351  bool partial_start = loc->IsPartialStart(eExtreme_Positional);
352  bool partial_stop = loc->IsPartialStop(eExtreme_Positional);
355  for (size_t j = 1; j < bsh_pair.second.size(); j++)
356  {
357  const CSeq_feat* f2 = bsh_pair.second[j];
358  CRef<CSeq_loc> add_loc(new CSeq_loc);
359  add_loc->Assign(f2->GetLocation());
360  partial_stop = add_loc->IsPartialStop(eExtreme_Positional);
361  add_loc->SetPartialStart(false,eExtreme_Positional);
362  add_loc->SetPartialStop(false,eExtreme_Positional);
363  loc->Assign(*(sequence::Seq_loc_Add(*loc, *add_loc, CSeq_loc::fMerge_All|CSeq_loc::fSort, &scope)));
364  }
365  loc->SetPartialStart(partial_start,eExtreme_Positional);
366  loc->SetPartialStop(partial_stop,eExtreme_Positional);
367  }
368 
369  CRef<CSeq_feat> new_feat(new CSeq_feat());
370  if (feat_type == "tRNA")
371  new_feat->SetData().SetRna().SetType(CRNA_ref::eType_tRNA);
372  else
373  new_feat->SetData().SetRna().SetType(CRNA_ref::eType_rRNA);
374  new_feat->SetLocation(*loc);
376 
378  m_modified = false;
379  m_modified_prot = false;
380  CRef<CSeq_feat> mod_feat(new CSeq_feat());
381  mod_feat->Assign(*f);
382 
383  CRef<CSeq_feat> prot_feat;
384  CSeq_feat_Handle prot_fh;
385  if (f->IsSetProduct())
386  {
387  CBioseq_Handle prot_bsh = scope.GetBioseqHandle(f->GetProduct());
388  if (prot_bsh)
389  {
390  CFeat_CI prot_feat_ci(prot_bsh, CSeqFeatData::e_Prot);
391  if (prot_feat_ci)
392  {
393  prot_feat.Reset(new CSeq_feat);
394  prot_feat->Assign(prot_feat_ci->GetOriginalFeature());
395  prot_fh = prot_feat_ci->GetSeq_feat_Handle();
396  }
397  }
398  }
399 
400  string name = GetSuggestedName(*mod_feat, prot_feat, seh);
401  if (m_modified)
402  {
403  CSeq_feat_Handle fh = scope.GetSeq_featHandle(*f);
404  cmd->AddCommand(*CRef<CCmdChangeSeq_feat>(new CCmdChangeSeq_feat(fh,*mod_feat)));
405  }
406  if (m_modified_prot && prot_fh)
407  {
408  cmd->AddCommand(*CRef<CCmdChangeSeq_feat>(new CCmdChangeSeq_feat(prot_fh, *prot_feat)));
409  }
410 
411  //new_feat->SetData().SetRna().SetExt().SetName(name);
412  string remainder;
413  new_feat->SetData().SetRna().SetRnaProductName(name, remainder);
414  if (!NStr::IsBlank(remainder))
415  {
416  if (new_feat->IsSetComment() && !NStr::IsBlank(new_feat->GetComment()))
417  {
418  new_feat->SetComment(new_feat->GetComment() + "; " + remainder);
419  }
420  else
421  {
422  new_feat->SetComment(remainder);
423  }
424  }
425  cmd->AddCommand(*CRef<CCmdCreateFeat>(new CCmdCreateFeat(seh, *new_feat)));
426  any_change = true;
427  if (single_interval)
428  break;
429  }
430  }
431 
432 
433 
434  if (!any_change) {
435  wxMessageBox(wxT("No effect!"), wxT("Error"),
436  wxOK | wxICON_ERROR, NULL);
437  cmd.Reset(NULL);
438  }
439 
440  return cmd;
441 }
442 
443 
444 void CtRNAFromGene::OnSelectFeatQual(wxCommandEvent& event)
445 {
446  int sel1 = m_FeatQual->GetSelection();
447  if (sel1 != wxNOT_FOUND && sel1 != 0)
448  {
449  m_FeatQual2->Enable();
450  m_Remove2->Enable();
451  m_CapChangeOptions->Enable();
452  }
453  else
454  {
455  m_FeatQual2->Disable();
456  m_Remove2->Disable();
457  m_CapChangeOptions->Disable();
458  }
459 
460  int sel2 = m_FeatQual2->GetSelection();
461  if (sel2 != wxNOT_FOUND && sel2 != 0)
462  {
463  m_FeatQual3->Enable();
464  m_Remove3->Enable();
465  }
466  else
467  {
468  m_FeatQual3->Disable();
469  m_Remove3->Disable();
470  }
471 }
472 
474 {
475  string name;
476  if (feat.IsSetData() && feat.GetData().IsGene())
477  {
478  if (m_FeatQual->GetSelection() != wxNOT_FOUND)
479  GetNameFromGene(feat, m_FeatQual->GetString(m_FeatQual->GetSelection()), m_Remove->GetValue(), name);
480 
481  if (name.empty() && m_FeatQual2->IsEnabled() && m_FeatQual2->GetSelection() != wxNOT_FOUND)
482  GetNameFromGene(feat, m_FeatQual2->GetString(m_FeatQual2->GetSelection()), m_Remove2->GetValue(), name);
483 
484  if (name.empty() && m_FeatQual3->IsEnabled() && m_FeatQual3->GetSelection() != wxNOT_FOUND)
485  GetNameFromGene(feat, m_FeatQual3->GetString(m_FeatQual3->GetSelection()), m_Remove3->GetValue(), name);
486 
487  }
488 
489  name += m_StrQual->GetValue().ToStdString();
490  if (m_CapChangeOptions->IsEnabled())
491  {
493  FixCapitalizationInString(seh, name, cap_change);
494  }
495  return name;
496 }
497 
498 void CtRNAFromGene::GetNameFromGene(CSeq_feat& gene, const wxString& sel_str, bool remove, string &name)
499 {
500  string str;
501  if (sel_str == _("locus") && gene.GetData().GetGene().IsSetLocus())
502  {
503  str = gene.GetData().GetGene().GetLocus();
504  if (remove)
505  {
506  gene.SetData().SetGene().ResetLocus();
507  m_modified = true;
508  }
509  }
510 
511  if (sel_str == _("comment") && gene.IsSetComment())
512  {
513  str = gene.GetComment();
514  if (remove)
515  {
516  gene.ResetComment();
517  m_modified = true;
518  }
519  }
520 
521  if (sel_str == _("locus_tag") && gene.GetData().GetGene().IsSetLocus_tag())
522  {
523  str = gene.GetData().GetGene().GetLocus_tag();
524  if (remove)
525  {
526  gene.SetData().SetGene().ResetLocus_tag();
527  m_modified = true;
528  }
529  }
530 
531  if (sel_str == _("allele") && gene.GetData().GetGene().IsSetAllele())
532  {
533  str = gene.GetData().GetGene().GetAllele();
534  if (remove)
535  {
536  gene.SetData().SetGene().ResetAllele();
537  m_modified = true;
538  }
539  }
540 
541  if (sel_str == _("description") && gene.GetData().GetGene().IsSetDesc())
542  {
543  str = gene.GetData().GetGene().GetDesc();
544  if (remove)
545  {
546  gene.SetData().SetGene().ResetDesc();
547  m_modified = true;
548  }
549  }
550 
551  if (sel_str == _("maploc") && gene.GetData().GetGene().IsSetMaploc())
552  {
553  str = gene.GetData().GetGene().GetMaploc();
554  if (remove)
555  {
556  gene.SetData().SetGene().ResetMaploc();
557  m_modified = true;
558  }
559  }
560 
561  if (sel_str == _("synonym") && gene.GetData().GetGene().IsSetSyn() && !gene.GetData().GetGene().GetSyn().empty())
562  {
563  str = gene.GetData().GetGene().GetSyn().front();
564  if (remove)
565  {
566  gene.SetData().SetGene().SetSyn().erase(gene.SetData().SetGene().SetSyn().begin());
567  if (gene.GetData().GetGene().GetSyn().empty())
568  gene.SetData().SetGene().ResetSyn();
569  m_modified = true;
570  }
571  }
572 
573  if (sel_str == _("old_locus_tag"))
574  {
575  str = gene.GetNamedQual("old_locus_tag");
576  if (remove)
577  {
578  gene.RemoveQualifier("old_locus_tag");
579  m_modified = true;
580  }
581  }
582  if (!str.empty())
583  name = str;
584 }
585 
586 
587 void CtRNAFromGene::ProcessUpdateFeatEvent( wxCommandEvent& event )
588 {
589  UpdateChildrenFeaturePanels(this->GetSizer());
590 }
591 
593 {
594  wxSizerItemList& slist = sizer->GetChildren();
595  int n =0;
596  for (wxSizerItemList::iterator iter = slist.begin(); iter != slist.end(); ++iter, ++n) {
597  if ((*iter)->IsSizer()) {
598  UpdateChildrenFeaturePanels((*iter)->GetSizer());
599  } else if ((*iter)->IsWindow()) {
600  wxWindow* child = (*iter)->GetWindow();
601  if (child) {
602  CFeatureTypePanel* panel = dynamic_cast<CFeatureTypePanel*>(child);
603  if (panel) {
605  } else {
606  wxSizer* subsizer = child->GetSizer();
607  if (subsizer) {
608  UpdateChildrenFeaturePanels(subsizer);
609  }
610  }
611  }
612  }
613  }
614 }
615 
617 
618 
619 
620 
@ eExtreme_Positional
numerical value
Definition: Na_strand.hpp:63
@ eExtreme_Biological
5' and 3'
Definition: Na_strand.hpp:62
CBioseq_Handle –.
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)
bool GetTopLevelSeqEntryAndProcessor()
objects::ECapChange GetCapitalizationRequest()
CFeat_CI –.
Definition: feat_ci.hpp:64
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 > > GetObjects(objects::CBioseq_Handle bsh)
CScope –.
Definition: scope.hpp:92
CSeq_entry_Handle –.
CSeq_feat_Handle –.
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
const string & GetNamedQual(const CTempString &qual_name) const
Return a named qualifier.
Definition: Seq_feat.cpp:429
void RemoveQualifier(const string &qual_name)
Remove all qualifiers with the given name; do nothing if no such qualifier exists.
Definition: Seq_feat.cpp:315
CRef< edit::CStringConstraint > GetStringConstraint()
CStringConstraintPanel * m_StringConstraintPanel
string GetSuggestedName(CSeq_feat &feat, CRef< CSeq_feat > prot_feat, CSeq_entry_Handle seh)
static bool ShowToolTips()
Should we show tooltips?
virtual string GetErrorMessage()
virtual CRef< CCmdComposite > GetCommand()
void GetNameFromGene(CSeq_feat &gene, const wxString &sel_str, bool remove, string &name)
wxStaticText * m_3rdChoice
CtRNAFromGene()
Constructors.
CCapChangePanel * m_CapChangeOptions
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("tRNA/rRNA From Gene"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(900, 500), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
wxChoice * m_FeatQual2
void ProcessUpdateFeatEvent(wxCommandEvent &event)
void OnSelectFeatQual(wxCommandEvent &event)
wxChoice * m_FeatQual3
wxChoice * m_FeatQual
~CtRNAFromGene()
Destructor.
void CreateControls()
Creates the controls and sizers.
void Init()
Initialises member variables.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
COkCancelPanel * m_OkCancel
wxCheckBox * m_SingleInterval
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxCheckBox * m_Remove3
void UpdateChildrenFeaturePanels(wxSizer *sizer)
wxTextCtrl * m_StrQual
wxCheckBox * m_Remove
CFeatureFieldNamePanel * m_FeatureConstraint
wxStaticText * m_2ndChoice
wxChoice * m_FeatureType
wxCheckBox * m_Remove2
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
Definition: map.hpp:338
#define _(proto)
Definition: ct_nlmzip_i.h:78
#define wxFIXED_MINSIZE
static auto & FixCapitalizationInString
const string kPartialStart
#define EVT_UPDATE_FEATURE_LIST(id, fn)
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
static void DLIST_NAME() remove(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
Definition: dlist.tmpl.h:90
static void Init(void)
Definition: cursor6.c:76
static const char * str(char *buf, int n)
Definition: stats.c:84
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NULL
Definition: ncbistd.hpp:225
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
bool IsPartialStart(ESeqLocExtremes ext) const
check start or stop of location for e_Lim fuzz
Definition: Seq_loc.cpp:3222
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
Definition: Seq_loc.cpp:337
void SetPartialStart(bool val, ESeqLocExtremes ext)
set / remove e_Lim fuzz on start or stop (lt/gt - indicating partial interval)
Definition: Seq_loc.cpp:3280
void SetPartialStop(bool val, ESeqLocExtremes ext)
Definition: Seq_loc.cpp:3313
bool IsPartialStop(ESeqLocExtremes ext) const
Definition: Seq_loc.cpp:3251
@ fMerge_All
Definition: Seq_loc.hpp:331
CRef< CSeq_loc > Seq_loc_Add(const CSeq_loc &loc1, const CSeq_loc &loc2, CSeq_loc::TOpFlags flags, CScope *scope)
Add two seq-locs.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
Definition: scope.cpp:95
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
Definition: scope.cpp:200
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
const CSeq_feat_Handle & GetSeq_feat_Handle(void) const
Get original feature handle.
Definition: mapped_feat.hpp:71
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
Definition: ncbistr.cpp:106
bool IsSetSyn(void) const
synonyms for locus Check if a value has been assigned to Syn data member.
Definition: Gene_ref_.hpp:756
const TSyn & GetSyn(void) const
Get the Syn member data.
Definition: Gene_ref_.hpp:768
const TDesc & GetDesc(void) const
Get the Desc member data.
Definition: Gene_ref_.hpp:599
bool IsSetLocus_tag(void) const
systematic gene name (e.g., MI0001, ORF0069) Check if a value has been assigned to Locus_tag data mem...
Definition: Gene_ref_.hpp:781
bool IsSetLocus(void) const
Official gene symbol Check if a value has been assigned to Locus data member.
Definition: Gene_ref_.hpp:493
bool IsSetDesc(void) const
descriptive name Check if a value has been assigned to Desc data member.
Definition: Gene_ref_.hpp:587
bool IsSetAllele(void) const
Official allele designation Check if a value has been assigned to Allele data member.
Definition: Gene_ref_.hpp:540
bool IsSetMaploc(void) const
descriptive map location Check if a value has been assigned to Maploc data member.
Definition: Gene_ref_.hpp:634
const TLocus_tag & GetLocus_tag(void) const
Get the Locus_tag member data.
Definition: Gene_ref_.hpp:793
const TLocus & GetLocus(void) const
Get the Locus member data.
Definition: Gene_ref_.hpp:505
const TAllele & GetAllele(void) const
Get the Allele member data.
Definition: Gene_ref_.hpp:552
const TMaploc & GetMaploc(void) const
Get the Maploc member data.
Definition: Gene_ref_.hpp:646
bool IsSetComment(void) const
Check if a value has been assigned to Comment data member.
Definition: Seq_feat_.hpp:1037
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
Definition: Seq_feat_.hpp:913
void SetLocation(TLocation &value)
Assign a value to Location data member.
Definition: Seq_feat_.cpp:131
void SetComment(const TComment &value)
Assign a value to Comment data member.
Definition: Seq_feat_.hpp:1058
void SetPartial(TPartial value)
Assign a value to Partial data member.
Definition: Seq_feat_.hpp:971
const TLocation & GetLocation(void) const
Get the Location member data.
Definition: Seq_feat_.hpp:1117
bool IsGene(void) const
Check if variant Gene is selected.
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_feat_.hpp:925
void SetData(TData &value)
Assign a value to Data data member.
Definition: Seq_feat_.cpp:94
void ResetComment(void)
Reset Comment data member.
Definition: Seq_feat_.cpp:99
const TComment & GetComment(void) const
Get the Comment member data.
Definition: Seq_feat_.hpp:1049
const TGene & GetGene(void) const
Get the variant data.
END_EVENT_TABLE()
int i
yy_size_t n
#define wxT(x)
Definition: muParser.cpp:41
const struct ncbi::grid::netcache::search::fields::SIZE size
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
static static static wxID_ANY
USING_SCOPE(ncbi::objects)
static const char *const features[]
Modified on Tue Apr 23 07:41:00 2024 by modify_doxy.py rev. 669887