Post

2 followers Follow
0
Avatar

Creating custom tables

I would like to add a (different) SNP table view to annotation menu (Sequence Names X  positions). And just like the annoation table it should be able to respond to the sequence view when I click on a annotation. In which way can I add such a table?

 

 

VL

Please sign in to leave a comment.

5 comments

0
Avatar

You should use the ExampleDocumentViewerPlugin from the dev kit as a starting point. From there you can return a JTable as the viewer component and use DocumentViewer.getIncomingMessageHandler and getOutgoingMessageHandler to synchronize selection with the other viewers.

Richard Moir 0 votes
Comment actions Permalink
0
Avatar

DU eto the DocumentViewerFactory I was forced to use createViewer(AnnotatedPluginDocument[] arg0). But I defined valid documents as SequenceAlignmetnDocuments. How can I convert AnnotatedPluginDocument to SequenceAlignmentDocuments again?

 

VL 0 votes
Comment actions Permalink
0
Avatar
SequenceAlignmentDocument alignment = (SequenceAlignmentDocument) annotatedDocuments[0].getDocumentOrCrash();
Richard Moir 0 votes
Comment actions Permalink
0
Avatar

As far as I notices it is not the tracks (with SNPs) I wanted to have. But I want all bases which are different from the consensus, i.e. the colored bases.

Furthermore I do not understand where to put the message handlers.

I've got:

public DocumentViewer createViewer(AnnotatedPluginDocument[] annotatedDocuments) {

MyTable myViewer = new MyTable(...);

// myViewer.getIncomingMessageHandler does not contain any information. Because it is only called once

}

VL 0 votes
Comment actions Permalink
0
Avatar

The highlighted bases are calculated by the alignment view and not accessible via the API unfortunately, your viewer will have to determine where the mismatches are independently.

Please refer to the Javadoc for DocumentViewerMessageHandler. Your DocumentViewer must override the getIncomingMessageHandler method and return a message handler to receive events.

Richard Moir 0 votes
Comment actions Permalink