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

Go to the SVN repository for this file.

1 /* $Id: featuregenepanel.cpp 42681 2019-04-02 15:42:12Z filippov $
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>
37 #include <objmgr/bioseq_handle.hpp>
38 #include <objmgr/feat_ci.hpp>
40 #include <objmgr/util/sequence.hpp>
45 
46 ////@begin includes
47 ////@end includes
48 #include "generic_props_panel.hpp"
49 #include "featuregenepanel.hpp"
50 
51 #include <wx/sizer.h>
52 #include <wx/stattext.h>
53 
56 
57 ////@begin XPM images
58 ////@end XPM images
59 
60 
61 /*!
62  * CFeatureGenePanel type definition
63  */
64 
65 IMPLEMENT_DYNAMIC_CLASS( CFeatureGenePanel, wxPanel )
66 
67 
68 /*!
69  * CFeatureGenePanel event table definition
70  */
71 
72 BEGIN_EVENT_TABLE( CFeatureGenePanel, wxPanel )
73 
74 ////@begin CFeatureGenePanel event table entries
75  EVT_LISTBOX( ID_CHOICE16, CFeatureGenePanel::OnSelectGene )
77  EVT_BUTTON( ID_BUTTON_EDIT_GENE, CFeatureGenePanel::OnEditGene )
78 ////@end CFeatureGenePanel event table entries
79 
81 
82 
84 
85 {
86  CBioseq_Handle bsh;
87  for ( CSeq_loc_CI citer (loc); citer; ++citer) {
88  const CSeq_id& id = citer.GetSeq_id();
91  if (bsh) {
92  return bsh;
93  }
94  }
95  return bsh;
96 }
97 
98 
99 /*!
100  * CFeatureGenePanel constructors
101  */
102 
104 {
105  Init();
106 }
107 
108 CFeatureGenePanel::CFeatureGenePanel( wxWindow* parent, CSerialObject& object, CScope& scope, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
109  : m_Object(&object), m_Scope(&scope)
110 {
111  Init();
112  m_GeneRef = new CGene_ref();
113 
114  CSeq_feat * feat = dynamic_cast<CSeq_feat*>(m_Object);
115  const CGene_ref* gref = feat->GetGeneXref();
116  if (gref) {
117  m_GeneRef->Assign (*gref);
118  } else {
119  // find gene currently associated with feature
120  }
121 
122  Create(parent, id, pos, size, style);
123 }
124 
125 
126 /*!
127  * CFeatureGenePanel creator
128  */
129 
130 bool CFeatureGenePanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
131 {
132 ////@begin CFeatureGenePanel creation
133  wxPanel::Create( parent, id, pos, size, style );
134 
135  CreateControls();
136  if (GetSizer())
137  {
138  GetSizer()->SetSizeHints(this);
139  }
140  Centre();
141 ////@end CFeatureGenePanel creation
142  return true;
143 }
144 
145 
146 /*!
147  * CFeatureGenePanel destructor
148  */
149 
151 {
152 ////@begin CFeatureGenePanel destruction
153 ////@end CFeatureGenePanel destruction
154 }
155 
156 
157 /*!
158  * Member initialisation
159  */
160 
162 {
163 ////@begin CFeatureGenePanel member initialisation
164  m_GeneChoice = NULL;
165  m_MapType = NULL;
166  m_Suppress = NULL;
168  m_modify_pseudo = false;
169 ////@end CFeatureGenePanel member initialisation
170 }
171 
172 
173 /*!
174  * Control creation for CFeatureGenePanel
175  */
176 
178 {
179 ////@begin CFeatureGenePanel content construction
180  CFeatureGenePanel* itemPanel1 = this;
181 
182  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
183  itemPanel1->SetSizer(itemBoxSizer2);
184 
185  wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
186  itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
187 
188  wxStaticText* itemStaticText4 = new wxStaticText( itemPanel1, wxID_STATIC, _("Gene:"), wxDefaultPosition, wxDefaultSize, 0 );
189  itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
190 
191  wxArrayString m_GeneChoiceStrings;
192  m_GeneChoice = new wxListBox( itemPanel1, ID_CHOICE16, wxDefaultPosition, wxDefaultSize, m_GeneChoiceStrings, wxLB_SINGLE );
193  itemBoxSizer3->Add(m_GeneChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
194 
195  wxArrayString m_MapTypeStrings;
196  m_MapTypeStrings.Add(_("&Overlap"));
197  m_MapTypeStrings.Add(_("&Cross-reference"));
198  m_MapType = new wxRadioBox( itemPanel1, ID_RADIOBOX4, _("Map by"), wxDefaultPosition, wxDefaultSize, m_MapTypeStrings, 1, wxRA_SPECIFY_ROWS );
199  m_MapType->SetSelection(0);
200  itemBoxSizer2->Add(m_MapType, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
201 
202  m_Suppress = new wxCheckBox( itemPanel1, ID_CHECKBOX13, _("Suppress Gene"), wxDefaultPosition, wxDefaultSize, 0 );
203  m_Suppress->SetValue(false);
204  itemBoxSizer2->Add(m_Suppress, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
205 
206 ////@end CFeatureGenePanel content construction
207 
208  m_GeneChoice->Append(wxEmptyString);
209  m_GeneChoice->Append(_("New"));
210 
211 
212  CSeq_feat * feat = dynamic_cast<CSeq_feat*>(m_Object);
213  string match_label;
214  const CGene_ref* gs = feat->GetGeneXref();
215  if (gs) {
216  gs->GetLabel (&match_label);
217  if (NStr::IsBlank (match_label)) {
218  m_Suppress->SetValue(true);
219  m_GeneChoice->Enable (false);
220  m_MapType->Enable (false);
221  } else {
222  m_MapType->SetSelection(1);
223  }
224  }
225 
226  if (NStr::IsBlank (match_label)) {
228  // pick out gene by overlap, in case user turns off suppression
229  if ( m_OverlappingGene ) {
230  m_OverlappingGene->GetData().GetGene().GetLabel(&match_label);
231  }
232  }
233 
234  int index = -1;
235  m_GeneList.clear();
236  m_GeneFeatList.clear();
238  if (bsh)
239  {
240  for (CFeat_CI gene_it(bsh, SAnnotSelector(CSeqFeatData::e_Gene)); gene_it; ++gene_it)
241  {
242  const CGene_ref& gr = gene_it->GetSeq_feat()->GetData().GetGene();
243  string label;
244  gr.GetLabel(&label);
245  if (label.empty()) {
246  continue;
247  }
248 
249  m_GeneList.push_back(ConstRef(&gr));
250  m_GeneFeatList.push_back(gene_it->GetSeq_feat());
251  m_GeneChoice->Append(ToWxString(label));
252  }
253  if (m_OverlappingGene)
254  {
255  int n = 2;
256  for (CFeat_CI gene_it(bsh, SAnnotSelector(CSeqFeatData::e_Gene)); gene_it; ++gene_it, ++n)
257  {
258  const CSeq_feat& feat = gene_it->GetOriginalFeature();
259  if (m_OverlappingGene->Equals(feat))
260  {
261  index = n;
262  break;
263  }
264  }
265  }
266  if (index == -1 && !NStr::IsBlank(match_label))
267  {
268  int n = 2;
269  for (CFeat_CI gene_it(bsh, SAnnotSelector(CSeqFeatData::e_Gene)); gene_it; ++gene_it, ++n)
270  {
271  const CGene_ref& gr = gene_it->GetSeq_feat()->GetData().GetGene();
272  string label;
273  gr.GetLabel(&label);
274  if (!label.empty() && NStr::Equal(match_label, label))
275  {
276  index = n;
277  break;
278  }
279  }
280  }
281  }
282 
283 
284  m_ButtonEditGene = new wxButton(itemPanel1, ID_BUTTON_EDIT_GENE, _("Edit Gene"), wxDefaultPosition, wxDefaultSize, 0);
285  itemBoxSizer2->Add(m_ButtonEditGene, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
286  m_ButtonEditGene->Disable();
287 
288  if (index > -1) {
289  m_GeneChoice->SetSelection(index);
290  m_GeneChoice->EnsureVisible(index);
291  m_ButtonEditGene->Enable();
292  } else {
293  // label not found
294  if (NStr::IsBlank (match_label)) {
295  m_GeneChoice->SetSelection (0);
296  m_GeneChoice->EnsureVisible(0);
297  } else {
298  // create new
299  m_GeneChoice->SetSelection(1);
300  m_GeneChoice->EnsureVisible(1);
301  }
302  }
303 
304  m_GeneRefPanel = new CGenePanel( itemPanel1, *m_GeneRef, *m_Scope);
305  itemBoxSizer2->Add(m_GeneRefPanel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
306  if (m_GeneChoice->GetSelection() == 1) {
307  m_GeneRefPanel->Enable (true);
308  } else {
309  m_GeneRefPanel->Enable (false);
310  }
311 }
312 
313 
314 static void ClearGeneXref (CSeq_feat * feat)
315 {
316  if (!feat->IsSetXref()) {
317  return;
318  }
319 
320  CSeq_feat::TXref::iterator it = feat->SetXref().begin();
321  while (it != feat->SetXref().end()) {
322  if ((*it)->IsSetData () && (*it)->GetData ().IsGene ()) {
323  it = feat->SetXref().erase(it);
324  } else {
325  ++it;
326  }
327  }
328  if (feat->SetXref().size() == 0) {
329  feat->ResetXref();
330  }
331 }
332 
333 
335 {
336  if (!wxPanel::TransferDataFromWindow())
337  return false;
338  m_GeneRefPanel->TransferDataFromWindow();
339 
340  CSeq_feat * feat = dynamic_cast<CSeq_feat*>(m_Object);
341  if (m_Suppress->GetValue()) {
342  CGene_ref& s = feat->SetGeneXref();
343  s.Reset();
344  } else if (m_MapType->GetSelection() == 1) {
345  int which_gene = m_GeneChoice->GetSelection();
346  if (which_gene == 0) {
347  // empty, same as suppress
348  CGene_ref& s = feat->SetGeneXref();
349  s.Reset();
350  } else if (which_gene == 1) {
351  // new gene
352  string label = "";
353  m_GeneRef->GetLabel(&label);
354  if (NStr::IsBlank (label)) {
355  ClearGeneXref (feat);
356  } else {
357  // create new gene xref
358  CGene_ref& s = feat->SetGeneXref();
359  s.Assign(*m_GeneRef);
360  }
361  } else {
362  // create gene xref to existing gene
363  CGene_ref& s = feat->SetGeneXref();
364  s.Assign(*m_GeneList[which_gene - 2]);
365  if (m_GeneFeatList[which_gene - 2]->IsSetId())
366  {
368  {
369  if ((*xit)->IsSetData() && (*xit)->GetData().IsGene() && s.Equals((*xit)->GetData().GetGene()))
370  {
371  (*xit)->SetId().Assign(m_GeneFeatList[which_gene - 2]->GetId());
372  }
373  }
374  }
375  }
376  } else {
377  // clear gene xref if there is one, build gene
378  ClearGeneXref (feat);
379  }
380 
381  return true;
382 }
383 
384 
386 {
387  CSeq_feat * feat = dynamic_cast<CSeq_feat*>(m_Object);
388  if (!feat || !feat->IsSetLocation()) {
389  return CRef<CSeq_loc>(NULL);
390  }
391  bool trans_splicing = false;
392  if (feat->IsSetExcept_text() && NStr::Find(feat->GetExcept_text(), "trans-splicing") != string::npos) {
393  trans_splicing = true;
394  }
395 
396  CRef<CSeq_loc> gene_loc(NULL);
397 
398 
399  CSeq_loc_CI loc_iter(feat->GetLocation());
400  CSeq_loc_CI::TRange range = loc_iter.GetRange();
401  TSeqPos from = range.GetFrom();
402  TSeqPos to = range.GetTo();
403  bool minus = (loc_iter.GetStrand() == eNa_strand_minus);
404  CConstRef<CSeq_id> last_id(&(loc_iter.GetSeq_id()));
406  ++loc_iter;
407  while (loc_iter) {
408  bool need_new_interval = false;
409  bool new_minus = (loc_iter.GetStrand() == eNa_strand_minus);
410  if ((minus && !new_minus) || (!minus && new_minus)) {
411  need_new_interval = true;
412  }
414  if (bsh != new_bsh) {
415  need_new_interval = true;
416  }
417  range = loc_iter.GetRange();
418  TSeqPos new_from = range.GetFrom();;
419  TSeqPos new_to = range.GetTo();
420 
421  if (!need_new_interval && trans_splicing) {
422  // check for distance
423  TSeqPos distance = 0;
424  bool out_of_order = false;
425  // check for out of order or distance
426  if (minus) {
427  if (from < new_from || to < new_to) {
428  out_of_order = true;
429  } else if (from > new_to) {
430  distance = from - new_to;
431  }
432  } else {
433  if (from > new_from || to > new_to) {
434  out_of_order = true;
435  } else if (new_from > to) {
436  distance = new_from - to;
437  }
438  }
439  if (out_of_order || distance > 10000) {
440  need_new_interval = true;
441  }
442  }
443 
444  if (need_new_interval) {
445  if (!gene_loc) {
446  gene_loc.Reset(new CSeq_loc());
447  }
448  CRef<CSeq_id> new_id(new CSeq_id());
449  new_id->Assign(*last_id);
450  CRef<CSeq_loc> sub(new CSeq_loc(*new_id, from, to, minus ? eNa_strand_minus : eNa_strand_unknown));
451  gene_loc->SetMix().Set().push_back(sub);
452  from = new_from;
453  to = new_to;
454  minus = new_minus;
455  last_id = &(loc_iter.GetSeq_id());
456  } else {
457  // extend interval
458  if (minus) {
459  from = new_from;
460  } else {
461  to = new_to;
462  }
463  }
464  ++loc_iter;
465  }
466  if (gene_loc) {
467  CRef<CSeq_id> new_id(new CSeq_id());
468  new_id->Assign(*last_id);
469  CRef<CSeq_loc> sub(new CSeq_loc(*new_id, from, to, minus ? eNa_strand_minus : eNa_strand_unknown));
470  gene_loc->SetMix().Set().push_back(sub);
471  } else {
472  CRef<CSeq_id> new_id(new CSeq_id());
473  new_id->Assign(*last_id);
474  gene_loc.Reset(new CSeq_loc(*new_id, from, to, minus ? eNa_strand_minus : eNa_strand_unknown));
475  }
476 
477  bool partial_start = feat->GetLocation().IsPartialStart(eExtreme_Positional);
478  bool partial_stop = feat->GetLocation().IsPartialStop(eExtreme_Positional);
479  gene_loc->SetPartialStart(partial_start, eExtreme_Positional);
480  gene_loc->SetPartialStop(partial_stop, eExtreme_Positional);
481  return gene_loc;
482 }
483 
485 {
486  if (!gene_feat || m_MapType->GetSelection() != 1)
487  return;
488 
489  CSeq_feat * src = dynamic_cast<CSeq_feat*>(m_Object);
490  if (!src ||!src->IsSetId() || !src->GetId().IsLocal())
491  return;
492 
493  if (!CSeqFeatData::AllowXref(src->GetData().GetSubtype(), gene_feat->GetData().GetSubtype())) {
494  // only create reciprocal xrefs if permitted
495  return;
496  }
498  if (!bsh)
499  return;
500  const CTSE_Handle& tse = bsh.GetSeq_entry_Handle().GetTSE_Handle();
501  // don't create xref if already have xref to feature of same type as src
502  bool has_xref = false;
503  if (gene_feat->IsSetXref()) {
504  NON_CONST_ITERATE(CSeq_feat::TXref, xit, gene_feat->SetXref()) {
505  if ((*xit)->IsSetId() && (*xit)->GetId().IsLocal()) {
506  if ((*xit)->GetId().Equals(src->GetId())) {
507  // already have xref
508  has_xref = true;
509  break;
510  } else {
511  const CTSE_Handle::TFeatureId& feat_id = (*xit)->GetId().GetLocal();
513  ITERATE(CTSE_Handle::TSeq_feat_Handles, fit, far_feats) {
514  if (fit->GetData().GetSubtype() == src->GetData().GetSubtype()) {
515  (*xit)->SetId().Assign(src->GetId());
516  has_xref = true;
517  break;
518  }
519  }
520  if (has_xref) {
521  break;
522  }
523  }
524  }
525  }
526  }
527 
528  if (!has_xref) {
529  gene_feat->AddSeqFeatXref(src->GetId());
530  }
531 }
532 
534 {
536  CRef<CSeq_feat> gene_feat;
537  if (!m_Suppress->GetValue()
538  //&& m_MapType->GetSelection() == 0
539  && (m_GeneRef->IsSetLocus() || m_GeneRef->IsSetLocus_tag())
540  && m_GeneChoice->GetSelection() == 1)
541  {
542  gene_feat.Reset(new CSeq_feat());
543  gene_feat->SetData().SetGene().Assign (*m_GeneRef);
544  // pick location to match
545  CRef<CSeq_loc> gene_loc = GetLocationForGene();
546  gene_feat->SetLocation(*gene_loc);
547  bool partial_start = gene_feat->GetLocation().IsPartialStart(eExtreme_Positional);
548  bool partial_stop = gene_feat->GetLocation().IsPartialStop(eExtreme_Positional);
549  if (partial_start || partial_stop)
550  {
551  gene_feat->SetPartial (true);
552  }
553  AddReciprocicalXref(gene_feat);
554  if (m_modify_pseudo)
555  {
557  }
558  }
559  return gene_feat;
560 }
561 
562 
564 {
566  if (!m_Suppress->GetValue()
567  //&& m_MapType->GetSelection() == 0
568  && m_GeneChoice->GetSelection() > 1) {
569  int which_gene = m_GeneChoice->GetSelection() - 2;
570 
571  return m_GeneFeatList[which_gene];
572  } else {
573  CConstRef<CSeq_feat> gene_feat;
574  gene_feat.Reset();
575  return gene_feat;
576  }
577 }
578 
580 {
582  if (!m_Suppress->GetValue()
583  //&& m_MapType->GetSelection() == 0
584  && m_GeneChoice->GetSelection() > 1) {
585  int which_gene = m_GeneChoice->GetSelection() - 2;
586  CRef<CSeq_feat> gene_feat(new CSeq_feat);
587  gene_feat->Assign(*m_GeneFeatList[which_gene]);
588  AddReciprocicalXref(gene_feat);
589  if (m_modify_pseudo)
590  {
592  }
593  return gene_feat;
594  } else {
595  CRef<CSeq_feat> gene_feat;
596  return gene_feat;
597  }
598 }
599 
600 /*!
601  * Should we show tooltips?
602  */
603 
605 {
606  return true;
607 }
608 
609 /*!
610  * Get bitmap resources
611  */
612 
613 wxBitmap CFeatureGenePanel::GetBitmapResource( const wxString& name )
614 {
615  // Bitmap retrieval
616 ////@begin CFeatureGenePanel bitmap retrieval
617  wxUnusedVar(name);
618  return wxNullBitmap;
619 ////@end CFeatureGenePanel bitmap retrieval
620 }
621 
622 /*!
623  * Get icon resources
624  */
625 
626 wxIcon CFeatureGenePanel::GetIconResource( const wxString& name )
627 {
628  // Icon retrieval
629 ////@begin CFeatureGenePanel icon retrieval
630  wxUnusedVar(name);
631  return wxNullIcon;
632 ////@end CFeatureGenePanel icon retrieval
633 }
634 
635 
636 /*!
637  * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX13
638  */
639 
640 void CFeatureGenePanel::OnClickSuppress( wxCommandEvent& event )
641 {
642  if (m_Suppress->GetValue()) {
643  m_GeneChoice->Enable (false);
644  m_MapType->Enable(false);
645  m_GeneRefPanel->Enable(false);
646  } else {
647  m_GeneChoice->Enable (true);
648  m_MapType->Enable(true);
649  if (m_GeneChoice->GetSelection() == 1) {
650  m_GeneRefPanel->Enable (true);
651  } else{
652  m_GeneRefPanel->Enable (false);
653  }
654  }
655 }
656 
657 
658 /*!
659  * wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE16
660  */
661 
662 void CFeatureGenePanel::OnSelectGene( wxCommandEvent& event )
663 {
664  if (m_GeneChoice->GetSelection() == 1) {
665  m_GeneRefPanel->Enable (true);
666  } else{
667  m_GeneRefPanel->Enable (false);
668  }
669  if (m_GeneChoice->GetSelection() > 1)
670  m_ButtonEditGene->Enable();
671  else
672  m_ButtonEditGene->Disable();
673 }
674 
675 void CFeatureGenePanel::OnEditGene(wxCommandEvent& event)
676 {
678  if (!gene)
679  return;
681  if (!bsh)
682  return;
683 
684  CSeq_entry_Handle feat_seh = bsh.GetSeq_entry_Handle();
685  CIRef<IEditObject> edit(new CEditObjectSeq_feat(*gene, feat_seh, *m_Scope, false));
686 
687  CEditObjViewDlg* edit_dlg = new CEditObjViewDlg(NULL, true);
688  ICommandProccessor *cmd_processor = NULL;
689  wxWindow *win = GetParent();
690  while(win)
691  {
692  CEditObjViewDlg *parent = dynamic_cast<CEditObjViewDlg*>(win);
693  if (parent)
694  {
695  cmd_processor = parent->GetUndoManager();
696  break;
697  }
698  CEditObjViewDlgModal *parent2 = dynamic_cast<CEditObjViewDlgModal*>(win);
699  if (parent2)
700  {
701  cmd_processor = parent2->GetUndoManager();
702  break;
703  }
704  win = win->GetParent();
705  }
706  if (!cmd_processor)
707  return;
708  edit_dlg->SetUndoManager(cmd_processor);
709  wxWindow* editorWindow = edit->CreateWindow(edit_dlg);
710  edit_dlg->SetEditorWindow(editorWindow);
711  edit_dlg->SetEditor(edit);
712  edit_dlg->SetTitle("Gene");
713  edit_dlg->Show(true);
714 }
715 
716 void CFeatureGenePanel::SetModifyPseudo(bool modify_pseudo, const string &pseudo_choice)
717 {
718  m_modify_pseudo = modify_pseudo;
719  m_pseudo_choice = pseudo_choice;
720 }
721 
static CRef< CScope > m_Scope
User-defined methods of the data storage class.
#define static
@ eExtreme_Positional
numerical value
Definition: Na_strand.hpp:63
User-defined methods of the data storage class.
EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX, CAdjustFeaturesForGaps::OnKnownUnknownSelected) EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX1
CBioseq_Handle –.
ICommandProccessor * GetUndoManager(void)
ICommandProccessor * GetUndoManager(void)
void SetEditorWindow(wxWindow *editorWindow)
void SetEditor(CIRef< IEditObject > editor)
virtual void SetUndoManager(ICommandProccessor *cmdProccessor)
CFeat_CI –.
Definition: feat_ci.hpp:64
vector< CConstRef< objects::CSeq_feat > > m_GeneFeatList
static bool ShowToolTips()
Should we show tooltips?
void Init()
Initialises member variables.
CFeatureGenePanel()
Constructors.
CConstRef< objects::CSeq_feat > GetGeneToEdit()
void OnClickSuppress(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX13
bool Create(wxWindow *parent, wxWindowID id=ID_CFEATUREGENEPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
Creation.
CRef< objects::CGene_ref > m_GeneRef
void SetModifyPseudo(bool modify_pseudo, const string &pseudo_choice)
CRef< objects::CSeq_loc > GetLocationForGene()
CConstRef< objects::CSeq_feat > m_OverlappingGene
CRef< objects::CScope > m_Scope
CSerialObject * m_Object
CRef< objects::CSeq_feat > GetNewGene()
void AddReciprocicalXref(CRef< objects::CSeq_feat > gene_feat)
CRef< objects::CSeq_feat > GetUpdatedGene()
void OnSelectGene(wxCommandEvent &event)
wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE16
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
~CFeatureGenePanel()
Destructor.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void OnEditGene(wxCommandEvent &event)
vector< CConstRef< objects::CGene_ref > > m_GeneList
CGenePanel * m_GeneRefPanel
virtual bool TransferDataFromWindow()
void CreateControls()
Creates the controls and sizers.
void GetLabel(string *label) const
Definition: Gene_ref.cpp:57
static void ModifyPseudo(objects::CSeq_feat &feat, const string &pseudo_choice)
CScope –.
Definition: scope.hpp:92
ESubtype GetSubtype(void) const
static bool AllowXref(CSeqFeatData::ESubtype subtype1, CSeqFeatData::ESubtype subtype2)
CSeq_entry_Handle –.
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
const CGene_ref * GetGeneXref(void) const
See related function in util/feature.hpp.
Definition: Seq_feat.cpp:181
void SetGeneXref(CGene_ref &value)
Definition: Seq_feat.cpp:192
bool AddSeqFeatXref(const CSeqFeatXref::TId &id)
Definition: Seq_feat.cpp:279
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
Definition: Seq_loc.hpp:453
Base class for all serializable objects.
Definition: serialbase.hpp:150
TSeq_feat_Handles GetFeaturesWithId(CSeqFeatData::E_Choice type, TFeatureIdInt id) const
Definition: tse_handle.cpp:604
vector< CSeq_feat_Handle > TSeq_feat_Handles
Definition: tse_handle.hpp:167
Undo/Redo interface for editing operations.
#define ID_CHECKBOX13
#define _(proto)
Definition: ct_nlmzip_i.h:78
USING_SCOPE(objects)
static void ClearGeneXref(CSeq_feat *feat)
static CBioseq_Handle BioseqHandleFromLocation(CScope *m_Scope, const CSeq_loc &loc)
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#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
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
Definition: Seq_id.cpp:318
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
void SetMix(TMix &v)
Definition: Seq_loc.hpp:987
bool IsPartialStart(ESeqLocExtremes ext) const
check start or stop of location for e_Lim fuzz
Definition: Seq_loc.cpp:3222
const CSeq_loc & GetEmbeddingSeq_loc(void) const
Get the nearest seq-loc containing the current range.
Definition: Seq_loc.cpp:2573
TRange GetRange(void) const
Get the range.
Definition: Seq_loc.hpp:1042
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
ENa_strand GetStrand(void) const
Definition: Seq_loc.hpp:1056
const CSeq_id & GetSeq_id(void) const
Get seq_id of the current location.
Definition: Seq_loc.hpp:1028
void SetPartialStop(bool val, ESeqLocExtremes ext)
Definition: Seq_loc.cpp:3313
bool IsPartialStop(ESeqLocExtremes ext) const
Definition: Seq_loc.cpp:3251
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
CConstRef< CSeq_feat > GetOverlappingGene(const CSeq_loc &loc, CScope &scope, ETransSplicing eTransSplicing=eTransSplicing_Auto)
Definition: sequence.cpp:1366
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
Definition: scope.cpp:95
@ eGetBioseq_All
Search bioseq, load if not loaded yet.
Definition: scope.hpp:128
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
const CTSE_Handle & GetTSE_Handle(void) const
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
Definition: ncbiobj.hpp:2024
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:1439
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
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:2887
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:5383
static const char label[]
virtual void Reset(void)
Reset the whole object.
Definition: Gene_ref_.cpp:111
TId GetId(void) const
Get the variant data.
Definition: Object_id_.hpp:270
TXref & SetXref(void)
Assign a value to Xref data member.
Definition: Seq_feat_.hpp:1314
void SetLocation(TLocation &value)
Assign a value to Location data member.
Definition: Seq_feat_.cpp:131
void SetPartial(TPartial value)
Assign a value to Partial data member.
Definition: Seq_feat_.hpp:971
const TId & GetId(void) const
Get the Id member data.
Definition: Seq_feat_.hpp:904
bool IsSetXref(void) const
cite other relevant features Check if a value has been assigned to Xref data member.
Definition: Seq_feat_.hpp:1296
const TLocation & GetLocation(void) const
Get the Location member data.
Definition: Seq_feat_.hpp:1117
bool IsLocal(void) const
Check if variant Local is selected.
Definition: Feat_id_.hpp:353
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_feat_.hpp:925
const TExcept_text & GetExcept_text(void) const
Get the Except_text member data.
Definition: Seq_feat_.hpp:1405
bool IsSetExcept_text(void) const
explain if except=TRUE Check if a value has been assigned to Except_text data member.
Definition: Seq_feat_.hpp:1393
void SetData(TData &value)
Assign a value to Data data member.
Definition: Seq_feat_.cpp:94
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
Definition: Seq_feat_.hpp:892
vector< CRef< CSeqFeatXref > > TXref
Definition: Seq_feat_.hpp:122
void ResetXref(void)
Reset Xref data member.
Definition: Seq_feat_.cpp:182
bool IsSetLocation(void) const
feature made from Check if a value has been assigned to Location data member.
Definition: Seq_feat_.hpp:1105
@ e_not_set
No variant selected.
@ eNa_strand_minus
Definition: Na_strand_.hpp:67
@ eNa_strand_unknown
Definition: Na_strand_.hpp:65
END_EVENT_TABLE()
yy_size_t n
range(_Ty, _Ty) -> range< _Ty >
Definition: fix_pub.hpp:45
const struct ncbi::grid::netcache::search::fields::SIZE size
T minus(T x_)
SAnnotSelector –.
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
#define const
Definition: zconf.h:230
Modified on Sat Sep 23 22:45:02 2023 by modify_doxy.py rev. 669887