Post

2 followers Follow
0
Avatar

SequenceGraph customization

We are doing a custom sequence graph. We have a large calculation that we need to reuse for all the draw calls but we don't want to recalculate with every draw. The value would only change when sequences change.

Do you have a good idea about where shall  we trigger the calculation and what is the best place to store it?

Adrian

Please sign in to leave a comment.

4 comments

0
Avatar

Hi Adrian,

The value returned from getOptions() is one of our standard Geneious classes.  The JavaDoc has many examples of how to construct one with different parameter types.  See https://assets.geneious.com/developer/geneious/javadoc/latest/index.html?com/biomatters/geneious/publicapi/plugin/Options.html

Here is a very simple example of one with a checkbox:

options = new Options(getClass());
checkboxOption = options.addBooleanOption("name", "label", true);
Geneious Team 0 votes
Comment actions Permalink
0
Avatar

Hi Guys,

I already did that, I was just asking how to get the size default option and also wondering about this long running calculation.

 

Thank you

 

Adrian 0 votes
Comment actions Permalink
0
Avatar

Hi Adrian,

Hmmm I'm not sure what happened with you original question.  It came through yesterday asking about the Options.  Sorry about the confusion.

To answer your question about the background calculations.  Store the calculated values in a field in your SeqeunceGraph.  Do the calculation in your implementation of SequenceGraph.performBackgroundCalculations() and make sure you are checking the progressListener for cancellation.

Geneious will call setResidues() on your SequenceGraph if the sequence changes and will then subsequently call performBackgroundCalculations().

Your implementation of draw will not be called while the calculations are taking place.

Geneious Team 0 votes
Comment actions Permalink
0
Avatar

Thank you. I did that and it works most of the cases however there seem to be instances where draw is called before performBackround calculations is called and it ends with a NLP because the needed data model is not filled in.

Adrian 0 votes
Comment actions Permalink