Post

2 followers Follow
0
Avatar

Suggestions on modifying user selection in sequence viewer

Hi

I am trying to create a plugin that will allow me to invert the highlighted selection within the sequence viewer.  In other words I want to have a menu option that selects everything except what is currently selected.

 

I am new to Java, so wading through the API has been a bit of a challenge for me, below is my general idea of what I want from the plugIn and how I think I can go about programming it.  Once again I am new to Java so please forgive, and feel free to correct, any mistakes I may be making.

 

General outline of plugin goals

1) In general I work with nucleotide files, so I will focus on that sequence type first.  However I would also like the plugin to eventually handle other sequence types (amino acids).   

 

2) From messing around from within to GUI using the “Go To Base”  I have a few guesses on how to get the behavior I want.  In general I am going to switch the start and stop coordinates of the selected sequence.  However, I think I will also have to wrap around the sequence character array depending on the location of the start and stop points. While I have not been able to code the actual logic statements I think with a few nested if/else statements I will be able to get the behavior I want.  

 

3) I would like the feature to be selectable from either the sequence menu or by right clicking within the sequence viewer.



Basic Plugin Overview (invertSequence)

 

I was planning on having “invertSequence” extend the SequenceAnnotationGenerator class. Does this seem the most appropriate? I am starting to think it is not.   Is there an example in the Dev Kit that you think would be the best for me to use as a template?



Is the SequenceSelection.SelectionInterval class the best way to get the information about what sequences are currently selected from the user?  I realize this is basically the first step and I am sadly stumped.

 

Once I get the correct sequence coordinates from the user I am unclear if the SequenceSelection.SelectionInterval will return a highlighted selection to the user once I have run the starting coordinates through the ‘invertCoordinates” logic.  Please let me know if the SequenceSelection.SelectionInterval is the best way to return a highlighted sequence.

 

One last question is, I have seen a few examples of how to place a plugin into the top menu bar, but I have not been able to determine how to get the plugin into a right click menu.  I have tried to use the setInPopupMenu method, but I did not see the my option.  Is setInPopupMenu option the way to place the plugin action in the right click menu?

 

Thanks for any help or suggestions 

 

jeremy labarge

Please sign in to leave a comment.

4 comments

0
Avatar

Hi Jeremy,

It's great to see you're keen to write a plugin in Geneious. Unfortunately, that particular functionality (changing the selection in the sequence viewer) isn't going to be possible within the current API framework.

But if you could let us know why you'd like to invert the selection in the sequence viewer, we might be able to suggest an alternative solution.

Hilary Miller 0 votes
Comment actions Permalink
0
Avatar

Hi Matt,

 

Thanks for getting back to me.   An invert selection feature would be quite useful for me when I am building new  plasmids.  I often use the same backbone and exchange out an expression cassette.  So for example, if I want to change out the lacZalpha gene in pUC19 I can easily highlight the gene. but selecting the vector is a bit more annoying.  I can select the region I want by hand or with the 'go to sequence', but it is a bit annoying.    I have also found examples where I try and select the backbone using annotated features and cannot select the vector backbone.   For example in pUC19, if you select the 'bla signal peptide' feature and the 'lacZalpha gene' you select at 738 bp fragment. However I cannot find a way to select everything BUT those pieces.  I think I will be able to copy and duplicate the vector backbone and delete the regions I want to replace.  So there, are workarounds, but I a quick invert highlighted sequence would have been a bit easier.  

Thanks again for your quick reply,

Jeremy

jeremy labarge 0 votes
Comment actions Permalink
0
Avatar

Hi Jeremy,

Thanks for the feedback. Although you can't write a plugin to do it, it was fairly straight forward to add this action to the sequence viewer plugin itself. So I've added an "Invert Selection" entry in the right click menu for the next R8 beta (Geneious 8.0.1) which will probably be available within the next two weeks.

Hilary Miller 0 votes
Comment actions Permalink
0
Avatar

Hi Matt,

 

Thank you so much!  I will download the R8 beta in a few weeks and  try it out.

 

Jeremy

jeremy labarge 0 votes
Comment actions Permalink