75 "Multiple Sequence Alignment View",
77 "Multiple Sequence Alignment View hint",
78 "View for the multiple alignments with each column and residue colored according to its degree of mismatch",
154 m_MenuBarMenu.reset(cmd_reg.
CreateMenu(kViewMenu));
219 obj =
objects[0].object.GetPointer();
220 scope =
objects[0].scope.GetPointer();
228 if (!ws)
return false;
260 &&
m_OrigAnnot->GetData().GetAlign().front()->CanGetSegs()
262 m_OrigAnnot->GetData().GetAlign().front()->GetSegs().IsSparse()
263 ||
m_OrigAnnot->GetData().GetAlign().front()->GetSegs().IsSpliced()
378 m_DataSource->GetSeqFromAln(master_row, aln_coll, seq_coll);
391 vector<TNumrow> rows;
394 objs.reserve(rows.size());
396 ITERATE(vector<TNumrow>, it, rows) {
436 m_DataSource->GetAlnFromSeq(master_row, coll, aln_coll);
443 vector<CAlnVec::TNumrow> sel_rows;
463 sel_rows.push_back(row_handle->
GetNumrow());
484 if(pos == id_loc->m_Range.GetFrom()) {
486 match = (pos == id_loc->m_Range.GetTo());
490 sel_rows.push_back(
row);
514 vector<TNumrow> rows;
516 ITERATE(vector<TNumrow>, it, rows) {
539 switch (evt->
GetID()) {
595 static string sid(
"multiple_alignment_view_factory");
601 static string slabel(
"Multiple Sequence Alignment View Factory");
646 const type_info&
type =
typeid(object);
654 return annot && annot->
IsAlign();
673 const type_info&
type =
typeid(object);
678 if (
first->IsSetAnnot() && !
first->GetAnnot().empty() &&
first->GetAnnot().front()->IsAlign()) {
690 bool found_good =
false;
691 bool found_bad =
false;
694 const CObject*
object = oitr->object;
695 CScope* scope = oitr->scope;
707 else if (found_bad) {
744 const CObject* const_obj = it->object;
749 aligns.push_back( align );
872 if( action ==
eNext ){
882 const CSeq_id* const_id =
dynamic_cast<const CSeq_id*
>( it->object.GetPointer() );
883 if( !const_id )
continue;
893 list< CRef< CSeq_align > > aligns;
896 if( annot && annot->
IsAlign() ){
897 aligns =
const_cast<list< CRef< CSeq_align >
>&>( annot->
GetData().
GetAlign() );
914 for(
int q = 0; q < num_seqs; q++ ){
916 if (seq_id.
Match(*const_id)) {
917 chosen_aligns.push_back(*aix);
922 if( idh == chosen_idh ){
923 chosen_aligns.push_back( *aix );
971 list< CRef< CSeq_align > > aligns;
974 if( annot && annot->
IsAlign() ){
975 aligns =
const_cast<list< CRef< CSeq_align >
>&>( annot->
GetData().
GetAlign() );
992 for(
int q = 0; q < num_seqs; q++ ){
996 if( all_idh_set.
insert( idh ).second ){
1051 list< CRef< CSeq_align > > aligns;
1054 if( annot && annot->
IsAlign() ){
1055 aligns =
const_cast<list< CRef< CSeq_align >
>&>( annot->
GetData().
GetAlign() );
1068 if( num_seqs <= 0 ){
1073 for(
int q = 0; q < num_seqs; q++ ){
1080 if( common_idh_set.
empty() ){
1082 common_idh_set = idh_set;
1088 if( idh_set.
find( *hix ) != idh_set.
end() ){
1089 intersection.
insert( *hix );
1093 if( intersection.
empty() ){
1096 common_idh_set = intersection;
1143 GetSizer()->SetSizeHints(
this);
1162 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
1163 itemPanel1->SetSizer(itemBoxSizer2);
1165 wxStaticText* v_StatusText =
new wxStaticText(
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
1174 itemBoxSizer2->Add(v_StatusText, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
1177 itemBoxSizer2->Add(
m_ObLiWgt, 1, wxGROW|wxALL, 5 );
1200 if( !
m_ObLiWgt->TransferDataFromWindow() ){
1206 return ( !
buf.empty());
1251 TransferDataToWindow();
User-defined methods of the data storage class.
CRangeCollection< TSeqPos > TRangeColl
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)
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.
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.
void SetManager(CMAViewManager *aManager)
virtual void LoadSettings()
virtual bool GetSelection(TConstScopedObjects &buf)
Return the selected item.
@ ID_CCONVERSIONRESULTPANEL
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
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
void Clear(objects::CScope *scope)
void Add(ISelObjectHandle *obj_handle, CObject &obj)
void GetMatches(const CObject &object, objects::CScope &scope, TResults &results) const
CObjectList Data structure representing a list of CObjects with associated Scopes and other optional ...
int AddRow(CObject *obj, objects::CScope *scope)
SConstScopedObject & GetObject()
const objects::CUser_object * GetParams() const
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...
wxWindow * m_ParentWindow
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
EEventSubtype GetSubtype() const
CProjectViewTypeDescriptor - holds description of a project view type.
TThisType & CombineWith(const TRange &r)
class CRegistryReadView provides a nested hierarchical view at a particular key.
CRowDisplayStyle is a base class representing a display style for IAlignRow.
void SetDefaultStyle(CRowDisplayStyle *style)
assumes ownership
void SetWidgetStyle(const CWidgetDisplayStyle *style)
CSelectionEvent CSelectionEvent is used for broadcasting selection between views.
vector< CConstRef< objects::CSeq_id > > TIds
const TIdLocs & GetIdLocs() const
bool HasRangeSelection() const
Range Selection - represents a collection of selected segments.
static bool sm_MatchAlnLocs
void AddRangeSelection(const objects::CSeq_id &id, const TRangeColl &segs)
void GetRangeSelectionAsLocs(TConstObjects &objs) const
vector< CConstRef< CIdLoc > > TIdLocs
objects::CScope & GetScope()
const objects::CHandleRangeMap & GetRangeSelection() const
const TIds & GetIds() const
bool HasObjectSelection()
Object Selection - represents select Objects (such as features, alignments, etc)
bool AddObjectSelection(const CObject &obj)
TDim CheckNumRows(void) const
Validatiors.
const CSeq_id & GetSeq_id(TDim row) const
Get seq-id (the first one if segments have different ids).
bool IsEntrys(void) const
CUICommandRegistry is a centralized registry where all application commands should be registered.
wxMenu * CreateMenu(const SwxMenuItemRec *items)
create a menu from a static definition (see WX_*_MENU macros)
CViewTypeDescriptor - holds description of a view type.
void LoadTableSettings(const CRegistryReadView &view, bool byName=false)
void SaveTableSettings(CRegistryWriteView &view, bool saveSorting=true) const
IAlnExplorer::TNumrow TNumrow
Alignment segment iterator interface.
@ eSkipGaps
Skip gap segments (show only aligned ranges)
virtual const TSignedRange & GetRange(void) const =0
Get the selected row range.
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.
CFingerprint identifies an instance of IWMClient and is used for labeling layout positions.
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
virtual void RegisterFileAlias(const wxArtID &anId, const wxArtClient &aClient, const wxSize &aSize, const wxString &aName, long aType=wxBITMAP_TYPE_ANY, int anIndex=-1)
void WidgetsData_RegisterCommands(CUICommandRegistry &cmd_reg, wxFileArtProvider &provider)
Register standard commands defined in this file and wxWidgets headers.
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
CIRef< T > GetServiceByType()
retrieves a typed reference to a service, the name of C++ type is used as the name of the service.
static CRef< objects::CSeq_loc > CreateSeq_loc(const objects::CSeq_id &id, const CRangeCollection< TSeqPos > &ranges)
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 ®_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.
vector< CConstRef< CObject > > TConstObjects
virtual const string & GetIconAlias() const
#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
@ eCmdZoomSeq
Zoom to Selection.
CConstRef< CSeq_id > GetSeqId(void) const
bool Match(const CSeq_id &sid2) const
Match() - TRUE if SeqIds are equivalent.
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,...
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
bool Empty(void) const THROWS_NONE
Check if CRef is empty – not pointing to any object, which means having a null value.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
void SetData(TData &value)
Assign a value to Data data member.
list< CRef< CSeq_align > > TAlign
const TAlign & GetAlign(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
const TEntrys & GetEntrys(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
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.
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)
#define row(bind, expected)
#define WX_DEFINE_MENU(name)
New macros for defining menus for use with CUICommandRegistry.
#define WX_SUBMENU(label)
#define WX_MENU_SEPARATOR_L(label)
#define WX_MENU_ITEM(cmd)
#define WX_MENU_SEPARATOR()
wxString ToWxString(const string &s)