public abstract class Assembler extends Object
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.Modifier and Type | Class and Description |
---|---|
static class |
Assembler.Callback
Used for assembly algorithms to provide results back to Geneious.
|
static class |
Assembler.ContigOutputSupport
Used for indicating whether an assembly algorithm outputs contigs, consensus sequences, or both.
|
static class |
Assembler.ReferenceSequenceSupport
Used for indicating whether an assembly algorithm supports no reference sequence, a single reference sequence, or multiple reference sequences.
|
Modifier and Type | Field and Description |
---|---|
static String |
DE_NOVO_UNIQUE_ID_SUFFIX
If an assembly implementation supports both reference sequence and de novo assembly, its de novo assembler
getUniqueId() should end with this. |
static String |
REFERENCE_UNIQUE_ID_SUFFIX
If an assembly implementation supports both reference sequence and de novo assembly, its referenced assembler
getUniqueId() should end with this. |
Constructor and Description |
---|
Assembler() |
Modifier and Type | Method and Description |
---|---|
abstract void |
assemble(Options options,
AssemblerInput assemblyInput,
ProgressListener progressListener,
Assembler.Callback callback)
Called to actually perform the assembly.
|
boolean |
canRunOnGeneiousServer()
Returns true if this operation supports being run on a GeneiousServer.
|
boolean |
canRunOnLocalGeneious()
Determine whether this assembly algorithm supports being run on the current computer.
|
abstract Assembler.ContigOutputSupport |
getContigOutputSupport()
Gets the type of data generated by this assembler.
|
abstract String |
getName()
Provides a short 1 or 2 word name for this algorithm.
|
abstract Options |
getOptions(OperationLocationOptions locationOptions,
AssemblerInput.Properties inputProperties)
Gets some options to display to the user before performing assembly.
|
abstract Assembler.ReferenceSequenceSupport |
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.
|
abstract String |
getUniqueId()
Gets a unique id for this algorithm.
|
boolean |
handlesTrimAnnotations()
Returns true if this assembler handles trim annotations (
SequenceAnnotation.TYPE_TRIMMED on input sequences
and preserves them on generated contigs. |
boolean |
isProOnly()
If true, this assembler will be always disabled when the user doesn't have an active license.
|
abstract boolean |
providesUnusedReads()
Returns true if this assembler can inform the
Assembler.Callback about all reads that couldn't be assembled. |
boolean |
providesUsedReads()
Returns true if this assembler can inform the
Assembler.Callback about all reads that could be assembled. |
boolean |
providesUsedReadsIncludeMates()
Returns true if this assembler can inform the
Assembler.Callback about the mates of all reads that could be assembled. |
boolean |
supportsInputContigs()
true if this assembly algorithm can accept contigs (
SequenceAlignmentDocuments as input
along with sequences. |
boolean |
supportsReferenceSequencesWithDuplicateNames() |
boolean |
supportsSingleInputContig()
true if this assembly can accept single contigs as input and do some sort of fine tuning
to improve the contig.
|
public static final String DE_NOVO_UNIQUE_ID_SUFFIX
getUniqueId()
should end with this.public static final String REFERENCE_UNIQUE_ID_SUFFIX
getUniqueId()
should end with this.public abstract String getUniqueId()
getReferenceSequenceSupport()
.
The Geneious assemblers have unique IDs "Geneious.deNovo" and "Geneious.reference".getReferenceSequenceSupport()
,
DE_NOVO_UNIQUE_ID_SUFFIX
,
REFERENCE_UNIQUE_ID_SUFFIX
public abstract String getName()
public abstract Options getOptions(OperationLocationOptions locationOptions, AssemblerInput.Properties inputProperties) throws DocumentOperationException
locationOptions
- Used to control where the assembler is run. Will be null if the assembler can only be run locally. See OperationLocationOptions
for 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 using AssemblerInput.Properties.addChangeListener(org.virion.jam.util.SimpleListener)
@return some options to display to the user before performing assembly.DocumentOperationException
- if this assembler doesn't support assembly on the given AssemblerInput.Propertiespublic abstract Assembler.ReferenceSequenceSupport getReferenceSequenceSupport()
getUniqueId()
prefix, and end with DE_NOVO_UNIQUE_ID_SUFFIX
and REFERENCE_UNIQUE_ID_SUFFIX
so that Geneious
can recognize they are the same and provide appropriate options to the user.getUniqueId()
public boolean supportsReferenceSequencesWithDuplicateNames()
AssemblerInput.getReferenceSequence(int, jebl.util.ProgressListener)
throws a DocumentOperationException
if there are duplicate reference sequence names. The default implementation returns falsepublic abstract Assembler.ContigOutputSupport getContigOutputSupport()
Assembler.ContigOutputSupport.ConsensusOnly
public boolean supportsInputContigs()
SequenceAlignmentDocuments
as input
along with sequences. If so, then Read
s provided as input to the assembler
may be contigs instead of single or paired sequences.
The default implementation returns false.SequenceAlignmentDocuments
as input
along with sequences.supportsSingleInputContig()
public boolean supportsSingleInputContig()
supportsInputContigs()
public abstract boolean providesUnusedReads()
Assembler.Callback
about 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 using AssemblerInput.isSaveUnusedReads()
Assembler.Callback
about all reads that couldn't be assembled.public boolean providesUsedReads()
Assembler.Callback
about all reads that could be assembled.
This controls whether the "Save used reads" option (and associated "include mates" option if providesUsedReadsIncludeMates()
) will be enabled in the user interface. An assembler can query
whether or not the user actually selected the setting using AssemblerInput.isSaveUsedReads()
Assembler.Callback
about all reads that could be assembled.public boolean providesUsedReadsIncludeMates()
Assembler.Callback
about 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 using AssemblerInput.isSaveUsedReadsIncludeMates()
Assembler.Callback
about the mates of all reads that could be assembled.public boolean handlesTrimAnnotations()
SequenceAnnotation.TYPE_TRIMMED
on input sequences
and preserves them on generated contigs.
The default implementation returns false.SequenceAnnotation.TYPE_TRIMMED
on input sequences
and preserves them on generated contigs.public abstract void assemble(Options options, AssemblerInput assemblyInput, ProgressListener progressListener, Assembler.Callback callback) throws DocumentOperationException
options
- the options returned from getOptions(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.DocumentOperationException
- if something goes wrong during assembly.public boolean canRunOnLocalGeneious()
public boolean canRunOnGeneiousServer()
DocumentOperation.canRunOnGeneiousServer()
public boolean isProOnly()