public abstract class SequenceAnnotationGenerator extends Object
GeneiousPlugin.getSequenceAnnotationGenerators().
Here is an example of a SequenceAnnotationGenerator the implements a simple motif finder.
public class ExampleSequenceAnnotationGenerator extends SequenceAnnotationGenerator {
public GeneiousActionOptions getActionOptions() {
return new GeneiousActionOptions("Example Find Motif",
"Finds a non-ambiguous motif and creates annotations covering each occurance").
setMainMenuLocation(GeneiousActionOptions.MainMenu.Sequence);
}
public String getHelp() {
return "This plugin shows how to create a simple SequenceAnnotationGenerator by providing a simple implemenation of a Motif finder.";
}
public Options getOptions(AnnotatedPluginDocument[] documents, SelectionRange selectionRange) throws DocumentOperationException {
return new ExampleSequenceAnnotationGeneratorOptions(); // Provides all the options we display to the user. See ExampleSequenceAnnotationGeneratorOptions below for details.
}
public DocumentSelectionSignature[] getSelectionSignatures() {
return new DocumentSelectionSignature[] {
new DocumentSelectionSignature(NucleotideSequenceDocument.class,1,1)
// This indicates this annotation generator will accept a single nucleotide sequence as input
};
}
public List<List<SequenceAnnotation>> generateAnnotations(AnnotatedPluginDocument[] annotatedPluginDocuments, SelectionRange selectionRange, ProgressListener progressListener, Options _options) throws DocumentOperationException {
NucleotideSequenceDocument sequence= (NucleotideSequenceDocument) annotatedPluginDocuments[0].getDocument();
// We can safely access the first element from the array since our selection signature specifies we accept 1 and only 1 document.
// And we can safely cast it to a NucleotideSequenceDocument as the selection signature specified that too.
ExampleSequenceAnnotationGeneratorOptions options = (ExampleSequenceAnnotationGeneratorOptions) _options;
// We can safely cast this to ExampleSequenceAnnotationGeneratorOptions because that is all we ever return from getOptions()
String sequenceString=sequence.getSequenceString().toUpperCase();
List<SequenceAnnotation> results = new ArrayList<SequenceAnnotation>();
String basesToFind=options.getBasesToFind();
if (basesToFind.length()==0) {
throw new DocumentOperationException("Must specify at least 1 base to find");
}
int indexToSearchFrom=0;
int foundIndex;
while((foundIndex=sequenceString.indexOf(basesToFind, indexToSearchFrom))>=0) {
final SequenceAnnotationInterval interval = new SequenceAnnotationInterval(foundIndex + 1, foundIndex + basesToFind.length());
SequenceAnnotation annotation=new SequenceAnnotation(options.getAnnotationName(),options.getAnnotationType(),interval);
results.add(annotation);
indexToSearchFrom=foundIndex+1;
}
if (options.isAlsoFindReverse()) {
String reversedSequenceString = SequenceUtilities.reverseComplement(sequenceString).toString();
indexToSearchFrom = 0;
while((foundIndex=reversedSequenceString.indexOf(basesToFind, indexToSearchFrom))>=0) {
final SequenceAnnotationInterval interval = new SequenceAnnotationInterval(sequenceString.length()-foundIndex, sequenceString.length()-foundIndex - basesToFind.length()+1);
SequenceAnnotation annotation=new SequenceAnnotation(options.getAnnotationName(),options.getAnnotationType(),interval);
results.add(annotation);
indexToSearchFrom=foundIndex+1;
}
}
return Arrays.asList(results); // Put the results in a single element array since we only operate on a single sequence hence there is only 1 set of results.
}
private static class ExampleSequenceAnnotationGeneratorOptions extends Options {
private final BooleanOption alsoFindReverse;
private final StringOption basesToFind;
private final StringOption annotationType;
private final StringOption annotationName;
private ExampleSequenceAnnotationGeneratorOptions() {
basesToFind = addStringOption("basesToFind","Bases to find","");
alsoFindReverse = addBooleanOption("alsoFindReverse", "Also find on reverse complement", true);
annotationType = addStringOption("annotationType","Annotation type", SequenceAnnotation.TYPE_MOTIF);
annotationType.setAdvanced(true);
annotationType.setDescription("The type of annotations that will be created on each matching occurnace");
annotationName = addStringOption("annotationName","Annotation name", "");
annotationName.setAdvanced(true);
annotationName.setDescription("The name of the annotations that will be created on each matching occurnace");
}
public boolean isAlsoFindReverse() {
return alsoFindReverse.getValue();
}
public String getBasesToFind() {
return basesToFind.getValue().toUpperCase();
}
public String getAnnotationType() {
return annotationType.getValue();
}
public String getAnnotationName() {
return annotationName.getValue();
}
}
}
For more advanced usage, such as deleting annotations, or modifiying bases/residues, implement
generate(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange, jebl.util.ProgressListener, Options).| Modifier and Type | Class and Description |
|---|---|
static class |
SequenceAnnotationGenerator.AnnotationGeneratorResult
Represents the result of a single sequence from calling an annotation generator via
generate(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange, jebl.util.ProgressListener, Options) |
static class |
SequenceAnnotationGenerator.AnnotationGeneratorResultOnAlignment
Represents the results of running a generator on a single alignment.
|
static class |
SequenceAnnotationGenerator.AnnotationGeneratorResultsOnSingleSequence
An implementation of a List of
SequenceAnnotationGenerator.AnnotationGeneratorResult where all elements except one are empty results. |
static class |
SequenceAnnotationGenerator.SelectionGrabOption
If any option returned from
getOptions(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange)
is a SelectionGrabOption then the sequence viewer will interact with the option such that when the user clicks on the button representing this option, the current selection
in the sequence viewer is copied to this option value. |
static class |
SequenceAnnotationGenerator.SelectionRange
represents a rectangular selection range in a list of sequences, and also behaves like a Linked List in that it provides a link to the
next SelectionRange in a chain of selections (see
SequenceAnnotationGenerator.SelectionRange.getNext(). |
static class |
SequenceAnnotationGenerator.SingleSequenceResultGenerator
Provides a system for a SequenceAnnotationGenerator to generate results for just a single sequence.
|
| Constructor and Description |
|---|
SequenceAnnotationGenerator() |
| Modifier and Type | Method and Description |
|---|---|
List<SequenceAnnotationGenerator.AnnotationGeneratorResult> |
generate(AnnotatedPluginDocument[] documents,
SequenceAnnotationGenerator.SelectionRange selectionRange,
ProgressListener progressListener,
Options options)
Create annotations (and/or deletes annotations and/or modifies residues and/or modifies field values) on a set of documents.
|
List<List<SequenceAnnotation>> |
generateAnnotations(AnnotatedPluginDocument[] documents,
SequenceAnnotationGenerator.SelectionRange selectionRange,
ProgressListener progressListener,
Options options)
Deprecated.
use
generate instead.
Create annotations from a set of documents.
Note: The operation will be run in a non AWT thread. If you need to perform user interface
interaction in addition to the options provided in the Options (for example prompting for user input)
then you need to place this inside a ThreadUtilities.invokeAndWait() function call.
WARNING: Geneious may call this method multiple times simultaneously.
Therefore, any implementation should not store its internal state
within instance fields.
WARNING: The default implementation of this method calls generate(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange, jebl.util.ProgressListener, Options)
but returns only the list of annotations, so any tracks, residue additions or deletions, and annotation deletions will not be respected.
If you are invoking a SequenceAnnotationGenerator in another plugin, call
generate(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange, jebl.util.ProgressListener, Options) instead. |
List<List<SequenceAnnotation>> |
generateAnnotations(SequenceAnnotationGenerator.SelectionRange selectionRange,
ProgressListener progressListener,
Options options,
AnnotatedPluginDocument... documents)
|
List<List<SequenceAnnotation>> |
generateAnnotations(SequenceAnnotationGenerator.SelectionRange selectionRange,
ProgressListener progressListener,
Options options,
List<AnnotatedPluginDocument> documents)
|
List<SequenceAnnotationGenerator.AnnotationGeneratorResultOnAlignment> |
generateOnAlignments(AnnotatedPluginDocument[] documents,
ProgressListener progressListener,
Options options)
Create annotations (and/or deletes annotations and/or modifies residues and/or modifies field values) on a set of alignments.
|
abstract GeneiousActionOptions |
getActionOptions()
GeneiousActionOptions contains all the important status information including
name, description, icon, where the action is displayed in the interface etc.
|
List<String> |
getAnnotationQualifiersToShowAfterNameForRealTimeAnnotations(Options options)
If this is a real time annotation generator (i.e.
|
Options |
getGeneralOptions()
Gets some Options that work for this annotation generator when invoked on any set of input sequences.
|
SequenceAnnotationGroup |
getGeneratedAnnotationGroup()
Get the types of annotations this generator generates.
|
abstract String |
getHelp()
Help for this operation in the form of HTML or plain text.
|
String |
getNameInSequenceViewer()
Specifies whether this annotation generator should appear (and with what name) in the controls on the right-hand side of the sequence viewer and update annotations in real time
as the user edits the sequences and/or changes options for this annotation generator.
|
Options |
getOptions(AnnotatedPluginDocument[] documents,
SequenceAnnotationGenerator.SelectionRange selectionRange)
Provides some options applicable to this annotation generator to the user.
|
Options |
getOptions(AnnotatedPluginDocument[] documents,
SequenceAnnotationGenerator.SelectionRange selectionRange,
boolean compactOptions)
Similar to
getOptions(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange)
except that if compactOptions==true then options returned may be more visually compact for rendering in a smaller region, such as in the sequence viewer controls in the case
where getNameInSequenceViewer() is not null. |
Options |
getOptions(SequenceAnnotationGenerator.SelectionRange selectionRange,
AnnotatedPluginDocument... documents)
A convenience method for calling
getOptions(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange)
This method may be invoked from either the swing thread or a non-swing thread. |
Options |
getOptions(SequenceAnnotationGenerator.SelectionRange selectionRange,
List<AnnotatedPluginDocument> documents)
A convenience method for calling
getOptions(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange)
This method may be invoked from either the swing thread or a non-swing thread. |
abstract DocumentSelectionSignature[] |
getSelectionSignatures()
Signatures of set of documents this generator will work on.
|
SequenceAnnotationGenerator.SingleSequenceResultGenerator |
getSingleSequenceGenerator(Options options)
Optionally provides an alternative way of generating annotations for large data sets to reduce memory usage.
|
String |
getUniqueId()
Get a unique identifier for this SequenceAnnotationGenerator.
|
boolean |
isSimilarAnnotation(SequenceAnnotation annotationGeneratedByThisGenerator,
SequenceAnnotation existingAnnotationOfSameType)
Determines whether an annotation generated by this generator is similar enough to an existing annotation on a sequence such that the generated annotation should not be displayed to the user.
|
boolean |
resultsDependOnAllInputAlignments() |
boolean |
showDialogIfNoResultsFound() |
boolean |
usesAnnotationsOnInputSequences()
Returns true if this annotation generator looks at the annotations on input sequences.
|
public abstract GeneiousActionOptions getActionOptions()
public abstract String getHelp()
Options.getOptionsHelp()
on the Options returned from getOptionsOptions.getOptionsHelp()public abstract DocumentSelectionSignature[] getSelectionSignatures()
generateOnAlignments(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], jebl.util.ProgressListener, Options)public String getNameInSequenceViewer()
getGeneratedAnnotationGroup()
Any annotation generator visible in the sequence viewer may choose to return a SequenceAnnotationGenerator.SelectionGrabOption
as part of its getOptions
to allow the user to option values that represent a range of residues in a sequence.public boolean isSimilarAnnotation(SequenceAnnotation annotationGeneratedByThisGenerator, SequenceAnnotation existingAnnotationOfSameType)
SequenceAnnotation.equals(Object).annotationGeneratedByThisGenerator - an annotation generated by this annotation generator.existingAnnotationOfSameType - an annotation that is already on a sequence and has the same SequenceAnnotation.getType() as the first annotation.public SequenceAnnotationGroup getGeneratedAnnotationGroup()
public Options getOptions(AnnotatedPluginDocument[] documents, SequenceAnnotationGenerator.SelectionRange selectionRange) throws DocumentOperationException
generate
The user can click "Cancel" at this point and generate will not be called
The same Options object will be passed to generateAnnotations if the user clicks "Ok". The necessary values
can then be extracted from it.
Example 1: Use Options class directly.
public Options getOptions(final AnnotatedPluginDocument[] documents, final SelectionRange selectionRange) throws DocumentOperationException {
Options options = new Options(getClass());
options.addOptionBooleanOption("optionName", "text displayed the user", true);
return options;
}
public List<List<SequenceAnnotation>> generateAnnotations(AnnotatedPluginDocument[] documentList, SelectionRange selectionRange,
ProgressListener progressListener, Options options) throws DocumentOperationException {
boolean checkboxSelected=(Boolean)options.getValue("optionName");
...
}
Example 2: Subclass Options. Useful for more complicated options where you want to improve code separation and avoid referring to options via their String names.
private static class MyOptions extends Options {
private BooleanOption sampleOption;
public MyOptions() {
sampleOption=addBooleanOption("sampleOption", "text displayed the user", true);
}
public boolean isSampleOption() {
return sampleOption.getValue();
}
}
public Options getOptions(final AnnotatedPluginDocument[] documents, final SelectionRange selectionRange) throws DocumentOperationException {
return new MyOptions();
}
public List<List<SequenceAnnotation>> generateAnnotations(AnnotatedPluginDocument[] documentList, SelectionRange selectionRange, ProgressListener progressListener, Options options) throws DocumentOperationException {
MyOptions myOptions= (MyOptions) options; // Since an instance of MyOptions is always returned from getOptions, this cast is always valid.
boolean sampleOptionSelected = myOptions.isSampleOption();
...
}
For more information, see Options.
This method may be invoked from either the swing thread or a non-swing thread.documents - the documents to generate annotations for. These are provided so that the Options can contain different
options depending on the documents. This can be ignored in most cases.selectionRange - the selected sequences and residues or null if everything is selected. If there are multiple selected ranges they may appear in any order.
If you need access to the residue intervals sorted from left to right, use {@link com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange#getResidueIntervals()DocumentOperationException - if obtaining the options for this annotation generator is unsuccessful for any reasongetOptions(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange, boolean)public Options getGeneralOptions() throws DocumentOperationException
Options.valuesToXML(String) and Options.valuesFromXML(org.jdom.Element)DocumentOperationException - if this annotation generator does not support general options.public Options getOptions(AnnotatedPluginDocument[] documents, SequenceAnnotationGenerator.SelectionRange selectionRange, boolean compactOptions) throws DocumentOperationException
getOptions(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange)
except that if compactOptions==true then options returned may be more visually compact for rendering in a smaller region, such as in the sequence viewer controls in the case
where getNameInSequenceViewer() is not null.
The default implementation just calls getOptions(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange).
This method may be invoked from either the swing thread or a non-swing thread.documents - the documents to generate annotations for. These are provided so that the Options can contain different
options depending on the documents. This can be ignored in most cases.selectionRange - the selected sequences and residues or null if everything is selected. If there are multiple selected ranges they may appear in any order.
If you need access to the residue intervals sorted from left to right, use {@link com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange#getResidueIntervals()compactOptions - true to create a more visually compact representation of the options (see above)DocumentOperationException - if obtaining the options for this annotation generator is unsuccessful for any reasongetOptions(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange)public final Options getOptions(SequenceAnnotationGenerator.SelectionRange selectionRange, List<AnnotatedPluginDocument> documents) throws DocumentOperationException
getOptions(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange)
This method may be invoked from either the swing thread or a non-swing thread.selectionRange - the selected sequences and residues or null if everything is selected.If there are multiple selected ranges they may appear in any order.
If you need access to the residue intervals sorted from left to right, use {@link com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange#getResidueIntervals()documents - the documents to generate annotations for. These are provided so that the Options can contain different
options depending on the documents. This can be ignored in most cases.DocumentOperationException - if the operation is unsuccessful for any reasonpublic final Options getOptions(SequenceAnnotationGenerator.SelectionRange selectionRange, AnnotatedPluginDocument... documents) throws DocumentOperationException
getOptions(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange)
This method may be invoked from either the swing thread or a non-swing thread.selectionRange - the selected sequences and residues or null if everything is selected. If there are multiple selected ranges they may appear in any order.
If you need access to the residue intervals sorted from left to right, use {@link com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange#getResidueIntervals()documents - the documents to generate annotations for. These are provided so that the Options can contain different
options depending on the documents. This can be ignored in most cases.DocumentOperationException - if the operation is unsuccessful for any reasonpublic List<SequenceAnnotationGenerator.AnnotationGeneratorResult> generate(AnnotatedPluginDocument[] documents, SequenceAnnotationGenerator.SelectionRange selectionRange, ProgressListener progressListener, Options options) throws DocumentOperationException
documents - the documents to generate annotations for which will match getSelectionSignatures()selectionRange - the selected sequences and residues or null if everything is selected. If there are multiple selected ranges they may appear in any order.
If you need access to the residue intervals sorted from left to right, use SequenceAnnotationGenerator.SelectionRange.getResidueIntervals()progressListener - report progress for slow operations. If the progressListener requests that the operation cancels, the operation may choose to throw a DocumentOperationException.Canceledoptions - the options returned from getOptionsdocuments.
If any of the documents in documents are alignments or sequence lists, then
the returned list must have an entry for each of those sequences (that match getSelectionSignatures()) within
the alignment/sequence list.
Furthermore, if the input document is an alignment, the returned list may contain 1 additional entry (at index SequenceAlignmentDocument.getNumberOfSequences()) representing annotations for the consensus sequence.
Generators on large alignments may choose to return a SequenceAnnotationGenerator.AnnotationGeneratorResultsOnSingleSequence to allow the calling code to recognize it does not need to iterate over all elements in the returned listDocumentOperationException - when something goes wrong.public List<SequenceAnnotationGenerator.AnnotationGeneratorResultOnAlignment> generateOnAlignments(AnnotatedPluginDocument[] documents, ProgressListener progressListener, Options options) throws DocumentOperationException
getSelectionSignatures() indicates
it accepts more than 1 alignment. Most annotation generators should implement generate(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange, jebl.util.ProgressListener, Options) instead.
Note: The operation will be run in a non AWT thread. If you need to perform user interface
interaction in addition to the options provided in the Options (for example prompting for user input)
then you need to place this inside a ThreadUtilities.invokeAndWait() function call.
WARNING: Geneious may call this method multiple times simultaneously.
Therefore, any implementation should not store its internal state
within instance fields.documents - the documents to generate annotations for.progressListener - report progress for slow operations. If the progressListener requests that the operation cancels, the operation may choose to throw a DocumentOperationException.Canceledoptions - the options returned from getOptionsDocumentOperationException - when something goes wrong.public List<List<SequenceAnnotation>> generateAnnotations(AnnotatedPluginDocument[] documents, SequenceAnnotationGenerator.SelectionRange selectionRange, ProgressListener progressListener, Options options) throws DocumentOperationException
generate instead.
Create annotations from a set of documents.
Note: The operation will be run in a non AWT thread. If you need to perform user interface
interaction in addition to the options provided in the Options (for example prompting for user input)
then you need to place this inside a ThreadUtilities.invokeAndWait() function call.
WARNING: Geneious may call this method multiple times simultaneously.
Therefore, any implementation should not store its internal state
within instance fields.
generate(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange, jebl.util.ProgressListener, Options)
but returns only the list of annotations, so any tracks, residue additions or deletions, and annotation deletions will not be respected.
If you are invoking a SequenceAnnotationGenerator in another plugin, call
generate(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange, jebl.util.ProgressListener, Options) instead.documents - the documents to generate annotations for. These are provided so that the Options can contain different
options depending on the documents. This can be ignored in most cases.selectionRange - the selected sequences and residues or null if everything is selected.progressListener - report progress for slow operations. If the progressListener requests that the operation cancels, the operation may choose to throw a DocumentOperationException.Canceledoptions - the options returned from getOptionsdocuments.
If any of the documents in documents are alignments or sequence lists, then
the returned list must have an entry for each of those sequences (that match getSelectionSignatures()) within
the alignment/sequence list.
Furthermore, if the input document is an alignment, the returned list may contain 1 additional entry (at index SequenceAlignmentDocument.getNumberOfSequences()) representing annotations for the consensus sequence.DocumentOperationException - when something goes wrong.public final List<List<SequenceAnnotation>> generateAnnotations(SequenceAnnotationGenerator.SelectionRange selectionRange, ProgressListener progressListener, Options options, AnnotatedPluginDocument... documents) throws DocumentOperationException
generateAnnotations(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange, jebl.util.ProgressListener, Options)documents - the documents to generate annotations for.selectionRange - the selected sequences and residues or null if everything is selected. If there are multiple selected ranges they may appear in any order.
If you need access to the residue intervals sorted from left to right, use SequenceAnnotationGenerator.SelectionRange.getResidueIntervals()progressListener - report progress for slow operations. If the progressListener requests that the operation cancels, the operation may choose to throw a DocumentOperationException.Canceledoptions - the options returned from getOptionsdocuments.
If any of the documents in documents are alignments or sequence lists, then
the returned list must have an entry for each of those sequences (that match getSelectionSignatures()) within
the alignment/sequence list.
Furthermore, if the input document is an alignment, the returned list may contain 1 additional entry (at index SequenceAlignmentDocument.getNumberOfSequences()) representing annotations for the consensus sequence.DocumentOperationException - when something goes wrong.public final List<List<SequenceAnnotation>> generateAnnotations(SequenceAnnotationGenerator.SelectionRange selectionRange, ProgressListener progressListener, Options options, List<AnnotatedPluginDocument> documents) throws DocumentOperationException
generateAnnotations(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange, jebl.util.ProgressListener, Options)documents - the documents to generate annotations for.selectionRange - the selected sequences and residues or null if everything is selected. If there are multiple selected ranges they may appear in any order.
If you need access to the residue intervals sorted from left to right, use {@link com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange#getResidueIntervals()progressListener - report progress for slow operations. If the progressListener requests that the operation cancels, the operation may choose to throw a DocumentOperationException.Canceledoptions - the options returned from getOptionsdocuments.
If any of the documents in documents are alignments or sequence lists, then
the returned list must have an entry for each of those sequences (that match getSelectionSignatures()) within
the alignment/sequence list.
Furthermore, if the input document is an alignment, the returned list may contain 1 additional entry (at index SequenceAlignmentDocument.getNumberOfSequences()) representing annotations for the consensus sequence.DocumentOperationException - when something goes wrong.public String getUniqueId()
PluginUtilities.getSequenceAnnotationGenerator(String)
can be used to find this SequenceAnnotationGenerator.
A unique identifier may consist of any valid Java identifier characters (see Character.isJavaIdentifierPart(char) as well as to the space character.public boolean usesAnnotationsOnInputSequences()
public SequenceAnnotationGenerator.SingleSequenceResultGenerator getSingleSequenceGenerator(Options options)
generate(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange, jebl.util.ProgressListener, Options)
(or one of the variants of it), the caller may request a SequenceAnnotationGenerator.SingleSequenceResultGenerator which it can invoke for a single SequenceDocument.
The options are provided now rather than as part of SequenceAnnotationGenerator.SingleSequenceResultGenerator.generate(com.biomatters.geneious.publicapi.documents.PluginDocument, com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange, jebl.util.ProgressListener) so that the implementation can parse them once to improve performance over multiple calls to
SequenceAnnotationGenerator.SingleSequenceResultGenerator.generate(com.biomatters.geneious.publicapi.documents.PluginDocument, com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange, jebl.util.ProgressListener)options - some options previously returned from getOptions(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange)
(or one of its variants)public List<String> getAnnotationQualifiersToShowAfterNameForRealTimeAnnotations(Options options)
getNameInSequenceViewer()) then while the sequence viewer is displaying
un-applied annotations for this generator, the given qualifiers will also be displayed after the name. For example the "Annotate from Database" shows the
transferred similarity after the name of annotations (as long as the similarity setting is under 100%)options - the options for this generator, returned from getOptions(com.biomatters.geneious.publicapi.plugin.SequenceAnnotationGenerator.SelectionRange, java.util.List) or a variant getOptions method.public boolean resultsDependOnAllInputAlignments()
generateOnAlignments(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], jebl.util.ProgressListener, Options)
the results produced on one alignment are affected by the properties of other alignments.public boolean showDialogIfNoResultsFound()