public interface SequenceDocument extends PluginDocument
NucleotideSequenceDocumentto represent amino acid or nucleotide sequences because Geneious relies on these interfaces for determining the type of a sequence. The most widely used implementations of a SequenceDocument are
ImmutableSequenceNot all SequenceDocuments are editable, although most implementations also implement
|Modifier and Type||Interface and Description|
Supported sequence types.
Provides a method for returning a new sequence which represents a transformation made to another sequence.
PluginDocument.ReferencedDocumentsAlwaysLoaded, PluginDocument.ReferencedDocumentsNotLoaded, PluginDocument.SizeRequiredToLoadIntoMemoryProvider
|Modifier and Type||Field and Description|
The sequence length threshold at which we decide a sequence is a genome.
FILE_DATA_ATTRIBUTE_NAME, MAXIMUM_HTML_LENGTH, MODIFIED_DATE_FIELD
|Modifier and Type||Method and Description|
Get the sequence as a CharSequence.
Gets sequence annotations which are directly on the sequence.
Returns the length of the sequence.
Get the sequence as a string.
Returns true if this sequence is circular.
getCreationDate, getDescription, getDisplayableFields, getFieldValue, getName, getURN, toHTML
static final int GENOME_SEQUENCE_THRESHOLD
SequenceAlignmentDocument. Stand-alone sequences may not contain gaps. If
getCharSequence()doesn't call this method, then one possible implementation for this method is the following:
WARNING: It is generally a bad idea to use this method on anything but very short sequences. On large sequences (e.g. whole chromosomes) this method
may take some time and may use significant amounts of memory. e.g. A String representation of human chr1 requires 500 MB of memory. It is preferable to use
length(), but may be more performant on some implementations.
NucleotideGraph, the return value of this method must be consistent with the contracts from both interfaces.
getSequenceString()in situations where a String is unnecessary and could potentially use too much memory, or where we want to efficiently calculate the terminal gap lengths. The returned CharSequence must always return consistent values from any of the CharSequence methods (e.g.
CharSequence.charAt(int). If a SequenceDocument is editable and changes are made to it, it is required that the original CharSequence obtained from
getCharSequence()not change. A client of the SequenceDocument is only able to obtain the changes by making a fresh call to
getSequenceString()doesn't call this method, then it is possible to implement this method as follows:
However, it is recommended that a more memory efficient representation is used
where possible; in that case,
getSequenceString() can be implemented
based on this method (see its javadoc).
Some implementations of this method may choose to throw a RuntimeException whose cause is an XMLSerializationException if there is insufficient memory to load the sequence. In most situations (e.g. from a DocumentOperation or DocumentFileImporter) catching this exception is unnecessary as core Geneious will have either pre-loaded the sequence or will catch and unwrap this exception itself gracefully.
SequenceUtilities.getSequenceAndTrackAnnotationsThis method may return an unmodifiable list and must not return the list which is used internally by the SequenceDocument to store the annotations (ie modifying the returned list should not modify the annotations on the SequenceDocument directly)