public class AssemblerInput extends Object
Assembler.assemble(Options, AssemblerInput, jebl.util.ProgressListener, com.biomatters.geneious.publicapi.plugin.Assembler.Callback).| Modifier and Type | Class and Description |
|---|---|
static class |
AssemblerInput.DataType
The sequencing technology that a sequencing read was generated from.
|
static class |
AssemblerInput.Properties
Some properties that briefly summarise what the input will look like.
|
static class |
AssemblerInput.Read
Represents a single read or input contig.
|
class |
AssemblerInput.Reads
Provides the ability to iterate over all reads to be assembled.
|
static class |
AssemblerInput.ReferenceSequence
Represents a reference sequence in an assembly.
|
| Constructor and Description |
|---|
AssemblerInput(List<AnnotatedPluginDocument> annotatedPluginDocuments,
List<AssemblerInput.ReferenceSequence> referenceSequences,
boolean extractSequencesFromContigs)
Constructs some assembly input from documents that need not be loaded into memory.
|
AssemblerInput(List<AnnotatedPluginDocument> annotatedPluginDocuments,
List<AssemblerInput.ReferenceSequence> referenceSequences,
boolean extractSequencesFromContigs,
double fractionOfDataToUse)
Constructs some assembly input from documents that need not be loaded into memory.
|
AssemblerInput(List<NucleotideSequenceDocument> referenceSequences,
List<NucleotideSequenceDocument> sequences,
List<SequenceAlignmentDocument.ReferencedSequence> referencedDocuments)
Constructs some assembly input from sequences that are all in memory.
|
AssemblerInput(List<NucleotideSequenceDocument> referenceSequences,
SequenceListDocument sequenceListDocument)
Constructs some assembly input from sequences that are all in memory.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getMaximumNumberOfContigsToGenerate()
For performance reasons, the user may limit the algorithm to generating this many contigs.
|
static long |
getNumberOfNucleotideSequences(AnnotatedPluginDocument document)
Gets the total number of nucleotide sequences contained in the given document which may be an individual sequence, sequence list, or alignment/contig.
|
static long |
getNumberOfNucleotideSequences(List<AnnotatedPluginDocument> documents)
Gets the total number of nucleotide sequences contained in the given documents which may be individual sequences, sequence lists, or alignments/contigs.
|
long |
getNumberOfReadSequences() |
int |
getNumberOfReferenceSequences()
Get the total number of reference sequences being assembled to.
|
static long |
getNumberOfSequencesToUseFromDocument(long numberOfSequences,
double fractionOfDataToUse)
When assembling using only a fraction of the data from each document, this is used to return the exact number of sequences used from each document.
|
AssemblerInput.Reads |
getReads() |
NucleotideSequenceDocument |
getReferenceSequence(int referenceSequenceIndex,
ProgressListener progressListener)
Gets one of the reference sequences for this assembly.
|
SequenceAlignmentDocument.ReferencedSequence |
getReferenceSequenceReference(int referenceSequenceIndex)
Gets a reference to the document that the reference sequence came from.
|
boolean |
isGenerateContigs()
Returns whether or not contigs should be produced by the assembly.
|
boolean |
isSaveUnusedReads()
Returns whether or not unused reads should be saved by the assembly.
|
boolean |
isSaveUsedReads()
Returns whether or not used reads should be saved by the assembly.
|
boolean |
isSaveUsedReadsIncludeMates()
Returns whether or not the mates of used reads (even if that mate doesn't map) should be saved by the assembly.
|
boolean |
isSetReferencedDocumentsOnContig()
Returns true if the assembly implementation should set referenced documents/sequences (see
SequenceAlignmentDocument.getReferencedSequence(int))
for the reads on generated contigs. |
void |
setAllowDuplicateReferenceSequenceNames(boolean allowDuplicateReferenceSequenceNames)
Sets whether
getReferenceSequence(int, jebl.util.ProgressListener) throws a DocumentOperationException if there are duplicate reference sequence names |
void |
setGenerateContigs(boolean saveContigs)
Sets whether or not contigs should be saved by the assembly.
|
void |
setMaximumNumberOfContigsToGenerate(int maximumContigs)
For performance reasons, the user may limit the algorithm to generating this many contigs.
|
void |
setSaveUnusedReads(boolean saveUnusedReads)
Sets whether or not unused reads should be saved by the assembly.
|
void |
setSaveUsedReads(boolean saveUsedReads)
Sets whether or not used reads should be saved by the assembly.
|
void |
setSaveUsedReadsIncludeMates(boolean saveUsedReadsIncludeMates)
Sets whether or not the mates of used reads (even if that mate doesn't map) should be saved by the assembly.
|
public AssemblerInput(List<AnnotatedPluginDocument> annotatedPluginDocuments, List<AssemblerInput.ReferenceSequence> referenceSequences, boolean extractSequencesFromContigs)
annotatedPluginDocuments - the documents containing the reference sequences and reads to assemblyreferenceSequences - the reference sequences. This may be empty but must not be null.extractSequencesFromContigs - true to extract sequences from any contigs and provide them as stand-alone sequences rather than as part of a contigpublic AssemblerInput(List<AnnotatedPluginDocument> annotatedPluginDocuments, List<AssemblerInput.ReferenceSequence> referenceSequences, boolean extractSequencesFromContigs, double fractionOfDataToUse)
annotatedPluginDocuments - the documents containing the reference sequences and reads to assemblyreferenceSequences - the reference sequences. This may be empty but must not be null.extractSequencesFromContigs - true to extract sequences from any contigs and provide them as stand-alone sequences rather than as part of a contigfractionOfDataToUse - the fraction of the input data to provide to the assembler. Must be between 0 and 1. If any reference sequences are specified, this must be 1.0public AssemblerInput(List<NucleotideSequenceDocument> referenceSequences, List<NucleotideSequenceDocument> sequences, List<SequenceAlignmentDocument.ReferencedSequence> referencedDocuments)
referenceSequences - the reference sequences. This may be empty but must not be null.sequences - the sequences to assemble. This may (but does not need to) contain the reference sequences too.referencedDocuments - an optional parallel list (equal in length to sequences) contaiing the referenced documents for each sequence. This may be null.public AssemblerInput(List<NucleotideSequenceDocument> referenceSequences, SequenceListDocument sequenceListDocument)
referenceSequences - the reference sequences. This may be empty but must not be null.sequenceListDocument - a sequence list containg the sequences to assemble. This must not include any reference sequences.public void setAllowDuplicateReferenceSequenceNames(boolean allowDuplicateReferenceSequenceNames)
getReferenceSequence(int, jebl.util.ProgressListener) throws a DocumentOperationException if there are duplicate reference sequence namesallowDuplicateReferenceSequenceNames - false if getReferenceSequence(int, jebl.util.ProgressListener) throws a DocumentOperationException if there are duplicate reference sequence namespublic static long getNumberOfNucleotideSequences(List<AnnotatedPluginDocument> documents)
documents - the documents to get the number of sequences inpublic static long getNumberOfNucleotideSequences(AnnotatedPluginDocument document)
document - the document to get the number of sequences inpublic static long getNumberOfSequencesToUseFromDocument(long numberOfSequences,
double fractionOfDataToUse)
numberOfSequences - the total number of sequences in a single document.fractionOfDataToUse - the fraction of sequences to use from each document. Must be between 0 and 1. At least 1 sequence will be used from each document.public AssemblerInput.Reads getReads()
public long getNumberOfReadSequences()
public int getNumberOfReferenceSequences()
This will always be 0 if the algorithm returned Assembler.ReferenceSequenceSupport.NoReferenceSequence from Assembler.getReferenceSequenceSupport().
It will always be 1 if the algorithm returned Assembler.ReferenceSequenceSupport.SingleReferenceSequence from Assembler.getReferenceSequenceSupport().
It will always be greater than or equal to 1 if the algorithm returned Assembler.ReferenceSequenceSupport.MultipleReferenceSequences from Assembler.getReferenceSequenceSupport().
public NucleotideSequenceDocument getReferenceSequence(int referenceSequenceIndex, ProgressListener progressListener) throws DocumentOperationException
referenceSequenceIndex - the index of the reference sequence to get between 0 and getNumberOfReferenceSequences()-1 inclusive.progressListener - a progress listener to report progress to while the reference sequence is loaded from disk.DocumentOperationException - if the reference sequence cannot be loadedpublic SequenceAlignmentDocument.ReferencedSequence getReferenceSequenceReference(int referenceSequenceIndex) throws DocumentOperationException
referenceSequenceIndex - the index of the reference sequence to get between 0 and getNumberOfReferenceSequences()-1 inclusive.DocumentOperationException - if the referenced document cannot be obtained because of a failure to load the reference sequence.public boolean isSetReferencedDocumentsOnContig()
SequenceAlignmentDocument.getReferencedSequence(int))
for the reads on generated contigs. Note that a referened sequence is not the same thing as a reference sequence (see SequenceAlignmentDocument.getContigReferenceSequenceIndex()))
A referenced document is what Geneious goes to if you click on the little "Go to referenced document" icon to the left of the sequence names in the alignment/contig viewer.
No matter what this method returns, assembly implementations should still set the a referenced document for the reference sequence.
For performance reasons this method will return false on big data sets (those with more than 10,000 sequences by default)public boolean isSaveUnusedReads()
Assembler.providesUnusedReads() returned true and the user checked the relevant checkbox.
An assembler doesn't need to respect this setting. It can always provide unused reads using Assembler.Callback.addUnusedReads(com.biomatters.geneious.publicapi.documents.sequence.SequenceListDocument, jebl.util.ProgressListener) or Assembler.Callback.addUnusedRead(com.biomatters.geneious.publicapi.plugin.AssemblerInput.Read, jebl.util.ProgressListener) and the callback
will just ignore it if it doesn't want unused reads.Assembler.providesUnusedReads()public void setSaveUnusedReads(boolean saveUnusedReads)
saveUnusedReads - true if unused reads should be saved by the assembly.public boolean isSaveUsedReads()
Assembler.providesUsedReads() returned true and the user checked the relevant checkbox.
An assembler doesn't need to respect this setting. It can always provide used reads using Assembler.Callback.addUsedRead(com.biomatters.geneious.publicapi.plugin.AssemblerInput.Read, jebl.util.ProgressListener) and the callback
will just ignore it if it doesn't want used reads.Assembler.providesUsedReads()public void setSaveUsedReads(boolean saveUsedReads)
saveUsedReads - true if used reads should be saved by the assembly.public boolean isSaveUsedReadsIncludeMates()
Assembler.providesUsedReadsIncludeMates() returned true and the user checked the relevant checkbox.
An assembler doesn't need to respect this setting. It can always provide used reads using Assembler.Callback.addUsedRead(com.biomatters.geneious.publicapi.plugin.AssemblerInput.Read, jebl.util.ProgressListener) and the callback
will just ignore it if it doesn't want used reads.Assembler.providesUsedReads()public void setGenerateContigs(boolean saveContigs)
saveContigs - true if contigs should be saved by the assembly.public boolean isGenerateContigs()
Assembler.getContigOutputSupport() did not return ConsensusOnly and the user checked the relevant checkbox (or they choose to save a generated consensus)
An assembler doesn't need to respect this setting. It can always provide contigs using Assembler.Callback.addContigDocument(com.biomatters.geneious.publicapi.documents.sequence.SequenceAlignmentDocument, com.biomatters.geneious.publicapi.documents.sequence.NucleotideSequenceDocument, boolean, jebl.util.ProgressListener) and the callback
will just ignore it if it doesn't want contigs.)public void setSaveUsedReadsIncludeMates(boolean saveUsedReadsIncludeMates)
saveUsedReadsIncludeMates - true if used reads and their mates should be saved by the assembly.public void setMaximumNumberOfContigsToGenerate(int maximumContigs)
maximumContigs - the maximum number of contigs the algorithm should return.public int getMaximumNumberOfContigsToGenerate()