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
Please sign in to leave a comment.