Class Assembler
java.lang.Object
com.biomatters.geneious.publicapi.plugin.Assembler
- All Implemented Interfaces:
BadgeSupplier
Allows the implementation of a read mapper, reference assembler or de novo assembler.
A
GeneiousPlugin can
return 1 or more assembly algorithm implementations via GeneiousPlugin.getAssemblers().
The API documentation includes a sample implementation called ExampleAssembler
While these could be implemented as a DocumentOperation, the Assembler API simplifies the process.- Since:
- API 4.14 (Geneious 5.1.0)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classUsed for assembly algorithms to provide results back to Geneious.static enumUsed for indicating whether an assembly algorithm outputs contigs, consensus sequences, or both.static enumUsed for indicating whether an assembly algorithm supports no reference sequence, a single reference sequence, or multiple reference sequences. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringIf an assembly implementation supports both reference sequence and de novo assembly, its de novo assemblergetUniqueId()should end with this.static final StringIf an assembly implementation supports both reference sequence and de novo assembly, its referenced assemblergetUniqueId()should end with this. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidassemble(Options options, AssemblerInput assemblyInput, ProgressListener progressListener, Assembler.Callback callback) Called to actually perform the assembly.booleanReturns true if this operation supports being run on a GeneiousServer.booleanDetermine whether this assembly algorithm supports being run on the current computer.getBadge()This can be used to add any badge to the drop-down of Mapper in assembly operations dialog.abstract Assembler.ContigOutputSupportGets the type of data generated by this assembler.doubleabstract StringgetName()Provides a short 1 or 2 word name for this algorithm.abstract OptionsgetOptions(OperationLocationOptions locationOptions, AssemblerInput.Properties inputProperties) Gets some options to display to the user before performing assembly.abstract Assembler.ReferenceSequenceSupportGets whether or not this algorithm supports/requires assembling to a reference sequence and if so, whether it can assemble to multiple reference sequences.abstract StringGets a unique id for this algorithm.booleanReturns true if this assembler handles trim annotations (SequenceAnnotation.TYPE_TRIMMEDon input sequences and preserves them on generated contigs.booleanIf true, this assembler will be always disabled when the user doesn't have an active license.abstract booleanReturns true if this assembler can inform theAssembler.Callbackabout all reads that couldn't be assembled.booleanReturns true if this assembler can inform theAssembler.Callbackabout all reads that could be assembled.booleanReturns true if this assembler can inform theAssembler.Callbackabout the mates of all reads that could be assembled.booleantrue if this assembly algorithm can accept contigs (SequenceAlignmentDocumentsas input along with sequences.booleanbooleantrue if this assembly can accept single contigs as input and do some sort of fine tuning to improve the contig.
-
Field Details
-
DE_NOVO_UNIQUE_ID_SUFFIX
If an assembly implementation supports both reference sequence and de novo assembly, its de novo assemblergetUniqueId()should end with this.- See Also:
-
REFERENCE_UNIQUE_ID_SUFFIX
If an assembly implementation supports both reference sequence and de novo assembly, its referenced assemblergetUniqueId()should end with this.- See Also:
-
-
Constructor Details
-
Assembler
public Assembler()
-
-
Method Details
-
getBadge
This can be used to add any badge to the drop-down of Mapper in assembly operations dialog. E.g. when introducing a new Assembly we can setBadge.NEWto draw attention to new implementation- Specified by:
getBadgein interfaceBadgeSupplier- Returns:
Badgeor null if there is no badge
-
getUniqueId
Gets a unique id for this algorithm. Since this must be unique, prefixing it with the fully qualified class name is recommended. Also seegetReferenceSequenceSupport(). The Geneious assemblers have unique IDs "Geneious.deNovo" and "Geneious.reference".- Returns:
- a unique id for this algorithm
- See Also:
-
getName
Provides a short 1 or 2 word name for this algorithm.- Returns:
- a short 1 or 2 word name for this algorithm.
-
getMenuPosition
public double getMenuPosition()- Returns:
- a value between 0 and 1 to represent the relative position of this assembler in the drop down list of available assemblers. Lower values appear first. The default implementation returns 0.5.
Similar to how
GeneiousActionOptions.getMainMenuPosition()works. - Since:
- API 4.202001 (Geneious 2020.0.1)
- See Also:
-
getShortName
- Returns:
- a short single word name for this algorithm. The default implementation returns the first word of
getName() - Since:
- API 4.1100 (Geneious 11.0.0)
-
getOptions
public abstract Options getOptions(OperationLocationOptions locationOptions, AssemblerInput.Properties inputProperties) throws com.biomatters.geneious.publicapi.plugin.DocumentOperationException Gets some options to display to the user before performing assembly.- Parameters:
locationOptions- Used to control where the assembler is run. Will be null if the assembler can only be run locally. SeeOperationLocationOptionsfor more details.inputProperties- some properties summarising the data to be assembled. If the user changes the reference sequence after the options are retrieved, the property values will change. The assembly implementation can request to be notified about this usingAssemblerInput.Properties.addChangeListener(org.virion.jam.util.SimpleListener)@return some options to display to the user before performing assembly.- Returns:
- options to display to the user for doing assembly.
- Throws:
com.biomatters.geneious.publicapi.plugin.DocumentOperationException- if this assembler doesn't support assembly on the given AssemblerInput.Properties
-
getReferenceSequenceSupport
Gets whether or not this algorithm supports/requires assembling to a reference sequence and if so, whether it can assemble to multiple reference sequences. If an algorithm can support either reference assembly or de novo assembly, 2 different algorithm implementations must be created. In this case the 2 implementations should start with the samegetUniqueId()prefix, and end withDE_NOVO_UNIQUE_ID_SUFFIXandREFERENCE_UNIQUE_ID_SUFFIXso that Geneious can recognize they are the same and provide appropriate options to the user.- Returns:
- the type of reference sequences this assembler supports.
- See Also:
-
supportsReferenceSequencesWithDuplicateNames
public boolean supportsReferenceSequencesWithDuplicateNames()- Returns:
- false if
AssemblerInput.getReferenceSequence(int, jebl.util.ProgressListener)throws aDocumentOperationExceptionif there are duplicate reference sequence names. The default implementation returns false - Since:
- API 4.710 (Geneious 7.1.0)
-
getContigOutputSupport
Gets the type of data generated by this assembler. Some assemblers may generate just a consensus sequence (in which case they should returnAssembler.ContigOutputSupport.ConsensusOnly- Returns:
- the type of data generated by this assembler.
-
supportsInputContigs
public boolean supportsInputContigs()true if this assembly algorithm can accept contigs (SequenceAlignmentDocumentsas input along with sequences. If so, thenReads provided as input to the assembler may be contigs instead of single or paired sequences. The default implementation returns false.- Returns:
- true if this assembly algorithm can accept contigs (
SequenceAlignmentDocumentsas input along with sequences. - See Also:
-
supportsSingleInputContig
public boolean supportsSingleInputContig()true if this assembly can accept single contigs as input and do some sort of fine tuning to improve the contig.- Returns:
- true if this assembly can accept single contigs as input and do some sort of fine tuning to improve the contig.
- Since:
- API 4.30 (Geneious 5.3.0)
- See Also:
-
providesUnusedReads
public abstract boolean providesUnusedReads()Returns true if this assembler can inform theAssembler.Callbackabout all reads that couldn't be assembled. This controls whether the "Save unused reads" option will be enabled in the user interface. An assembler can query whether or not the user actually selected the setting usingAssemblerInput.isSaveUnusedReads()- Returns:
- true if this assembler will inform the
Assembler.Callbackabout all reads that couldn't be assembled.
-
providesUsedReads
public boolean providesUsedReads()Returns true if this assembler can inform theAssembler.Callbackabout all reads that could be assembled. This controls whether the "Save used reads" option (and associated "include mates" option ifprovidesUsedReadsIncludeMates()) will be enabled in the user interface. An assembler can query whether or not the user actually selected the setting usingAssemblerInput.isSaveUsedReads()- Returns:
- true if this assembler will inform the
Assembler.Callbackabout all reads that could be assembled. - Since:
- API 4.50 (Geneious 5.5.0)
-
providesUsedReadsIncludeMates
public boolean providesUsedReadsIncludeMates()Returns true if this assembler can inform theAssembler.Callbackabout the mates of all reads that could be assembled. This controls whether the "include mates" option (associated with the "Save used reads" option) will be enabled in the user interface. An assembler can query whether or not the user actually selected the setting usingAssemblerInput.isSaveUsedReadsIncludeMates()- Returns:
- true if this assembler will inform the
Assembler.Callbackabout the mates of all reads that could be assembled. - Since:
- API 4.50 (Geneious 5.5.0)
-
handlesTrimAnnotations
public boolean handlesTrimAnnotations()Returns true if this assembler handles trim annotations (SequenceAnnotation.TYPE_TRIMMEDon input sequences and preserves them on generated contigs. The default implementation returns false.- Returns:
- true if this assembler handles trim annotations (
SequenceAnnotation.TYPE_TRIMMEDon input sequences and preserves them on generated contigs. - Since:
- API 4.15 (Geneious 5.1.1)
-
assemble
public abstract void assemble(Options options, AssemblerInput assemblyInput, ProgressListener progressListener, Assembler.Callback callback) throws com.biomatters.geneious.publicapi.plugin.DocumentOperationException Called to actually perform the assembly. All generated contigs (and unused reads if supported) should be given to the callback. 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 optionsPanel (for example prompting for user input) then you need to place this inside a ThreadUtilities.invokeAndWait() function call. WARNING: Geneious may call this function multiple times simultaneously. Therefore, any implementation should not store its internal state within instance fields.- Parameters:
options- the options returned fromgetOptions(OperationLocationOptions, com.biomatters.geneious.publicapi.plugin.AssemblerInput.Properties)assemblyInput- the input data to assemble.progressListener- a progress listener to report progress to and to check for cancelling.callback- the callback to add the results to. @throws DocumentOperationException if the operation can't be performed or is cancelled.- Throws:
com.biomatters.geneious.publicapi.plugin.DocumentOperationException- if something goes wrong during assembly.
-
canRunOnLocalGeneious
public boolean canRunOnLocalGeneious()Determine whether this assembly algorithm supports being run on the current computer. For example the algorithm may only work on particular operating systems or only on Geneious server.- Returns:
- true if this assembly algorithm supports being run on the current computer.
-
canRunOnGeneiousServer
public boolean canRunOnGeneiousServer()Returns true if this operation supports being run on a GeneiousServer. If this returns true then the user is presented with the option of running the operation on their local computer or on a connected GeneiousServer- Returns:
- true if the operation can be run on a remote GeneiousServer
- See Also:
-
isProOnly
public boolean isProOnly()If true, this assembler will be always disabled when the user doesn't have an active license. When disabled for this reason it will also have "(restricted)" appended to its name. The default implementation returns true.- Returns:
- whether this action requires an active license
-