public abstract class CombinedAlignmentAndSequenceDocument extends SequenceAlignmentDocument implements EditableSequenceDocument, XMLSerializable.OldVersionCompatible
CombinedAlignmentAndAminoAcidSequenceDocument
or CombinedAlignmentAndNucleotideSequenceDocument should be used.SequenceAlignmentDocument.ReferencedSequenceSequenceDocument.Alphabet, SequenceDocument.TransformerPluginDocument.ReferencedDocumentsAlwaysLoaded, PluginDocument.ReferencedDocumentsNotLoaded, PluginDocument.SizeRequiredToLoadIntoMemoryProviderXMLSerializable.OldVersionCompatible, XMLSerializable.VersionSupportTypeGENOME_SEQUENCE_THRESHOLDFILE_DATA_ATTRIBUTE_NAME, MAXIMUM_HTML_LENGTH, MODIFIED_DATE_FIELDROOT_ELEMENT_NAME| Modifier | Constructor and Description |
|---|---|
protected |
CombinedAlignmentAndSequenceDocument()
XML Deserialization constructor.
|
protected |
CombinedAlignmentAndSequenceDocument(EditableSequenceDocument sequenceDocument,
SequenceAlignmentDocument alignmentDocument,
boolean obtainSharedPropertiesFromSequence,
boolean showSequenceView)
Construct a new CombinedAlignmentAndSequenceDocument.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSequence(SequenceDocument sequence)
Add a sequence to the end of the alignment.
|
Alignment |
asJeblAlignment(boolean silentlyStripDuplicates)
Get alignment as a Jebl alignment.
|
boolean |
canAddAndRemoveSequences()
Check if this alignment supports adding and removing sequences.
|
boolean |
canSetAnnotations()
Returns true if this alignment can have its annotations on sequences (including the consensus sequence) edited alone via
SequenceAlignmentDocument.setAnnotations(int, java.util.List, boolean)
and SequenceAlignmentDocument.setAnnotationsOnConsensus(java.util.List)
Note that some alignment implementations may return true from SequenceAlignmentDocument.isEditable() and allow updating their annotations via
SequenceAlignmentDocument.updateSequence(int, CharSequence, java.util.List, NucleotideGraph, boolean) even if they return false from this method. |
boolean |
canSetAnnotationsOnConsensus() |
boolean |
canSetSequenceNames()
Specifies whether this alignment supports changing the sequence names.
|
void |
fromXML(org.jdom.Element element)
Restore the object from the JDOM Element returned by
XMLSerializable.toXML(). |
SequenceAlignmentDocument |
getAlignmentDocument()
Get the alignment document contained within this document
|
List<SequenceAnnotation> |
getAnnotationsOnConsensus()
Gets annotations that are associated with the consensus sequence.
|
SequenceCharSequence |
getCharSequence()
Get the sequence as a CharSequence.
|
int |
getContigReferenceSequenceIndex()
Get the index (if any) of the reference sequence in a contig.
|
Date |
getCreationDate()
Get the date this document was created.
|
String |
getDescription()
A human readable single line of text describing this document,
to appear in the description field in the document table.
|
List<DocumentField> |
getDisplayableFields()
A list of columns for display in the main document panel.
|
Object |
getFieldValue(String fieldCodeName)
Get the value of a particular field.
|
String |
getName()
A short name (preferably one or two words) for the document.
|
int |
getNumberOfSequences()
Number of sequences in this alignment
|
AnnotatedPluginDocument |
getReferencedDocument(int sequenceIndexInAlignment)
Get an original sequence document that this alignment was made from.
|
SequenceAlignmentDocument.ReferencedSequence |
getReferencedSequence(int sequenceIndexInAlignment)
Get an original sequence document that this alignment was made from.
|
SequenceDocument |
getSequence(int index)
Gets one row from the alignment as a
SequenceDocument. |
List<SequenceAnnotation> |
getSequenceAnnotations()
Gets sequence annotations which are directly on the sequence.
|
Sequence |
getSequenceAsJeblSequence(int index)
Gets a sequence as a jebl sequence
|
EditableSequenceDocument |
getSequenceDocument()
Get the sequence document contained within this document
|
int |
getSequenceLength()
Returns the length of the sequence.
|
List<SequenceDocument> |
getSequences()
Get the alignment as a list of sequences (Convenience function).
|
String |
getSequenceString()
Get the sequence as a string.
|
URN |
getURN()
A Universal Resource Name.
|
Geneious.MajorVersion |
getVersionSupport(XMLSerializable.VersionSupportType versionType)
Gets either the latest version this class can serialize to via
XMLSerializable.OldVersionCompatible.toXML(com.biomatters.geneious.publicapi.plugin.Geneious.MajorVersion, jebl.util.ProgressListener)
or the most recent version in which the XML returned from XMLSerializable.OldVersionCompatible.toXML(com.biomatters.geneious.publicapi.plugin.Geneious.MajorVersion, jebl.util.ProgressListener) last changed. |
boolean |
isCircular()
Returns true if this sequence is circular.
|
boolean |
isContig()
Returns false by default.
|
boolean |
isEditable()
true if this alignment is editable.
|
boolean |
isFreeEndGapAlignment()
True if this alignment was built using free end gaps.
|
boolean |
isReferencedDocumentReversed(int index)
Sequence direction.
|
void |
removeSequence(int index)
Removes the specified sequence from the alignment.
|
void |
reorderSequences(int[] ordering)
Adjusts the ordering of sequences in the alignment according to the ordering array.
|
void |
setAnnotations(int index,
List<SequenceAnnotation> annotations,
boolean allowModifyingReferencedDocuments)
Updates just the annotations on a sequence.
|
void |
setAnnotations(List<SequenceAnnotation> annotations)
Sets new annotations on this document, replacing the existing ones.
|
void |
setAnnotationsOnConsensus(List<SequenceAnnotation> annotations)
Sets the annotations on the consensus sequence that will be returned from a later call to
SequenceAlignmentDocument.getAnnotationsOnConsensus(). |
void |
setCircular(boolean circular)
Set whether or not this sequence is circular.
|
boolean |
setReferencedDocument(int sequenceIndexInAlignment,
AnnotatedPluginDocument document)
Sets the sequence at the given sequenceIndexInAlignment in this alignment to refer to the given document as if it is the original source.
|
boolean |
setReferencedSequence(int sequenceIndexInAlignment,
SequenceAlignmentDocument.ReferencedSequence referencedSequence)
|
void |
setSequenceAndAnnotations(CharSequence sequence,
List<SequenceAnnotation> annotations)
Sets the sequence and annotations of this document.
|
void |
setSequenceName(int index,
String newName,
boolean allowModifyingReferencedDocuments)
change the name of a sequence within the alignment.
|
boolean |
showSequenceView() |
String |
toHTML()
Provide a textual view of document.
|
org.jdom.Element |
toXML()
Convert object to a JDOM element.
|
org.jdom.Element |
toXML(Geneious.MajorVersion version,
ProgressListener progressListener)
Serializes this class to XML format, potentially to a format readable by an earlier version of Geneious.
|
void |
updateSequence(int index,
CharSequence sequence,
List<SequenceAnnotation> annotations,
NucleotideGraph graph,
boolean allowModifyingReferencedDocuments)
Set new residues and related data for one sequence.
|
asJeblAlignmentIfMemoryAllows, canSetFieldValue, getCircularLength, getImmutablePairedReadManager, getMateExpectedDistance, getMateIndex, getRealignedName, getReferencedDocuments, getReferencedSequences, getRefinedName, getSequencesInImmutableList, getSequenceType, isQueryCentricAlignment, setFieldValue, setMates, setReferencedSequenceprotected CombinedAlignmentAndSequenceDocument(EditableSequenceDocument sequenceDocument, SequenceAlignmentDocument alignmentDocument, boolean obtainSharedPropertiesFromSequence, boolean showSequenceView)
CombinedAlignmentAndAminoAcidSequenceDocument
or
CombinedAlignmentAndNucleotideSequenceDocumentsequenceDocument - the sequenceDocument to wrap.alignmentDocument - the alignmentDocument to wrap.obtainSharedPropertiesFromSequence - for properties which exist on both documents
(e.g. name or description), if only one provides a non-null property, that is used.
If both provide a non-null value, when this paremeter is true, the value from the sequence is used.
If both provide a non-null value, when this paremeter is false, the value from the alignment is used.showSequenceView - True if the sequence viewer should display a sequence view on this document. A situation
where this would be false would be for a Blast Summary result document, where the sequence document is identical
to the sequence contained in the alignment, and so a sequence view would provide no further useful information.protected CombinedAlignmentAndSequenceDocument()
XMLSerializablepublic boolean showSequenceView()
public EditableSequenceDocument getSequenceDocument()
public SequenceAlignmentDocument getAlignmentDocument()
public String toHTML()
PluginDocument<html>toHTML in interface PluginDocumenttoHTML in class SequenceAlignmentDocumentpublic List<DocumentField> getDisplayableFields()
PluginDocumentPluginDocument.getFieldValue(String).
Each column is specified by a Field. The fields should be obtained from a call to the appropriate
Field.createXXXXField, where XXXX is the appropriate type.
While it is not required, it is recommended that a PluginDocument
handle returning a complete list of its displayable fields before
the document has been properly constructed via a call to XMLSerializable.fromXML(org.jdom.Element)
The returned list need not and should not be modifiable.getDisplayableFields in interface PluginDocumentpublic Object getFieldValue(String fieldCodeName)
PluginDocumentgetFieldValue in interface PluginDocumentfieldCodeName - field code. This should be the
code of one of the fields
returned from PluginDocument.getDisplayableFields().DocumentField.getValueType() (or a subclass) of the corresponding DocumentField returned from PluginDocument.getDisplayableFields().public String getName()
PluginDocumentAnnotatedPluginDocument then this method
will be overridden and delegate back to AnnotatedPluginDocument.getName(). One way to look at it is
that when you call PluginDocument.getName() you will get the current name of the document. If you are implementing PluginDocument.getName() then you are
returning the default name for the document.getName in interface PluginDocumentpublic URN getURN()
PluginDocumentgetURN in interface PluginDocumentpublic Date getCreationDate()
PluginDocumentAnnotatedPluginDocument.getCreationDate()
instead as that will return either the date returned from
PluginDocument.getCreationDate() or if that returned null,
AnnotatedPluginDocument.getCreationDate() will return the date the
document was first instantiated.getCreationDate in interface PluginDocumentPluginDocument.MODIFIED_DATE_FIELDpublic String getDescription()
PluginDocumentgetDescription in interface PluginDocumentpublic Geneious.MajorVersion getVersionSupport(XMLSerializable.VersionSupportType versionType)
XMLSerializable.OldVersionCompatibleXMLSerializable.OldVersionCompatible.toXML(com.biomatters.geneious.publicapi.plugin.Geneious.MajorVersion, jebl.util.ProgressListener)
or the most recent version in which the XML returned from XMLSerializable.OldVersionCompatible.toXML(com.biomatters.geneious.publicapi.plugin.Geneious.MajorVersion, jebl.util.ProgressListener) last changed.getVersionSupport in interface XMLSerializable.OldVersionCompatibleversionType - specifies which version property to returnpublic org.jdom.Element toXML()
XMLSerializableXMLSerializable.fromXML(org.jdom.Element) can completely
restore the objects representation.
It is recommended that the returned element use XMLSerializable.ROOT_ELEMENT_NAME as its name,
in which case it must not define an attribute called "type". In this case,
fromXML, will be called with an element whose name may differ from the element
return from this function. This recommendation allows a more compact representation
of the XML can be stored.
This method generally should not be called directly. Instead, you should usually call
XMLSerializer.classToXML(String, XMLSerializable)
which calls this method internally.
PluginDocument implementations of this method may choose to throw an XMLSerializationException,
enclosed in a RuntimeException.toXML in interface XMLSerializablepublic org.jdom.Element toXML(Geneious.MajorVersion version, ProgressListener progressListener)
XMLSerializable.OldVersionCompatibleXMLSerializable.toXML() for a more
detailed description of what it means to serialize to XML.
All classes that implement this method must also implement XMLSerializable.toXML() and should delegate back to
this method using Geneious.getMajorVersion() and ProgressListener.EMPTY as parameters.toXML in interface XMLSerializable.OldVersionCompatibleversion - the major version of Geneious to serialize to XML for. For example "6.0" but not "6.0.0". This must be a version
returned greater or equal to a version returned from
getVersionSupport(VersionSupportType.OldestVersionSerializableTo)
and must never be greater than the current version (Geneious.getMajorVersion())progressListener - for reporting progress and cancellingpublic void fromXML(org.jdom.Element element)
throws XMLSerializationException
XMLSerializableXMLSerializable.toXML().
This method generally should not be called directly. Instead, you should usually call
XMLSerializer.classFromXML(org.jdom.Element)
or XMLSerializer.classFromXML(org.jdom.Element, Class)
which calls this method internally.
It is optional to implement this method. Instead of implementing an empty constructor and implementing
this method properly, the implementation may instead
throw an UnsupportedOperationException and implement a constructor
that takes a single Element as a parameter.
This allows for cleaner code such as support for final fields in the XMLSerializable class.
The element parameter should not be modified since it may be reused. If you need a modified version of it,
take a copy with Element.clone().fromXML in interface XMLSerializableelement - representation from a previous call to XMLSerializable.toXML()XMLSerializationException - if the Element can't be converted into this type of objectpublic String getSequenceString()
SequenceDocumentSequenceDocument.getCharSequence() doesn't call this method, then one possible implementation
for this method is the following:
return getCharSequence().toString();
getSequenceString in interface SequenceDocumentSequenceDocument.getCharSequence()public int getSequenceLength()
SequenceDocumentgetCharSequence().length(),
but may be more performant on some implementations.getSequenceLength in interface SequenceDocumentNucleotideGraph,
the return value of this method must be consistent with the contracts from both
interfaces.public SequenceCharSequence getCharSequence()
SequenceDocumentSequenceDocument.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.length() and CharSequence.charAt(int).
If a SequenceDocument is editable and changes are made to it,
it is required that the original CharSequence obtained from
SequenceDocument.getCharSequence()
not change. A client of the SequenceDocument is only able to obtain
the changes by making a fresh call to SequenceDocument.getCharSequence().
If SequenceDocument.getSequenceString() doesn't call this method, then it is possible to
implement this method as follows:
return SequenceCharSequence.valueOf(getSequenceString());
However, it is recommended that a more memory efficient representation is used
where possible; in that case, SequenceDocument.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.
getCharSequence in interface SequenceDocumentSequenceDocument.getSequenceString()public List<SequenceAnnotation> getSequenceAnnotations()
SequenceDocumentsequence tracks.
SequenceUtilities.getSequenceAndTrackAnnotations
This 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)SequenceUtilities.getSequenceAnnotationsIncludingImmutableSequencesTrims(SequenceDocument).SequenceAnnotation.TYPE_EXTRACTED_REGION.getSequenceAnnotations in interface SequenceDocumentCollections.emptyList()).SequenceUtilities.getSequenceAndTrackAnnotations(SequenceDocument),
SequenceDocumentWithEditableAnnotations.setAnnotations(java.util.List)public boolean isCircular()
SequenceDocumentSequenceAnnotationInterval.getFrom()isCircular in interface SequenceDocumentpublic void setSequenceAndAnnotations(CharSequence sequence, List<SequenceAnnotation> annotations) throws UnsupportedOperationException
EditableSequenceDocumentSequenceTracks
EditableNucleotideGraphSequenceDocument.setSequenceAndAnnotationsAndGraph(CharSequence, java.util.List, NucleotideGraph).
Hence, it is illegal to change the length of the sequence through this method if
this is instanceof NucleotideGraphSequenceDocument;
Therefore, implementations of this method should start with the following code:
if (this instanceof NucleotideGraphSequenceDocument && sequence.length() != getSequenceLength()) {
throw new IllegalArgumentException("Can't change sequence length without updating graph for " + getClass());
}
setSequenceAndAnnotations in interface EditableSequenceDocumentsequence - new residues; NOTE: This CharSequence must not change its length or characters after it was passed to this method!annotations - new annotationsUnsupportedOperationExceptionpublic void setAnnotations(List<SequenceAnnotation> annotations)
SequenceDocumentWithEditableAnnotationsSequenceTrackssetAnnotations in interface SequenceDocumentWithEditableAnnotationsannotations - New annotations to set on this document.SequenceDocument.getSequenceAnnotations()public void setCircular(boolean circular)
EditableSequenceDocumentsetCircular in interface EditableSequenceDocumentcircular - true to set this sequence as circular.SequenceDocument.isCircular()public int getNumberOfSequences()
SequenceAlignmentDocumentgetNumberOfSequences in class SequenceAlignmentDocumentpublic SequenceDocument getSequence(int index)
SequenceAlignmentDocumentSequenceDocument. As this sequence
is an alignment row, it will normally contain gaps.
If implementation stores the URN of the original sequence document, see
the note in SequenceAlignmentDocument.getReferencedDocument(int).getSequence in class SequenceAlignmentDocumentindex - between 0 and SequenceAlignmentDocument.getNumberOfSequences()-1 inclusive.public List<SequenceDocument> getSequences()
SequenceAlignmentDocumentSequenceAlignmentDocument.getNumberOfSequences() and SequenceAlignmentDocument.getSequence(int).getSequences in class SequenceAlignmentDocumentSequenceAlignmentDocument.getSequencesInImmutableList()public AnnotatedPluginDocument getReferencedDocument(int sequenceIndexInAlignment)
SequenceAlignmentDocumentgetReferencedDocument in class SequenceAlignmentDocumentsequenceIndexInAlignment - the index of the sequence in the alignment to get the original document for. between 0 and SequenceAlignmentDocument.getNumberOfSequences()-1 inclusive.SequenceAlignmentDocument.getReferencedSequence(int)public SequenceAlignmentDocument.ReferencedSequence getReferencedSequence(int sequenceIndexInAlignment)
SequenceAlignmentDocumentgetReferencedSequence in class SequenceAlignmentDocumentsequenceIndexInAlignment - the index of the sequence in the alignment to get the original document for. between 0 and SequenceAlignmentDocument.getNumberOfSequences()-1 inclusive.SequenceAlignmentDocument.getReferencedDocument(int).SequenceAlignmentDocument.getReferencedDocument(int)public int getContigReferenceSequenceIndex()
SequenceAlignmentDocumentgetContigReferenceSequenceIndex in class SequenceAlignmentDocumentSequenceAlignmentDocument.getNumberOfSequences()-1]) or -1 to if this contig has no reference sequence.public boolean setReferencedSequence(int sequenceIndexInAlignment,
SequenceAlignmentDocument.ReferencedSequence referencedSequence)
SequenceAlignmentDocumentsetReferencedSequence in class SequenceAlignmentDocumentsequenceIndexInAlignment - the sequenceIndexInAlignment of the sequence referred to. between 0 and SequenceAlignmentDocument.getNumberOfSequences() - 1referencedSequence - the document to referencepublic boolean isReferencedDocumentReversed(int index)
SequenceAlignmentDocumentisReferencedDocumentReversed in class SequenceAlignmentDocumentindex - between 0 and SequenceAlignmentDocument.getNumberOfSequences()-1 inclusive.SequenceAlignmentDocument.getReferencedDocument(int) is not null and it is in the reverse direction of its sequence string in the alignment.public boolean isEditable()
SequenceAlignmentDocumentSequenceAlignmentDocument.reorderSequences(int[]), SequenceAlignmentDocument.removeSequence(int) , SequenceAlignmentDocument.updateSequence(int, CharSequence, java.util.List, NucleotideGraph, boolean), SequenceAlignmentDocument.setReferencedDocument(int, com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument) SequenceAlignmentDocument.canSetAnnotations() to allow updating just the annotations via SequenceAlignmentDocument.setAnnotations(int, java.util.List, boolean)isEditable in class SequenceAlignmentDocumentpublic void reorderSequences(int[] ordering)
SequenceAlignmentDocumentSequenceAlignmentDocument.isEditable()reorderSequences in class SequenceAlignmentDocumentordering - Each integer between 0 and ordering.length - 1 inclusive should occur exactly once in this array.public void removeSequence(int index)
SequenceAlignmentDocumentSequenceAlignmentDocument.isEditable()removeSequence in class SequenceAlignmentDocumentindex - the index of the sequence to be removed. between 0 and SequenceAlignmentDocument.getNumberOfSequences() - 1public boolean canAddAndRemoveSequences()
SequenceAlignmentDocumentcanAddAndRemoveSequences in class SequenceAlignmentDocumentSequenceAlignmentDocument.addSequence(SequenceDocument),
SequenceAlignmentDocument.removeSequence(int)public void addSequence(SequenceDocument sequence)
SequenceAlignmentDocumentsequence should be the
gapped (aligned) sequence.addSequence in class SequenceAlignmentDocumentsequence - sequence to addSequenceAlignmentDocument.reorderSequences(int[]),
SequenceAlignmentDocument.setReferencedDocument(int, com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument)public void updateSequence(int index,
CharSequence sequence,
List<SequenceAnnotation> annotations,
NucleotideGraph graph,
boolean allowModifyingReferencedDocuments)
SequenceAlignmentDocumentSequenceAlignmentDocument.isEditable()
(otherwise, the method should throw UnsupportedOperationException).updateSequence in class SequenceAlignmentDocumentindex - the index of the sequence to be updated. between 0 and SequenceAlignmentDocument.getNumberOfSequences() - 1sequence - the new residuesannotations - a list of the annotationsgraph - Must be null if the original sequence at the specified index is not a NucleotideGraphSequenceDocument.
Otherwise (i.e. if the sequence was a NucleotideGraphSequenceDocument), specifies the new
graph to use for that sequence.allowModifyingReferencedDocuments - if the change being made to the sequence would affect the unaligned version of it
(for example, the sequence residues are changing rather than just the gaps)
and the alignment stores a reference an editable original SequenceDocument
(which can be determined by using SequenceAlignmentDocument.getReferencedDocument(int)) then if this parameter is true
the original referenced sequence document will be modified.
If this parameter is not true and the change would have otherwise modified the original SequenceDocument,
then any reference to the original document will be discarded
and a copy of the original sequence stored internally within the alignment instead.public boolean setReferencedDocument(int sequenceIndexInAlignment,
AnnotatedPluginDocument document)
SequenceAlignmentDocument sequenceIndexInAlignment ,
with gap residues removed.
This method may be used when the user chooses to extract a sequence from an alignment, so the alignment
should now be updated to reference the extracted sequence.
Any alignment implementations may choose to not implement this method, in which case of the default implementation is used which always returns false.setReferencedDocument in class SequenceAlignmentDocumentsequenceIndexInAlignment - the sequenceIndexInAlignment of the sequence referred to. between 0 and SequenceAlignmentDocument.getNumberOfSequences() - 1document - the document to referenceSequenceAlignmentDocument.getReferencedDocument(int) to check if it really worked.public Alignment asJeblAlignment(boolean silentlyStripDuplicates)
SequenceAlignmentDocumentasJeblAlignment in class SequenceAlignmentDocumentsilentlyStripDuplicates - Unlike Geneious alignments, Jebl alignments cannot contain sequences
with the same names. If this parameter is true, duplicate sequences will be absent from the returned alignment.
if this parameter is false, sequences will be given unique names by appending "1", "2", etc .
This function is implemented for all alignments. Sub-classes need not implement it, but may wish to
if they internally store their alignment in jebl format already.public Sequence getSequenceAsJeblSequence(int index)
SequenceAlignmentDocumentgetSequenceAsJeblSequence in class SequenceAlignmentDocumentindex - the index of the sequence to get. between 0 and SequenceAlignmentDocument.getNumberOfSequences() - 1public boolean isContig()
SequenceAlignmentDocumentDefaultAlignmentDocument
then the document will not be given the contig icon (to set non default icons for
a document see DocumentType.OVERRIDE_DOCUMENT_TYPE_KEY.
Use DefaultAlignmentDocument.setContig(boolean)
to create a contig.isContig in class SequenceAlignmentDocumentDefaultAlignmentDocument.setContig(boolean)public boolean canSetSequenceNames()
SequenceAlignmentDocumentSequenceAlignmentDocument.setSequenceName(int, String, boolean)canSetSequenceNames in class SequenceAlignmentDocumentpublic void setSequenceName(int index,
String newName,
boolean allowModifyingReferencedDocuments)
SequenceAlignmentDocumentSequenceAlignmentDocument.canSetSequenceNames() returns true.setSequenceName in class SequenceAlignmentDocumentindex - index of the sequence name to changenewName - the new name for the sequence.allowModifyingReferencedDocuments - if the alignment stores a reference to an editable original SequenceDocument
(which can be determined by using SequenceAlignmentDocument.getReferencedDocument(int)) then if this parameter is true
the original referenced sequence document will be renamed too.
Otherwise, any existing reference to the original SequenceDocument will be discarded
and a copy of the original sequence stored internally within the alignment instead.public boolean isFreeEndGapAlignment()
SequenceAlignmentDocumentisFreeEndGapAlignment in class SequenceAlignmentDocumentpublic boolean canSetAnnotations()
SequenceAlignmentDocumentSequenceAlignmentDocument.setAnnotations(int, java.util.List, boolean)
and SequenceAlignmentDocument.setAnnotationsOnConsensus(java.util.List)
Note that some alignment implementations may return true from SequenceAlignmentDocument.isEditable() and allow updating their annotations via
SequenceAlignmentDocument.updateSequence(int, CharSequence, java.util.List, NucleotideGraph, boolean) even if they return false from this method.canSetAnnotations in class SequenceAlignmentDocumentSequenceAlignmentDocument.setAnnotations(int, java.util.List, boolean)SequenceAlignmentDocument.setAnnotations(int, java.util.List, boolean),
SequenceAlignmentDocument.setAnnotationsOnConsensus(java.util.List),
SequenceAlignmentDocument.canSetAnnotationsOnConsensus()public void setAnnotations(int index,
List<SequenceAnnotation> annotations,
boolean allowModifyingReferencedDocuments)
SequenceAlignmentDocumentSequenceAlignmentDocument.canSetAnnotations() returns true
This is used for updating non-track annotations only. Track annotations are handled via a different API. To update or add tracks check if
a sequence in the alignment implements SequenceTrack.Manager.ProvidersetAnnotations in class SequenceAlignmentDocumentindex - the 0-based index of the sequence to set annotations on, or -1 to set annotations on the consensus sequence.annotations - the new annotations for this sequence, which will replace any existing annotations.allowModifyingReferencedDocuments - if this is true the original referenced sequence document will be modified to use these annotations
If this parameter is not true and then any reference to the original document will be discarded
and a copy of the original sequence stored internally within the alignment instead.public boolean canSetAnnotationsOnConsensus()
canSetAnnotationsOnConsensus in class SequenceAlignmentDocumentSequenceAlignmentDocument.setAnnotationsOnConsensus(java.util.List).SequenceAlignmentDocument.setAnnotationsOnConsensus(java.util.List)public List<SequenceAnnotation> getAnnotationsOnConsensus()
SequenceAlignmentDocumentgetAnnotationsOnConsensus in class SequenceAlignmentDocumentpublic void setAnnotationsOnConsensus(List<SequenceAnnotation> annotations)
SequenceAlignmentDocumentSequenceAlignmentDocument.getAnnotationsOnConsensus().
It is only legal to call this method if SequenceAlignmentDocument.canSetAnnotationsOnConsensus() returns true.setAnnotationsOnConsensus in class SequenceAlignmentDocumentannotations - the annotations to store on the consensus. Must not be null. This replaces any existing annotations on the consensus.SequenceAlignmentDocument.getAnnotationsOnConsensus(),
SequenceAlignmentDocument.canSetAnnotationsOnConsensus()