72 "Alignment Span View",
74 "Show tabular information about matches and mismatches",
75 "The Alignment Span View provides a tabular break-down of matches, "
76 "mismatches and gaps in bounded regions within an alignment",
106 static bool initialized =
false;
131 wxMenu* view_menu =
new wxMenu();
134 view_menu->Append( wxID_SEPARATOR,
wxT(
"Actions") );
137 wxMenu* bar_menu =
new wxMenu();
138 bar_menu->Append(
wxID_ANY,
wxT(
"&View"), view_menu );
147 m_Panel =
new wxPanel( parent );
150 wxBoxSizer* main_sizer =
new wxBoxSizer( wxVERTICAL );
151 m_Panel->SetSizer( main_sizer );
174 m_Panel->PopEventHandler(
true );
274 TIdExtract id_extract;
275 TAlnIdMap aln_id_map( id_extract, container.size() );
276 ITERATE( CAlnContainer, aln_it, container ){
278 aln_id_map.push_back( **aln_it );
280 } catch( CAlnException e ){
281 LOG_POST( Error << "Skipping this alignment: " << e.what() );
286 TAlnStats aln_stats( aln_id_map );
289 if ( !aln_stats.CanBeAnchored() ) {
290 LOG_POST( Error << "Input alignments cannot be anchored because they don't share at least one common sequence." );
296 CAlnUserOptions aln_user_options;
299 TAnchoredAlnVec anchored_aln_vec;
300 CreateAnchoredAlnVec( aln_stats, anchored_aln_vec, aln_user_options );
302 BuildAln( anchored_aln_vec, m_AnchoredAln, aln_user_options );
304 if( m_AnchoredAln.GetDim() == 1 ){
305 m_AnchoredAln = CAnchoredAln();
307 aln_user_options.m_MergeAlgo = CAlnUserOptions::ePreserveRows;
309 BuildAln( anchored_aln_vec, m_AnchoredAln, aln_user_options );
313 CRef<CSparseAln> sparse_aln;
314 sparse_aln.Reset( new CSparseAln( m_AnchoredAln, *GetScope() ) );
316 m_Model.reset( new CAlnSpanVertModel( *sparse_aln ) );
338 m_Model->SetMarkIndels( aln_type );
339 m_Model->SetThreshold( 1000000 );
400 const CObject*
object = cso_it->object.GetPointer();
494 if ((*iter)->IsEmpty()) {
495 if (ranges.find(idh) == ranges.end()) {
500 ranges[idh] +=
range;
504 ITERATE (TRangeMap, iter, ranges) {
506 loc->
SetInt().SetFrom(iter->second.GetFrom());
507 loc->
SetInt().SetTo(iter->second.GetTo());
508 loc->
SetId(*iter->first.GetSeqId());
527 ranges[idh] +=
range;
530 ITERATE (TRangeMap, iter, ranges) {
594 int total_rows =
m_Model->GetNumRows();
596 if( total_rows != 1 ){
601 if( rows_shown != total_rows ){
603 status_msg +=
" shown";
607 if( rows_selected > 0 ){
609 status_msg +=
" selected";
626 static string sid(
"align_span_view_factory");
633 static string slabel(
"Align Span View Factory");
670 bool found_good =
false;
671 bool found_bad =
false;
674 const type_info&
type =
typeid(*obj);
void Init(objects::CScope &scope, const objects::CSeq_align &align)
initial data set from which an alignment will be build
void SetSyncCreate(bool sync)
CRef< IAlnMultiDataSource > CreateDataSource()
void PreCreateDataSource(bool sparse)
CRegistryWriteView GetWriteView(const string §ion)
get a read-write view at a particular level.
static CGuiRegistry & GetInstance()
access the application-wide singleton
CRegistryReadView GetReadView(const string §ion) const
get a read-only view at a particular level.
virtual void OnProjectChanged()
virtual void x_UpdateContentLabel()
virtual CRef< objects::CScope > GetScope() const
unique_ptr< const wxMenu > m_MenuBarMenu
virtual bool x_HasProject() const
EEventSubtype GetSubtype() const
CProjectViewTypeDescriptor - holds description of a project view type.
virtual void OnWidgetSelChanged()
class CRegistryReadView provides a nested hierarchical view at a particular key.
CSelectionEvent CSelectionEvent is used for broadcasting selection between views.
void AddRangeSelection(const objects::CSeq_id &id, const TRangeColl &segs)
bool HasObjectSelection()
Object Selection - represents select Objects (such as features, alignments, etc)
Template class for iteration on objects of class C (non-medifiable version)
EEventType GetType() const
CViewTypeDescriptor - holds description of a view type.
void AddLocation(const objects::CSeq_loc &loc)
IwxTableModel * GetModel() const
void LoadTableSettings(const CRegistryReadView &view, bool byName=false)
void SaveTableSettings(CRegistryWriteView &view, bool saveSorting=true) const
int GetNumRowsVisible() const
virtual const CViewTypeDescriptor & GetViewTypeDescriptor() const
returns a Descriptor for the View Type supported by the Factory
IView - represents a standard visual part of Workbench UI.
CFingerprint identifies an instance of IWMClient and is used for labeling layout positions.
virtual void RegisterFileAlias(const wxArtID &anId, const wxArtClient &aClient, const wxSize &aSize, const wxString &aName, long aType=wxBITMAP_TYPE_ANY, int anIndex=-1)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
CAlnSpanWidget * m_AlnWidget
virtual int TestInputObjects(TConstScopedObjects &objects)
tests input objects (probably using object conversion, or not) and returns a combination of ETestResu...
CRef< IAlnMultiDataSource > m_DataSource
virtual wxWindow * GetWindow()
returns a pointer to the wxWindow representing the client
virtual void RegisterIconAliases(wxFileArtProvider &provider)
called by the framework to give Factory a chance to register images used by view
virtual objects::CScope * x_PreAttachToProject(TConstScopedObjects &objects)
virtual string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
vector< CConstRef< CSeq_align > > m_InputAligns
virtual void SetRegistryPath(const string ®_path)
virtual void GetSelection(CSelectionEvent &evt) const
get selection for broadcasting
virtual IView * CreateInstanceByFingerprint(const TFingerprint &fingerprint) const
if fingerprint is recognized - creates and returns a new instance
virtual IView * CreateInstance() const
creates a view instance
virtual void x_OnSetSelection(CSelectionEvent &evt)
override in derived classes in order to handle selection broadcast
virtual void DestroyViewWindow()
destroy Window corresponding to the view
virtual void LoadSettings()
virtual const CObject * x_GetOrigObject() const
CConstRef< CSeq_annot > m_OrigAnnot
original data object passed to the view
virtual void OnWidgetSelChanged()
virtual void x_CreateMenuBarMenu()
initializes m_MenuBarMenu; override in derived classes
virtual void CreateViewWindow(wxWindow *parent)
create Window corresponding to the view
CConstRef< CBioseq > m_OrigBioseq
virtual const CProjectViewTypeDescriptor & GetProjectViewTypeDescriptor() const
returns a Descriptor for the View Type supported by the Factory
virtual void SaveSettings() const
virtual void x_UpdateStatusMessage()
CConstRef< CSeq_align > m_OrigAlign
void x_InitMenuResources()
virtual const CViewTypeDescriptor & GetTypeDescriptor() const
return an object providing meta information about thei view type
virtual void OnWidgetRangeChanged()
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
static CProjectViewTypeDescriptor m_TypeDescr
wxStatusBar * m_StatusBar
unique_ptr< CAlnSpanVertModel > m_Model
virtual void x_PostAttachToProject()
virtual void GetVisibleRanges(CVisibleRange &vrange) const
populate a visible range event for broadcasting
virtual const string & GetIconAlias() const
virtual void AddListener(CEventHandler *listener, int pool_name=ePool_Default)
Add a listener.
vector< SConstScopedObject > TConstScopedObjects
void SetId(CSeq_id &id)
set the 'id' field in all parts of this location
CSeq_id_Handle GetIdHandle(const CSeq_loc &loc, CScope *scope)
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
bool NotNull(void) const THROWS_NONE
Check if pointer is not null – same effect as NotEmpty().
void Reset(void)
Reset reference object.
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
range(_Ty, _Ty) -> range< _Ty >
@ eSimilarObjectsAccepted
wxString ToWxString(const string &s)