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

Go to the SVN repository for this file.

1 /* $Id: multi_align_view.cpp 47599 2023-10-30 20:18:03Z 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: Andrey Yazhuk
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
35 
37 
39 
42 
44 
46 
51 
52 #include <gui/objutils/utils.hpp>
53 #include <gui/objutils/label.hpp>
54 
55 #include <objmgr/util/sequence.hpp>
56 #include <serial/iterator.hpp>
57 
58 #include <wx/menu.h>
59 
60 
63 
64 
65 
66 
68  eCmdUseSparseAln = 8300
69 };
70 
71 
72 ///////////////////////////////////////////////////////////////////////////////
73 /// CMultiAlignView
75  "Multiple Sequence Alignment View", // type name
76  "multi_align_view", // icon alias TODO
77  "Multiple Sequence Alignment View hint",
78  "View for the multiple alignments with each column and residue colored according to its degree of mismatch",
79  "MULTI_ALIGN_VIEW", // help ID
80  "Alignment", // category
81  false, // not a singleton
82  "Seq-align",
84 );
85 
86 
89  &CMultiAlignView::OnAlnWidgetSelChanged)
90  ON_EVENT(CAlnMultiPane::CEvent, CAlnMultiPane::eSelRowChanged,
91  &CMultiAlignView::OnAlnWidgetSelChanged)
92  ON_EVENT(COpenGraphicViewEvent, CViewEvent::eOpenGraphicalViewEvent,
93  &CMultiAlignView::OnOpenGraphicalView)
95 
96 
98 : m_Sparse(false),
99  m_AlnWidget(NULL)
100 {
101 }
102 
103 
105 {
107  return m_AlnWidget;
108 }
109 
110 static
111 WX_DEFINE_MENU(kViewMenu)
112  WX_SUBMENU("&View")
113  WX_MENU_SEPARATOR_L("Contribs")
114  WX_SUBMENU("Multiple Alignment")
121  WX_SUBMENU("Hide / Show")
127  WX_SUBMENU("Master")
132  WX_SUBMENU("Coloring")
139  WX_SUBMENU("&Edit")
140  WX_MENU_SEPARATOR_L("Contribs")
141  WX_SUBMENU("Multiple Alignment")
147 WX_END_MENU()
148 
149 
150 void CMultiAlignView::x_CreateMenuBarMenu()
151 {
152  CUICommandRegistry& cmd_reg = m_Workbench->GetUICommandRegistry();
153 
154  m_MenuBarMenu.reset(cmd_reg.CreateMenu(kViewMenu));
155 }
156 
158 
159  return kViewMenu;
160 }
161 
162 void CMultiAlignView::CreateViewWindow(wxWindow* parent)
163 {
164  _ASSERT( ! m_AlnWidget);
165 
166  m_AlnWidget = new CAlnMultiWidget(parent);
167 
169 
172 
173  // setup display styles
176 
178 }
179 
180 
182 {
183  if(m_AlnWidget) {
184  m_AlnWidget->Destroy();
185  m_AlnWidget = NULL;
186  }
187 }
188 
189 
191 {
193 }
194 
196 {
197  // extract the alignments from the argument
198  const CSeq_annot* annot = dynamic_cast<const CSeq_annot*>(obj);
199  if(annot) {
200  m_OrigAnnot.Reset(annot);
201  } else {
202  const CSeq_align* align = dynamic_cast<const CSeq_align*>(obj);
203  if(align) {
204  m_OrigAlign.Reset(align);
205  }
206  }
207 
208  return (m_OrigAnnot || m_OrigAlign);
209 }
210 
211 bool CMultiAlignView::InitView(TConstScopedObjects& objects, const objects::CUser_object*)
212 {
214 
215  CScope* scope = NULL;
216  const CObject* obj = NULL;
217 
218  if(objects.size() == 1) {
219  obj = objects[0].object.GetPointer();
220  scope = objects[0].scope.GetPointer();
221  }
222 
223  if(x_GetValidInputData(obj)) {
225  _ASSERT(srv);
226 
227  CRef<CGBWorkspace> ws = srv->GetGBWorkspace();
228  if (!ws) return false;
229 
230  CGBDocument* doc = dynamic_cast<CGBDocument*>(ws->GetProjectFromScope(*scope));
231  if (doc) {
232  x_AttachToProject(*doc);
234  return true;
235  } else return false;
236  } else {
237  // cannot represent the data
239  return false;
240  }
241 
242 }
243 
244 
246 {
248 
250 
251  if (x_HasProject()) {
252  CScope* scope = x_GetScope();
253 
254  _ASSERT(scope);
255 
256  if (m_OrigAnnot) {
257  m_Builder.Init(*scope, *m_OrigAnnot);
258  m_Sparse =
259  m_OrigAnnot->GetData().IsAlign()
260  && m_OrigAnnot->GetData().GetAlign().front()->CanGetSegs()
261  &&(
262  m_OrigAnnot->GetData().GetAlign().front()->GetSegs().IsSparse()
263  || m_OrigAnnot->GetData().GetAlign().front()->GetSegs().IsSpliced()
264  )
265  ;
266  } else if (m_OrigAlign) {
267  m_Builder.Init(*scope, *m_OrigAlign);
268  m_Sparse = m_OrigAlign->CanGetSegs()
269  &&(
270  m_OrigAlign->GetSegs().IsSparse()
271  || m_OrigAlign->GetSegs().IsSpliced()
272  )
273  ;
274  }
275  if (m_Sparse) {
278  }
279  m_Builder.SetListener(this);
280 
283 
285  }
286 }
287 
288 
290 {
291  /*
292  if(
293  evt.GetSubtype() == CProjectViewEvent::eData
294  || evt.GetSubtype() == CProjectViewEvent::eBothPropsData
295  ){
296  // reset datasource to make sure the active job is deleted
297  m_AlnWidget->GetModel()->SetDataSource(NULL);
298  m_AlnWidget->SetDataSource(NULL);
299  m_DataSource.Reset();
300  OnProjectChanged();
301  m_AlnWidget->Refresh();
302  }
303  */
304 
305  if(
308  ){
310  }
311 }
312 
313 
314 // handles notifications from the Data Source
316 {
317  if (m_AlnWidget) {
318  m_AlnWidget->OnDSChanged(update);
319  }
320 
321  if(update.GetType() == CDataChangeNotifier::eChanged) {
324  }
325 }
326 
327 
329 {
331 
332  CScope* scope = x_GetScope();
333  m_ObjIndex.Clear(scope);
334 
335  // for every row in the alignment - register a {handle, id} pair
336  IAlnExplorer::TNumrow n_rows = m_DataSource->GetNumRows();
337  for( IAlnExplorer::TNumrow row = 0; row < n_rows; row++ ) {
338  if(m_DataSource->CanGetId(row)) {
339  const CSeq_id& id = m_DataSource->GetSeqId(row);
340  m_ObjIndex.Add(new CSelRowHandle(row), id);
341  }
342  }
343 }
344 
345 typedef vector<CConstRef<CSeq_id> > TRSeqIdVector;
346 
347 
349  CSelectionEvent::TRangeColl& loc) const
350 {
351  TSeqPos from = m_DataSource->GetSeqStart(row);
352  TSeqPos to = m_DataSource->GetSeqStop(row);
353  CAlnVec::TSignedRange total_r(from, to);
354 
356  unique_ptr<IAlnSegmentIterator> p_it(m_DataSource->CreateSegmentIterator(row, total_r, flags));
357  IAlnSegmentIterator& it = *p_it;
358 
359  for( ; it; ++it ) {
360  const IAlnSegment::TSignedRange& aln_r = it->GetRange();
361  CSelectionEvent::TRange r(aln_r.GetFrom(), aln_r.GetTo());
362  loc.CombineWith(r);
363  }
364 }
365 
366 
368 {
369  seq_coll.clear();
370  if(m_DataSource.GetPointer() && ! m_DataSource->IsEmpty()
371  && m_DataSource->IsSetAnchor()) {
372  // retrieve linear selection on master sequence
374 
375  CAlnVecMultiDataSource::TNumrow master_row = m_DataSource->GetAnchor();
376  const TRangeColl& aln_coll = m_AlnWidget->GetSelection();
377 
378  m_DataSource->GetSeqFromAln(master_row, aln_coll, seq_coll);
379  return true;
380  }
381  return false;
382 }
383 
384 
386 {
387  if (m_AlnWidget && x_HasProject()) {
388  typedef IAlnMultiDataSource ::TNumrow TNumrow;
389 
390  // object selection
391  vector<TNumrow> rows;
393  CScope* scope = x_GetScope();
394  objs.reserve(rows.size());
395 
396  ITERATE(vector<TNumrow>, it, rows) { // iterate by selected rows
397  TNumrow row = *it;
398  const CSeq_id& id = m_DataSource->GetSeqId(row);
399 
400  objs.push_back(SConstScopedObject(&id, scope));
401  }
402 
403  // range selection
405  if(x_GetSeqRangeSelection(seq_coll) && ! seq_coll.Empty()) {
406  CAlnVecMultiDataSource::TNumrow master_row = m_DataSource->GetAnchor();
407  const CSeq_id& master_id = m_DataSource->GetSeqId(master_row);
408  CRef<CSeq_loc> loc = CSeqUtils::CreateSeq_loc(master_id, seq_coll);
409  if (loc) {
410  objs.push_back(SConstScopedObject(loc, scope));
411  }
412  }
413  }
414 }
415 
416 
417 // handles incoming selection broadcast (overriding CView virtual function)
419 {
420  if (m_DataSource.Empty() || m_DataSource->IsEmpty()) return;
421 
422  bool has_anchor = m_DataSource->IsSetAnchor();
423  CScope* scope = x_GetScope();
424 
425  _ASSERT(scope);
426 
427  // process Range Selection
428  if(evt.HasRangeSelection() && has_anchor) {
430  TRangeColl coll, aln_coll;
431 
432  CAlnVecMultiDataSource::TNumrow master_row = m_DataSource->GetAnchor();
433  const CSeq_id& master_id = m_DataSource->GetSeqId(master_row);
434  evt.GetRangeSelection(master_id, *scope, coll);
435 
436  m_DataSource->GetAlnFromSeq(master_row, coll, aln_coll);
437 
438  m_AlnWidget->SetSelection(aln_coll);
439  }
440 
441  // process Object Selection
442  if(evt.HasObjectSelection()) {
443  vector<CAlnVec::TNumrow> sel_rows;
444 
445  TConstObjects sel_objs;
446  evt.GetRangeSelectionAsLocs(sel_objs);
447 
448  CConstRef<CSeq_id> row_id;
450 
452 
453  ITERATE(CSelectionEvent::TIds, it_id, evt.GetIds()) {
454  const CSeq_id& id = **it_id;
455  CSeq_id_Descr descr(NULL, id, evt.GetScope());
456  // TODO - put descr in SelectionEvent
457 
458  results.clear();
459  m_ObjIndex.GetMatches(descr, results);
461  const CSelRowHandle* row_handle =
462  reinterpret_cast<const CSelRowHandle*>(*it_r);
463  sel_rows.push_back(row_handle->GetNumrow());
464  }
465  }
466 
467  ITERATE(CSelectionEvent::TIdLocs, it_loc, evt.GetIdLocs()) {
468  CConstRef<CIdLoc> id_loc = *it_loc;
469  CSeq_id_Descr descr(NULL, *id_loc->m_Id, evt.GetScope());
470  // TODO - put descr in SelectionEvent
471 
472  results.clear();
473  m_ObjIndex.GetMatches(descr, results);
475  const CSelRowHandle* row_handle =
476  reinterpret_cast<const CSelRowHandle*>(*it_r);
477  IAlnExplorer::TNumrow row = row_handle->GetNumrow();
478 
479  bool match = true;
481  match = false;
482 
483  TSeqPos pos = m_DataSource->GetSeqStart(row);
484  if(pos == id_loc->m_Range.GetFrom()) {
485  pos = m_DataSource->GetSeqStop(row);
486  match = (pos == id_loc->m_Range.GetTo());
487  }
488  }
489  if(match) {
490  sel_rows.push_back(row);
491  }
492  }
493  }
494 
495  m_AlnWidget->Select(sel_rows, true, true);
496  }
497 }
498 
499 
501 {
502  if(m_AlnWidget && m_DataSource.GetPointer() && ! m_DataSource->IsEmpty()) {
503  // set Range Selection
505  if(x_GetSeqRangeSelection(seq_coll)) {
506  CAlnVecMultiDataSource::TNumrow master_row = m_DataSource->GetAnchor();
507  const CSeq_id& master_id = m_DataSource->GetSeqId(master_row);
508  evt.AddRangeSelection(master_id, seq_coll);
509  }
510 
511  // set Object Selection
512  typedef IAlnMultiDataSource::TNumrow TNumrow;
513 
514  vector<TNumrow> rows;
516  ITERATE(vector<TNumrow>, it, rows) { // iterate by selected rows
517  TNumrow row = *it;
518  const CSeq_id& id = m_DataSource->GetSeqId(row);
519 
521  TSeqPos from = m_DataSource->GetSeqStart(row);
522  TSeqPos to = m_DataSource->GetSeqStop(row);
523 
524  evt.AddObjectSelection(id, CRange<TSeqPos>(from, to));
525  } else {
526  evt.AddObjectSelection(id);
527  }
528  }
529  }
530 }
531 
532 
533 // handles incoming selection broadcast (overriding CView virtual function)
534 // this event handler reacts on notification coming from CAlnMultiWidget
536 {
537  _ASSERT(evt);
538 
539  switch (evt->GetID()) {
542  if (m_SelectionService)
544  break;
545  default:
546  break;
547  }
548 }
549 
550 
552 {
553  COpenGraphicViewEvent* openEvent = static_cast<COpenGraphicViewEvent*>(evt);
555  CIRef<IProjectView> view = srv->AddProjectView("Graphical Sequence View", openEvent->GetObject(), openEvent->GetParams());
556 }
557 
558 
559 void CMultiAlignView::SetRegistryPath(const string& reg_path)
560 {
561  m_RegPath = reg_path; // store for later use
562 
563  m_AlnWidget->SetRegistryPath(reg_path + ".Widget");
564 }
565 
566 
568 {
569  if( ! m_RegPath.empty()) {
571  }
572 }
573 
574 
576 {
577  if( ! m_RegPath.empty()) {
579  }
580 }
581 
582 
584 {
585  const CObject* obj = m_OrigAnnot ? (const CObject*) m_OrigAnnot.GetPointer()
587  return obj;
588 }
589 
590 
591 ///////////////////////////////////////////////////////////////////////////////
592 /// CMultiAlignViewFactory
594 {
595  static string sid("multiple_alignment_view_factory");
596  return sid;
597 }
598 
600 {
601  static string slabel("Multiple Sequence Alignment View Factory");
602  return slabel;
603 }
604 
605 
607 {
608  string alias = GetViewTypeDescriptor().GetIconAlias();
609  provider.RegisterFileAlias(ToWxString(alias), wxT("multi_align_view.png"));
610 }
611 
612 
614  wxFileArtProvider& provider)
615 {
616  WidgetsData_RegisterCommands(cmd_reg, provider);
617  CAlnMultiWidget::RegisterCommands(cmd_reg, provider);
618 }
619 
620 
622 {
624 }
625 
626 
628 {
629  return new CMultiAlignView();
630 }
631 
632 
634 {
635 /*
636  TFingerprint print(CMultiAlignView::m_TypeDescr.GetLabel(), false);
637  if(print == fingerprint) {
638  return new CMultiAlignView();
639  }
640 */
641  return NULL;
642 }
643 
645 {
646  const type_info& type = typeid(object);
647 
648  if( typeid(CSeq_align) == type ){
649  return true;
650  }
651 
652  if( typeid(CSeq_annot) == type ){
653  const CSeq_annot* annot = dynamic_cast<const CSeq_annot*>(&object);
654  return annot && annot->IsAlign();
655  }
656 
657 /*
658  if( typeid(CSeq_id) == type ){
659  return true;
660  }
661 */
662 
663  return false;
664 }
665 
667 {
668  bool compatible = IsCompatibleWith(object, scope);
669  if (compatible) {
670  return false;
671  }
672  else {
673  const type_info& type = typeid(object);
674  if (typeid(CSeq_submit) == type) {
675  const CSeq_submit& seq_submit = dynamic_cast<const CSeq_submit&>(object);
676  if (seq_submit.IsEntrys()) {
677  const auto& first = seq_submit.GetData().GetEntrys().front();
678  if (first->IsSetAnnot() && !first->GetAnnot().empty() && first->GetAnnot().front()->IsAlign()) {
679  return true;
680  }
681  }
682  }
683  }
684  return false;
685 }
686 
687 
689 {
690  bool found_good = false;
691  bool found_bad = false;
692 
694  const CObject* object = oitr->object;
695  CScope* scope = oitr->scope;
696 
697  if( object && scope && IsCompatibleWith( *object, *scope ) ){
698  found_good = true;
699  } else {
700  found_bad = true;
701  }
702  }
703 
704  if (found_good) {
705  return fCanShowSeparated | (found_bad ? fCanShowSome : fCanShowAll);
706  }
707  else if (found_bad) {
708  found_good = false;
709  found_bad = false;
710  for (size_t i = 0; i < objects.size(); ++i) {
711  if (x_NeedsConversion(*objects[i].object, *objects[i].scope)) {
712  found_good = true;
713  }
714  else {
715  found_bad = true;
716  }
717  }
718 
719  if (found_bad) {
720  return fCanShowNone;
721  }
722  if (found_good) {
723  return fCanShowIfConverted;
724  }
725  }
726  return fCanShowNone;
727 
728 }
729 
731 {
732  if( objects.size() < 2 ){
733  return true;
734  }
735 
737  CSeq_annot::TData::TAlign& aligns = data->SetAlign();
738 
739  CScope* scope = NULL;
741  if( scope == NULL ){
742  scope = it->scope;
743  }
744  const CObject* const_obj = it->object;
745  CObject* obj = const_cast<CObject*>( const_obj );
746 
747  CRef<CSeq_align> align( dynamic_cast<CSeq_align*>( obj ) );
748  if( align ){
749  aligns.push_back( align );
750  }
751  }
752 
753  CRef<CSeq_annot> annot( new CSeq_annot() );
754  annot->SetData( *data );
755 
756  objects.clear();
757  objects.push_back(SConstScopedObject(annot, scope));
758 
759  return true;
760 }
761 
762 class CMAPanel;
763 
764 ///////////////////////////////////////////////////////////////////////////////
765 /// CMAViewManager
766 ///
768 {
769 public:
771  : COpenViewManager( factory )
772  //, mf_IsSet( false )
773  {
774  }
775 
776  virtual bool DoTransition( EAction action );
777 
778 public:
779 
780 /*
781  objects::CScope* GetScope() const { return m_Scope; }
782  const CMAView::TAlignVector& GetAligns() const { return m_Aligns; }
783  const vector<int>& GetGroups() const { return m_Groups; }
784  const vector< set<CSeq_id_Handle> >& GetHandlesSet() const { return m_AlnHandles; }
785  int GetNumSegments( int aGroupIx ) const {
786  return m_NumSegs[aGroupIx];
787  }
788 */
789  virtual wxPanel* GetCurrentPanel();
790  virtual bool CanDo( EAction action );
791 
792 protected:
793  enum EState {
795  };
796 
797 protected:
798  virtual void FinalizeParams();
799 
801  virtual CMAPanel* CreateAnchorPanel();
802  virtual void FinalizeAnchor();
803 
804 private:
806 /*
807  objects::CScope* m_Scope;
808  CMAView::TAlignVector m_Aligns;
809  vector<int> m_Groups;
810  vector< set<CSeq_id_Handle> > m_AlnHandles;
811  vector<int> m_NumSegs;
812  bool mf_IsSet;
813 */
814 };
815 
816 ///////////////////////////////////////////////////////////////////////////////
817 /// CMAPanel
818 ///
819 class CMAPanel : public CParamsPanel
820 {
821 
822 public:
823 
824  CMAPanel();
825  CMAPanel( wxWindow* parent, wxWindowID id = SYM_CONVRESPANEL_IDNAME, const wxPoint& pos = SYM_CONVRESPANEL_POSITION, const wxSize& size = SYM_CONVRESPANEL_SIZE, long style = SYM_CONVRESPANEL_STYLE );
826 
827  virtual bool Create( wxWindow* parent, wxWindowID id = SYM_CONVRESPANEL_IDNAME, const wxPoint& pos = SYM_CONVRESPANEL_POSITION, const wxSize& size = SYM_CONVRESPANEL_SIZE, long style = SYM_CONVRESPANEL_STYLE );
828 
829  void Init();
830 
831  virtual void CreateControls();
832 
833  enum {
835  ID_ONEVIEWPEROBJECT = 10035
836  };
837  ////@end CConversionResultPanel member variables
838 
839  void SetManager( CMAViewManager* aManager ){
840  m_Manager = aManager;
841  }
842 
843  /// add your methods here
844  virtual void SetObjects( CObjectList& objs );
845 
846  /// Return the selected item
847  virtual bool GetSelection( TConstScopedObjects& buf );
848 
849  /// Force OneViewPerObject true, and lock it
850  virtual void EnforceOneViewPerObject();
851 
852  /// @name IRegSettings implementation
853  /// @{
854  virtual void SetRegistryPath(const string& path);
855  virtual void LoadSettings();
856  virtual void SaveSettings() const;
857  /// @}
858 
859 private:
862 };
863 
864 
865 ///////////////////////////////////////////////////////////////////////////////
866 /// CMAViewManager implementation
867 ///
869 {
870 
871  if( m_State == eAnchor ){
872  if( action == eNext ){
873  // finalize choice
874  TConstScopedObjects seqs;
875  m_AnchorPanel->GetSelection( seqs );
876 
878  CSeq_annot::TData::TAlign& chosen_aligns = data->SetAlign();
879 
880  CScope* scope = NULL;
882  const CSeq_id* const_id = dynamic_cast<const CSeq_id*>( it->object.GetPointer() );
883  if( !const_id ) continue;
884 
885  CSeq_id_Handle chosen_idh = CSeq_id_Handle::GetHandle( *const_id );
886  chosen_idh = sequence::GetId( chosen_idh, *it->scope, sequence::eGetId_Canonical );
887 
889  if( !scope ){
890  scope = ix->scope;
891  }
892 
893  list< CRef< CSeq_align > > aligns;
894 
895  const CSeq_annot* annot = dynamic_cast<const CSeq_annot*>( ix->object.GetPointer() );
896  if( annot && annot->IsAlign() ){
897  aligns = const_cast<list< CRef< CSeq_align > >&>( annot->GetData().GetAlign() );
898  }
899 
900  const CSeq_align* align = dynamic_cast<const CSeq_align*>( ix->object.GetPointer() );
901  if( align ){
902  aligns.push_back( CRef<CSeq_align>( const_cast<CSeq_align*>( align ) ) );
903  }
904 
905 
906  NON_CONST_ITERATE( list< CRef< CSeq_align > >, aix, aligns ){
907  CSeq_align* aln = aix->GetPointer();
908 
909  int num_seqs = aln->CheckNumRows();
910  if( num_seqs <= 0 ){
911  continue;
912  }
913 
914  for( int q = 0; q < num_seqs; q++ ){
915  const CSeq_id& seq_id = aln->GetSeq_id( q );
916  if (seq_id.Match(*const_id)) {
917  chosen_aligns.push_back(*aix);
918  break;
919  }
921  idh = sequence::GetId( idh, *ix->scope, sequence::eGetId_Canonical );
922  if( idh == chosen_idh ){
923  chosen_aligns.push_back( *aix );
924  break;
925  }
926  }
927  }
928  }
929  }
930 
931  CRef<CSeq_annot> annot( new CSeq_annot() );
932  annot->SetData( *data );
933 
934  m_OutputObjects.clear();
935  m_OutputObjects.push_back(SConstScopedObject(annot, scope));
936 
937 
938 
939 
940 
941  FinalizeAnchor();
942  return true;
943 
944  } else {
945  // roll back to alignments
946  m_State = eInvalid;
947  action = eNext;
948 
949  return COpenViewManager::DoTransition( action );
950  }
951  } else {
952  if( !COpenViewManager::DoTransition( action ) ){
953  return false;
954  }
955 
956  if( m_State != eAnchor ){
957  return true;
958  }
959 
960  // if( action == eBack ) that is we came from 'Completed' (or whatever)
961  // we need to restore alignment set, otherwise we can use m_OutputObjects
962 
964  //! show panels with seqs
965 
966  set<CSeq_id_Handle> all_idh_set;
967  CRef<CObjectList> oblist( new CObjectList() );
968 
970 
971  list< CRef< CSeq_align > > aligns;
972 
973  const CSeq_annot* annot = dynamic_cast<const CSeq_annot*>( ix->object.GetPointer() );
974  if( annot && annot->IsAlign() ){
975  aligns = const_cast<list< CRef< CSeq_align > >&>( annot->GetData().GetAlign() );
976  }
977 
978  const CSeq_align* align = dynamic_cast<const CSeq_align*>( ix->object.GetPointer() );
979  if( align ){
980  aligns.push_back( CRef<CSeq_align>( const_cast<CSeq_align*>( align ) ) );
981  }
982 
983 
984  NON_CONST_ITERATE( list< CRef< CSeq_align > >, aix, aligns ){
985  CSeq_align* aln = aix->GetPointer();
986 
987  int num_seqs = aln->CheckNumRows();
988  if( num_seqs <= 0 ){
989  continue;
990  }
991 
992  for( int q = 0; q < num_seqs; q++ ){
993  const CSeq_id& seq_id = aln->GetSeq_id( q );
995  idh = sequence::GetId( idh, *ix->scope, sequence::eGetId_Canonical );
996  if( all_idh_set.insert( idh ).second ){
997  oblist->AddRow(
998  const_cast<CSeq_id*>( idh.GetSeqId().GetPointer() ),
999  ix->scope
1000  );
1001  }
1002  }
1003  }
1004  }
1005 
1007  m_AnchorPanel->Hide();
1010 
1011  m_AnchorPanel->SetObjects( *oblist );
1012 
1013 
1014  } else {
1015  FinalizeAnchor();
1016  }
1017 
1018  return true;
1019  }
1020 }
1021 
1023 {
1024  m_State = eAnchor;
1025 }
1026 
1028 {
1029  if( m_State == eAnchor ){
1030  return action == eNext || action == eBack;
1031  }
1032 
1033  return COpenViewManager::CanDo( action );
1034 }
1035 
1037 {
1038  if( m_State == eAnchor ){
1039  return m_AnchorPanel;
1040  }
1041 
1043 }
1044 
1046 {
1047  set<CSeq_id_Handle> common_idh_set;
1048 
1050 
1051  list< CRef< CSeq_align > > aligns;
1052 
1053  const CSeq_annot* annot = dynamic_cast<const CSeq_annot*>( ix->object.GetPointer() );
1054  if( annot && annot->IsAlign() ){
1055  aligns = const_cast<list< CRef< CSeq_align > >&>( annot->GetData().GetAlign() );
1056  }
1057 
1058  const CSeq_align* align = dynamic_cast<const CSeq_align*>( ix->object.GetPointer() );
1059  if( align ){
1060  aligns.push_back( CRef<CSeq_align>( const_cast<CSeq_align*>( align ) ) );
1061  }
1062 
1063 
1064  NON_CONST_ITERATE( list< CRef< CSeq_align > >, aix, aligns ){
1065  CSeq_align* aln = aix->GetPointer();
1066 
1067  int num_seqs = aln->CheckNumRows();
1068  if( num_seqs <= 0 ){
1069  continue;
1070  }
1071 
1072  set<CSeq_id_Handle> idh_set;
1073  for( int q = 0; q < num_seqs; q++ ){
1074  const CSeq_id& seq_id = aln->GetSeq_id( q );
1075  CSeq_id_Handle idh = CSeq_id_Handle::GetHandle( seq_id );
1076  idh = sequence::GetId( idh, *ix->scope, sequence::eGetId_Canonical );
1077  idh_set.insert( idh );
1078  }
1079 
1080  if( common_idh_set.empty() ){
1081  // fill the set initially
1082  common_idh_set = idh_set;
1083 
1084  } else {
1085  // check if the set has common seqs
1086  set<CSeq_id_Handle> intersection;
1087  ITERATE( set<CSeq_id_Handle>, hix, common_idh_set ){
1088  if( idh_set.find( *hix ) != idh_set.end() ){
1089  intersection.insert( *hix );
1090  }
1091  }
1092 
1093  if( intersection.empty() ){
1094  return true;
1095  } else {
1096  common_idh_set = intersection;
1097  }
1098  }
1099  }
1100  }
1101 
1102  return false;
1103 }
1104 
1106 {
1107  CMAPanel* panel = new CMAPanel();
1108 
1109  //panel->SetManager( this );
1110 
1111  return panel;
1112 }
1113 
1115 {
1116  m_State = eCompleted;
1117 }
1118 
1119 ///////////////////////////////////////////////////////////////////////////////
1120 /// CMAPanel implementation
1121 ///
1123 {
1124  Init();
1125 }
1126 
1127 
1128 CMAPanel::CMAPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
1129 {
1130  Init();
1131  Create(parent, id, pos, size, style);
1132 }
1133 
1134 
1135 bool CMAPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
1136 {
1137  ////@begin CMAPanel creation
1138  CParamsPanel::Create( parent, id, pos, size, style );
1139 
1140  CreateControls();
1141  if (GetSizer())
1142  {
1143  GetSizer()->SetSizeHints(this);
1144  }
1145  Centre();
1146  ////@end CMAPanel creation
1147  return true;
1148 }
1149 
1151 {
1152  m_Manager = NULL;
1153  m_ObLiWgt = NULL;
1154 }
1155 
1156 
1158 {
1159  ////@begin CMAPanel content construction
1160  CMAPanel* itemPanel1 = this;
1161 
1162  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
1163  itemPanel1->SetSizer(itemBoxSizer2);
1164 
1165  wxStaticText* v_StatusText = new wxStaticText(
1166  itemPanel1, wxID_ANY, _(
1167  "The supplied alignments do not contain common sequences. "
1168  "Please choose one or more sequences to be taken as basis(anchor); "
1169  "we filter out other alignments which do not contain these sequences. "
1170  "You can choose all the sequences, however, it may be impossible for "
1171  "to present the whole set of alignments in one view. "
1172  ), wxDefaultPosition, wxSize(-1, 50), 0
1173  );
1174  itemBoxSizer2->Add(v_StatusText, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
1175 
1176  m_ObLiWgt = new CObjectListWidget( itemPanel1, wxID_ANY, wxDefaultPosition, wxSize(100, 100), 0 );
1177  itemBoxSizer2->Add( m_ObLiWgt, 1, wxGROW|wxALL, 5 );
1178 
1179  /*
1180  m_OneViewPerObjectCheckBox = new wxCheckBox( itemPanel1, ID_ONEVIEWPEROBJECT, _("Open each object in a separate view"), wxDefaultPosition, wxDefaultSize, 0 );
1181  m_OneViewPerObjectCheckBox->SetValue(true);
1182  itemBoxSizer2->Add(m_OneViewPerObjectCheckBox, 0, wxALIGN_LEFT|wxLEFT|wxBOTTOM, 5);
1183  */
1184 
1185  // Set validators
1186  //m_OneViewPerObjectCheckBox->SetValidator( wxGenericValidator(& m_OneViewPerObject) );
1187  ////@end CMAPanel content construction
1188 
1189 }
1190 
1191 
1193 {
1194  m_ObLiWgt->SetObjectList( pObjList );
1195  m_ObLiWgt->SelectAll();
1196 }
1197 
1199 {
1200  if( !m_ObLiWgt->TransferDataFromWindow() ){
1201  return false;
1202  }
1203 
1205 
1206  return ( ! buf.empty());
1207 }
1208 
1210 {
1211  //CParamsPanel::ForceOneViewPerObject();
1212 }
1213 
1214 
1215 void CMAPanel::SetRegistryPath(const string& path)
1216 {
1218 }
1219 
1220 static const char* kDMGroupList = "MultiAlnAnchorList";
1221 
1222 
1224 {
1226 
1227  if( !m_RegPath.empty() ){
1229  CRegistryWriteView view = gui_reg.GetWriteView(
1230  m_RegPath + "." + kDMGroupList
1231  );
1233  }
1234 }
1235 
1236 
1238 {
1240 
1241  // Protection from older config savings
1242  m_OneViewPerObject = false;
1243 
1244  if ( !m_RegPath.empty() ) {
1246  CRegistryReadView view = gui_reg.GetReadView(
1247  m_RegPath + "." + kDMGroupList
1248  );
1249 
1251  TransferDataToWindow();
1252  }
1253 }
1254 
1256 {
1257  m_ViewManager = new CMAViewManager( *this );
1258 }
1259 
1260 
1261 
User-defined methods of the data storage class.
CRangeCollection< TSeqPos > TRangeColl
@ eCmdMarkSelected
@ eCmdShowAll
@ eCmdUnsetMaster
@ eCmdUnMarkAll
@ eCmdMoveSelectedUp
@ eCmdUnMarkSelected
@ eCmdSetSelMaster
@ eCmdShowOnlySelected
@ eCmdUnhideSelected
@ eCmdHideSelected
void Init(objects::CScope &scope, const objects::CSeq_align &align)
initial data set from which an alignment will be build
CRef< IAlnMultiDataSource > CreateDataSource()
virtual void SetListener(CDataChangeNotifier::IListener *pListener)
Subscribe a new listener for data source.
void PreCreateDataSource(bool sparse)
class CAlnMultiPane
class CAlnMultiWidget
void GetSelectedRows(vector< TNumrow > &rows)
const TRangeColl & GetSelection(void) const
virtual void SetDataSource(IAlnMultiDataSource *p_ds, objects::CScope *scope)
virtual void SaveSettings() const
virtual void LoadSettings()
virtual void SetStyleCatalog(const CRowStyleCatalog *catalog)
virtual void Select(const vector< TNumrow > &rows, bool b_select, bool b_invert_others=false)
virtual void OnDSChanged(CDataChangeNotifier::CUpdate &update)
static void RegisterCommands(CUICommandRegistry &cmd_reg, wxFileArtProvider &provider)
class CAlnMultiWidget
void SetSelection(const TRangeColl &coll)
virtual const CWidgetDisplayStyle * GetDisplayStyle() const
virtual void CreateWidget(CAlnMultiModel *model=NULL)
performs initialization, creates Model and Controls.
void SetMergeFlags(TMergeFlags flags, bool set)
Set/clear merge flags.
@ fAllowTranslocation
Allow translocations on the same row.
@ fSkipSortByScore
In greedy algos, skip sorting input alignments by score thus allowing for user-defined sort order.
CUpdate - notification send by CUIDataSource to the listener.
CEvent - generic event implementation TODO TODO - Attachments.
Definition: event.hpp:86
CGBDocument.
Definition: document.hpp:113
virtual void SetRegistryPath(const string &reg_path)
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
void SetManager(CMAViewManager *aManager)
virtual void LoadSettings()
virtual bool GetSelection(TConstScopedObjects &buf)
Return the selected item.
virtual bool Create(wxWindow *parent, wxWindowID id=SYM_CONVRESPANEL_IDNAME, const wxPoint &pos=SYM_CONVRESPANEL_POSITION, const wxSize &size=SYM_CONVRESPANEL_SIZE, long style=SYM_CONVRESPANEL_STYLE)
virtual void CreateControls()
virtual void EnforceOneViewPerObject()
Force OneViewPerObject true, and lock it.
CObjectListWidget * m_ObLiWgt
CMAViewManager * m_Manager
virtual void SetObjects(CObjectList &objs)
add your methods here
CMAPanel()
CMAPanel implementation.
virtual void SetRegistryPath(const string &path)
virtual void SaveSettings() const
CMAViewManager.
CMAPanel * m_AnchorPanel
virtual void FinalizeParams()
virtual wxPanel * GetCurrentPanel()
return the panel corresponding to the current state the function may create a new panel or return a p...
CMAViewManager(IProjectViewFactory &factory)
virtual CMAPanel * CreateAnchorPanel()
virtual void FinalizeAnchor()
virtual bool NeedAnchorPanel(TConstScopedObjects &objects)
virtual bool DoTransition(EAction action)
CMAViewManager implementation.
virtual bool CanDo(EAction action)
indicates whether a transition (action) is possible
CMultiAlignView.
void Clear(objects::CScope *scope)
void Add(ISelObjectHandle *obj_handle, CObject &obj)
void GetMatches(const CObject &object, objects::CScope &scope, TResults &results) const
CObjectListWidget - mediator widget.
void GetSelection(TConstScopedObjects &objects)
ISelection-style API.
void SetObjectList(CObjectList &list)
CObjectList Data structure representing a list of CObjects with associated Scopes and other optional ...
Definition: object_list.hpp:63
int AddRow(CObject *obj, objects::CScope *scope)
CObject –.
Definition: ncbiobj.hpp:180
SConstScopedObject & GetObject()
Definition: view_event.hpp:96
const objects::CUser_object * GetParams() const
Definition: view_event.hpp:97
virtual bool CanDo(EAction action)
indicates whether a transition (action) is possible
virtual wxPanel * GetCurrentPanel()
return the panel corresponding to the current state the function may create a new panel or return a p...
virtual bool DoTransition(EAction action)
perform transition if possible and returns true, otherwise the function shall warn the user about the...
TConstScopedObjects m_OutputObjects
The output objects after view-specific object conversion and possible object aggregation.
virtual void LoadSettings()
virtual void SaveSettings() const
virtual void SetRegistryPath(const string &path)
virtual bool Create(wxWindow *parent, wxWindowID id=ID_CPARAMSPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxNO_BORDER|wxTAB_TRAVERSAL)
CProjectService - a service providing API for operations with Workspaces and Projects.
virtual void x_ReportInvalidInputData(TConstScopedObjects &objects)
use this function to report incompatible data in InitView()
virtual void x_UpdateContentLabel()
virtual objects::CScope * x_GetScope() const
virtual void x_AttachToProject(CGBDocument &doc)
ISelectionService * m_SelectionService
virtual bool x_HasProject() const
CProjectViewEvent.
Definition: document.hpp:62
EEventSubtype GetSubtype() const
Definition: document.hpp:96
CProjectViewTypeDescriptor - holds description of a project view type.
CProjectView.
TThisType & CombineWith(const TRange &r)
Definition: range_coll.hpp:195
bool Empty() const
Definition: range_coll.hpp:138
CRef –.
Definition: ncbiobj.hpp:618
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
CRowDisplayStyle is a base class representing a display style for IAlignRow.
void SetDefaultStyle(CRowDisplayStyle *style)
assumes ownership
void SetWidgetStyle(const CWidgetDisplayStyle *style)
CScope –.
Definition: scope.hpp:92
CSelectionEvent CSelectionEvent is used for broadcasting selection between views.
Definition: obj_event.hpp:68
vector< CConstRef< objects::CSeq_id > > TIds
Definition: obj_event.hpp:75
const TIdLocs & GetIdLocs() const
Definition: obj_event.hpp:123
bool HasRangeSelection() const
Range Selection - represents a collection of selected segments.
Definition: obj_event.cpp:92
static bool sm_MatchAlnLocs
Definition: obj_event.hpp:208
void AddRangeSelection(const objects::CSeq_id &id, const TRangeColl &segs)
void GetRangeSelectionAsLocs(TConstObjects &objs) const
Definition: obj_event.cpp:145
vector< CConstRef< CIdLoc > > TIdLocs
Definition: obj_event.hpp:76
objects::CScope & GetScope()
Definition: obj_event.hpp:95
const objects::CHandleRangeMap & GetRangeSelection() const
Definition: obj_event.cpp:98
const TIds & GetIds() const
Definition: obj_event.hpp:122
bool HasObjectSelection()
Object Selection - represents select Objects (such as features, alignments, etc)
Definition: obj_event.cpp:171
bool AddObjectSelection(const CObject &obj)
Definition: obj_event.cpp:177
TDim CheckNumRows(void) const
Validatiors.
Definition: Seq_align.cpp:73
const CSeq_id & GetSeq_id(TDim row) const
Get seq-id (the first one if segments have different ids).
Definition: Seq_align.cpp:317
bool IsAlign(void) const
Definition: Seq_annot.cpp:182
bool IsEntrys(void) const
Definition: Seq_submit.cpp:54
CUICommandRegistry is a centralized registry where all application commands should be registered.
Definition: ui_command.hpp:146
wxMenu * CreateMenu(const SwxMenuItemRec *items)
create a menu from a static definition (see WX_*_MENU macros)
Definition: ui_command.cpp:349
CViewTypeDescriptor - holds description of a view type.
Definition: view.hpp:98
void LoadTableSettings(const CRegistryReadView &view, bool byName=false)
void SaveTableSettings(CRegistryWriteView &view, bool saveSorting=true) const
IAlnExplorer::TNumrow TNumrow
Alignment segment iterator interface.
EFlags
Iterator options.
@ eSkipGaps
Skip gap segments (show only aligned ranges)
virtual const TSignedRange & GetRange(void) const =0
Get the selected row range.
IProjectViewFactory.
virtual const CViewTypeDescriptor & GetViewTypeDescriptor() const
returns a Descriptor for the View Type supported by the Factory
virtual void OnSelectionChanged(ISelectionClient *source)=0
notifies Service and its observers about changes in selection
IView - represents a standard visual part of Workbench UI.
Definition: view.hpp:73
CFingerprint identifies an instance of IWMClient and is used for labeling layout positions.
Definition: wm_client.hpp:58
Definition: set.hpp:45
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
bool empty() const
Definition: set.hpp:133
const_iterator find(const key_type &key) const
Definition: set.hpp:137
const_iterator end() const
Definition: set.hpp:136
virtual void RegisterFileAlias(const wxArtID &anId, const wxArtClient &aClient, const wxSize &aSize, const wxString &aName, long aType=wxBITMAP_TYPE_ANY, int anIndex=-1)
#define _(proto)
Definition: ct_nlmzip_i.h:78
static uch flags
@ eCmdAlnShowMethodsDlg
@ eCmdMethodProperties
void WidgetsData_RegisterCommands(CUICommandRegistry &cmd_reg, wxFileArtProvider &provider)
Register standard commands defined in this file and wxWidgets headers.
#define false
Definition: bool.h:36
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:46
static int type
Definition: getdata.c:31
char data[12]
Definition: iconv.c:80
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
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
static CRef< objects::CSeq_loc > CreateSeq_loc(const objects::CSeq_id &id, const CRangeCollection< TSeqPos > &ranges)
Definition: utils.cpp:556
CObjectIndex m_ObjIndex
CAlnMultiDSBuilder m_Builder
virtual const SwxMenuItemRec * GetMenuDef() const
simpler way to provide a static menu using macros defined earlier in this file
virtual void OnProjectChanged()
void GetSelection(CSelectionEvent &evt) const
get selection for broadcasting
virtual bool x_GetSeqRangeSelection(CAlnMultiWidget::TRangeColl &seq_coll) const
virtual void x_RebuildObjectIndex()
virtual void x_GetRowSeqLoc(CAlnVec::TNumrow row, CSelectionEvent::TRangeColl &loc) const
virtual bool x_MergeObjects(TConstScopedObjects &objects)
CConstRef< objects::CSeq_annot > m_OrigAnnot
original data object passed to the view
CRef< COpenViewManager > m_ViewManager
virtual void DestroyViewWindow()
destroy Window corresponding to the view
void OnAlnWidgetSelChanged(CEvent *evt)
virtual void x_OnSetSelection(CSelectionEvent &evt)
override in derived classes in order to handle selection broadcast
IAlnExplorer::TNumrow GetNumrow() const
virtual bool IsCompatibleWith(const CObject &object, objects::CScope &scope)
virtual void CreateViewWindow(wxWindow *parent)
create Window corresponding to the view
void OnOpenGraphicalView(CEvent *evt)
virtual IView * CreateInstanceByFingerprint(const TFingerprint &fingerprint) const
if fingerprint is recognized - creates and returns a new instance
virtual void SaveSettings() const
CRowStyleCatalog m_StyleCatalog
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
virtual void OnDSChanged(CDataChangeNotifier::CUpdate &update)
virtual void LoadSettings()
bool x_NeedsConversion(const CObject &object, objects::CScope &scope)
virtual wxWindow * GetWindow()
returns a pointer to the wxWindow representing the client
virtual const CObject * x_GetOrigObject() const
virtual IView * CreateInstance() const
creates a view instance
virtual const CViewTypeDescriptor & GetTypeDescriptor() const
return an object providing meta information about thei view type
virtual void RegisterIconAliases(wxFileArtProvider &provider)
called by the framework to give Factory a chance to register images used by view
virtual string GetExtensionIdentifier() const
CMultiAlignViewFactory.
virtual void RegisterCommands(CUICommandRegistry &cmd_reg, wxFileArtProvider &provider)
called by the framework to give Factory a chance to register commands used by view
virtual bool InitView(TConstScopedObjects &objects, const objects::CUser_object *params)
initialize view with data, inside this function the view must call CProjectService::AttachView to con...
virtual bool x_GetValidInputData(const CObject *obj)
virtual int TestInputObjects(TConstScopedObjects &objects)
tests input objects (not using object conversion) and returns a combination of ETestResult flags bett...
CIRef< IAlnMultiDataSource > m_DataSource
CConstRef< objects::CSeq_align > m_OrigAlign
virtual void SetRegistryPath(const string &reg_path)
CAlnMultiWidget * m_AlnWidget
virtual const CProjectViewTypeDescriptor & GetProjectViewTypeDescriptor() const
returns a Descriptor for the View Type supported by the Factory
const TEventID GetID(void) const
Inline Implementation.
Definition: event.hpp:164
vector< CConstRef< CObject > > TConstObjects
Definition: objects.hpp:64
virtual const string & GetIconAlias() const
Definition: ui_object.cpp:130
#define END_EVENT_MAP()
Ends definition of Command Map.
#define BEGIN_EVENT_MAP(thisClass, baseClass)
Begins definition of Command Map for CEventHandler-derived class.
virtual void AddListener(CEventHandler *listener, int pool_name=ePool_Default)
Add a listener.
vector< SConstScopedObject > TConstScopedObjects
Definition: objects.hpp:65
@ eCmdResetSelection
Definition: command.hpp:97
@ eCmdZoomSeq
Zoom to Selection.
Definition: command.hpp:74
@ eCmdZoomSel
Definition: command.hpp:73
CConstRef< CSeq_id > GetSeqId(void) const
bool Match(const CSeq_id &sid2) const
Match() - TRUE if SeqIds are equivalent.
Definition: Seq_id.hpp:1065
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
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,...
@ eGetId_Canonical
Definition: sequence.hpp:114
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:1439
bool Empty(void) const THROWS_NONE
Check if CRef is empty – not pointing to any object, which means having a null value.
Definition: ncbiobj.hpp:719
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
TTo GetTo(void) const
Get the To member data.
Definition: Range_.hpp:269
TFrom GetFrom(void) const
Get the From member data.
Definition: Range_.hpp:222
void SetData(TData &value)
Assign a value to Data data member.
Definition: Seq_annot_.cpp:244
list< CRef< CSeq_align > > TAlign
Definition: Seq_annot_.hpp:194
const TAlign & GetAlign(void) const
Get the variant data.
Definition: Seq_annot_.hpp:641
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_annot_.hpp:873
const TEntrys & GetEntrys(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
char * buf
int i
#define wxT(x)
Definition: muParser.cpp:41
USING_SCOPE(objects)
ON_EVENT(CAlnMultiPane::CEvent, CAlnMultiPane::eLinearSelChanged, &CMultiAlignView::OnAlnWidgetSelChanged) ON_EVENT(CAlnMultiPane
vector< CConstRef< CSeq_id > > TRSeqIdVector
CProjectViewTypeDescriptor s_MultiAlignViewTypeDescr("Multiple Sequence Alignment View", "multi_align_view", "Multiple Sequence Alignment View hint", "View for the multiple alignments with each column and residue colored according to its degree of mismatch", "MULTI_ALIGN_VIEW", "Alignment", false, "Seq-align", eAnyObjectsAccepted)
CMultiAlignView.
CMultiAlignViewCommands
@ eCmdUseSparseAln
static const char * kDMGroupList
const struct ncbi::grid::netcache::search::fields::SIZE size
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
#define SYM_CONVRESPANEL_POSITION
#define SYM_CONVRESPANEL_IDNAME
#define SYM_CONVRESPANEL_STYLE
CConversionResultPanel.
#define SYM_CONVRESPANEL_SIZE
static int match(PCRE2_SPTR start_eptr, PCRE2_SPTR start_ecode, uint16_t top_bracket, PCRE2_SIZE frame_size, pcre2_match_data *match_data, match_block *mb)
Definition: pcre2_match.c:594
static int * results[]
@ eAnyObjectsAccepted
static static static wxID_ANY
#define row(bind, expected)
Definition: string_bind.c:73
Definition: type.c:6
#define _ASSERT
#define WX_DEFINE_MENU(name)
New macros for defining menus for use with CUICommandRegistry.
Definition: ui_command.hpp:266
#define WX_SUBMENU(label)
Definition: ui_command.hpp:288
#define WX_END_MENU()
Definition: ui_command.hpp:294
#define WX_MENU_SEPARATOR_L(label)
Definition: ui_command.hpp:285
#define WX_MENU_ITEM(cmd)
Definition: ui_command.hpp:270
#define WX_MENU_SEPARATOR()
Definition: ui_command.hpp:282
#define WX_END_SUBMENU()
Definition: ui_command.hpp:291
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
Modified on Fri Sep 20 14:57:49 2024 by modify_doxy.py rev. 669887