Class CombinedAlignmentAndNucleotideGraphSequenceDocument
- java.lang.Object
-
- com.biomatters.geneious.publicapi.documents.sequence.SequenceAlignmentDocument
-
- com.biomatters.geneious.publicapi.implementations.sequence.CombinedAlignmentAndSequenceDocument
-
- com.biomatters.geneious.publicapi.implementations.sequence.CombinedAlignmentAndNucleotideGraphSequenceDocument
-
- All Implemented Interfaces:
PluginDocument
,EditableNucleotideGraphSequenceDocument
,EditableSequenceDocument
,NucleotideGraph
,NucleotideGraphSequenceDocument
,NucleotideSequenceDocument
,PairedReads
,SequenceDocument
,SequenceDocumentWithEditableAnnotations
,XMLSerializable
,XMLSerializable.OldVersionCompatible
public class CombinedAlignmentAndNucleotideGraphSequenceDocument extends CombinedAlignmentAndSequenceDocument implements EditableNucleotideGraphSequenceDocument
See documentation atCombinedAlignmentAndSequenceDocument
- Since:
- API 4.60 (Geneious 5.6.0)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.biomatters.geneious.publicapi.documents.sequence.SequenceAlignmentDocument
SequenceAlignmentDocument.ReferencedSequence
-
Nested classes/interfaces inherited from interface com.biomatters.geneious.publicapi.documents.sequence.NucleotideGraph
NucleotideGraph.ImmutableGraphProvider
-
Nested classes/interfaces inherited from interface com.biomatters.geneious.publicapi.documents.PluginDocument
PluginDocument.ReferencedDocumentsAlwaysLoaded, PluginDocument.ReferencedDocumentsNotLoaded, PluginDocument.SizeRequiredToLoadIntoMemoryProvider
-
Nested classes/interfaces inherited from interface com.biomatters.geneious.publicapi.documents.sequence.SequenceDocument
SequenceDocument.Alphabet, SequenceDocument.Transformer
-
Nested classes/interfaces inherited from interface com.biomatters.geneious.publicapi.documents.XMLSerializable
XMLSerializable.OldVersionCompatible, XMLSerializable.VersionSupportType
-
-
Field Summary
-
Fields inherited from interface com.biomatters.geneious.publicapi.documents.sequence.NucleotideSequenceDocument
NICE_NAME
-
Fields inherited from interface com.biomatters.geneious.publicapi.documents.PluginDocument
FILE_DATA_ATTRIBUTE_NAME, MAXIMUM_HTML_LENGTH, MODIFIED_DATE_FIELD
-
Fields inherited from interface com.biomatters.geneious.publicapi.documents.sequence.SequenceDocument
GENOME_SEQUENCE_THRESHOLD
-
Fields inherited from interface com.biomatters.geneious.publicapi.documents.XMLSerializable
ROOT_ELEMENT_NAME
-
-
Constructor Summary
Constructors Constructor Description CombinedAlignmentAndNucleotideGraphSequenceDocument()
XML Deserialization constructor.CombinedAlignmentAndNucleotideGraphSequenceDocument(NucleotideGraphSequenceDocument sequenceDocument, SequenceAlignmentDocument alignmentDocument, boolean obtainSharedPropertiesFromSequence, boolean showSequenceView)
Constructs a new combined alignment and sequence document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getChromatogramLength()
The number of points for which this graph has values, which is typically larger than the length of the nucleotide sequence because a base isn't called at every position in the graph.int
getChromatogramPositionForResidue(int residueIndex)
The graph position (can be used as an argument toNucleotideGraph.getChromatogramValue(int, int)
) where the nucleotide at the specified residue index has been called.int
getChromatogramValue(int nucleotideStateNumber, int graphPosition)
Returns the graph value for the specified nucleotide and at the specified position.int
getSequenceQuality(int residueIndex)
Returns a measurement of confidence in the residue reported at the specified residueIndex in the sequence.boolean
hasChromatogramPositionsForResidues()
Tests whether this NucleotideGraph contains information about the position of the base calls, i.e.boolean
hasChromatogramValues(int nucleotideStateNumber)
Specifies whether it is legal to callNucleotideGraph.getChromatogramValue(int, int)
for the specified nucleotide.boolean
hasSequenceQualities()
Tests whether this graph contains information about the confidence in the associated sequence's residues, i.e.void
setSequenceAndAnnotationsAndGraph(java.lang.CharSequence sequence, java.util.List<SequenceAnnotation> annotations, NucleotideGraph graph)
ReplacesEditableSequenceDocument.setSequenceAndAnnotations(CharSequence,java.util.List)
which you must not call on a NucleotideGraphSequenceDocument.-
Methods inherited from class com.biomatters.geneious.publicapi.implementations.sequence.CombinedAlignmentAndSequenceDocument
addSequence, asJeblAlignment, canAddAndRemoveSequences, canSetAnnotations, canSetAnnotationsOnConsensus, canSetSequenceNames, fromXML, getAlignmentDocument, getAnnotationsOnConsensus, getCharSequence, getContigReferenceSequenceIndex, getCreationDate, getDescription, getDisplayableFields, getFieldValue, getName, getNumberOfSequences, getReferencedDocument, getReferencedSequence, getSequence, getSequenceAnnotations, getSequenceAsJeblSequence, getSequenceDocument, getSequenceLength, getSequences, getSequenceString, getURN, getVersionSupport, isCircular, isContig, isEditable, isFreeEndGapAlignment, isReferencedDocumentReversed, removeSequence, reorderSequences, setAnnotations, setAnnotations, setAnnotationsOnConsensus, setCircular, setReferencedDocument, setReferencedSequence, setSequenceAndAnnotations, setSequenceName, showSequenceView, toHTML, toXML, toXML, updateSequence
-
Methods inherited from class com.biomatters.geneious.publicapi.documents.sequence.SequenceAlignmentDocument
asJeblAlignmentIfMemoryAllows, canSetFieldValue, getCircularLength, getImmutablePairedReadManager, getMateExpectedDistance, getMateIndex, getRealignedName, getReferencedDocuments, getReferencedSequences, getRefinedName, getSequencesInImmutableList, getSequenceType, isQueryCentricAlignment, setFieldValue, setMates, setReferencedSequence
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.biomatters.geneious.publicapi.documents.sequence.EditableSequenceDocument
setCircular, setSequenceAndAnnotations
-
Methods inherited from interface com.biomatters.geneious.publicapi.documents.sequence.NucleotideGraph
getSequenceLength
-
Methods inherited from interface com.biomatters.geneious.publicapi.documents.PluginDocument
getCreationDate, getDescription, getDisplayableFields, getFieldValue, getName, getURN, toHTML
-
Methods inherited from interface com.biomatters.geneious.publicapi.documents.sequence.SequenceDocument
getCharSequence, getSequenceAnnotations, getSequenceLength, getSequenceString, isCircular
-
Methods inherited from interface com.biomatters.geneious.publicapi.documents.sequence.SequenceDocumentWithEditableAnnotations
setAnnotations
-
Methods inherited from interface com.biomatters.geneious.publicapi.documents.XMLSerializable
fromXML, toXML
-
-
-
-
Constructor Detail
-
CombinedAlignmentAndNucleotideGraphSequenceDocument
public CombinedAlignmentAndNucleotideGraphSequenceDocument(NucleotideGraphSequenceDocument sequenceDocument, SequenceAlignmentDocument alignmentDocument, boolean obtainSharedPropertiesFromSequence, boolean showSequenceView)
Constructs a new combined alignment and sequence document. SeeCombinedAlignmentAndSequenceDocument
for documentation for the parameters to this method.
-
CombinedAlignmentAndNucleotideGraphSequenceDocument
public CombinedAlignmentAndNucleotideGraphSequenceDocument()
XML Deserialization constructor. SeeXMLSerializable
-
-
Method Detail
-
setSequenceAndAnnotationsAndGraph
public void setSequenceAndAnnotationsAndGraph(java.lang.CharSequence sequence, java.util.List<SequenceAnnotation> annotations, NucleotideGraph graph) throws java.lang.IllegalArgumentException
Description copied from interface:EditableNucleotideGraphSequenceDocument
ReplacesEditableSequenceDocument.setSequenceAndAnnotations(CharSequence,java.util.List)
which you must not call on a NucleotideGraphSequenceDocument. Does the same as that method normally would, but also sets a new graph to use (which must be consistent with the sequence, i.e.graph.getSequenceLength()
must be equal tosequence.length()
It is recommended that an implementation callDefaultNucleotideGraphSequence.checkChromatogramValidity(NucleotideGraphSequenceDocument)
before returning from this method, to ensure that the graph and sequence are consistent.- Specified by:
setSequenceAndAnnotationsAndGraph
in interfaceEditableNucleotideGraphSequenceDocument
- Parameters:
sequence
- New sequence to set on this document; must be consistent with the annotations and the graph (see above). Must not change length or characters after being passed to this method (as inEditableSequenceDocument.setSequenceAndAnnotations(CharSequence, java.util.List)
).annotations
- New annotations to set on this document, with indices relative to the new sequence.graph
- New graph to set on this document; must be consistent with the new sequence. The implementation must store a copy of this graph instead of a reference to the specified graph (using for eaxmpleDefaultNucleotideGraph.copyOf(NucleotideGraph)
)- Throws:
java.lang.IllegalArgumentException
- if the sequence and graph are not consistent.
-
getChromatogramValue
public int getChromatogramValue(int nucleotideStateNumber, int graphPosition) throws java.lang.IndexOutOfBoundsException
Description copied from interface:NucleotideGraph
Returns the graph value for the specified nucleotide and at the specified position. If the graph is a chromatogram, this is a measure of the support for the specified nucleotide at this position. May only be called ifNucleotideGraph.hasChromatogramValues(int)
returns true for the specified nucleotide.- Specified by:
getChromatogramValue
in interfaceNucleotideGraph
- Parameters:
nucleotideStateNumber
- The nucleotide for which to retrieve the graph value, encoded as 0 = A, 1 = C, 2 = G, 3 = T (alphabetic order, same as inNucleotides
)graphPosition
- The position in the sequence for which to query the graph value, with 0 <= graphPosition <graph length
- Returns:
- the graph value for the specified nucleotide and at the specified position.
- Throws:
java.lang.IndexOutOfBoundsException
- if graphPosition < 0 or graphPosition >=NucleotideGraph.getChromatogramLength()
-
hasChromatogramValues
public boolean hasChromatogramValues(int nucleotideStateNumber)
Description copied from interface:NucleotideGraph
Specifies whether it is legal to callNucleotideGraph.getChromatogramValue(int, int)
for the specified nucleotide.- Specified by:
hasChromatogramValues
in interfaceNucleotideGraph
- Parameters:
nucleotideStateNumber
- A nucleotide state number encoded in the same way as forNucleotideGraph.getChromatogramValue(int, int)
, i.e. 0 = A, 1 = C, 2 = G, 3 = T- Returns:
- true if is legal to call
NucleotideGraph.getChromatogramValue(int, int)
for the specified nucleotide
-
getChromatogramPositionForResidue
public int getChromatogramPositionForResidue(int residueIndex) throws java.lang.IndexOutOfBoundsException, java.lang.UnsupportedOperationException
Description copied from interface:NucleotideGraph
The graph position (can be used as an argument toNucleotideGraph.getChromatogramValue(int, int)
) where the nucleotide at the specified residue index has been called. This method may only be called ifNucleotideGraph.hasChromatogramPositionsForResidues()
returns true. The graph sites are guaranteed to have the same order as the sequence nucleotides. Therefore, any implementation must ensure that ifi < j
, thengetChromatogramPositionForResidue(i) <= getChromatogramPositionForResidue(j)
.- Specified by:
getChromatogramPositionForResidue
in interfaceNucleotideGraph
- Parameters:
residueIndex
- A value0 <= residueIndex <
specifying the index in the nucleotide sequence for which to calculate the corresponding position in the graph.NucleotideGraph.getSequenceLength()
- Returns:
- A value in the range 0 <= value <
NucleotideGraph.getChromatogramLength()
, specifiying the graph position where the nucleotide that is at positionresidueIndex
has been called. For positionsresidueIndex
where thesequence
length
consisting of values between 0 and getChromatogramLength()-1 inclusive. For a residueIndex where the sequenceholds
a '-', the returned site position must always beInteger.MIN_VALUE
. - Throws:
java.lang.IndexOutOfBoundsException
- if residueIndex < 0 or residueIndex >NucleotideGraph.getSequenceLength()
.java.lang.UnsupportedOperationException
- if !hasChromatogramPositionsForResidues().
-
hasChromatogramPositionsForResidues
public boolean hasChromatogramPositionsForResidues()
Description copied from interface:NucleotideGraph
Tests whether this NucleotideGraph contains information about the position of the base calls, i.e. whether it is legal to callNucleotideGraph.getChromatogramPositionForResidue(int)
.- Specified by:
hasChromatogramPositionsForResidues
in interfaceNucleotideGraph
- Returns:
- true if this NucleotideGraph contains information about the position of the base calls.
-
getSequenceQuality
public int getSequenceQuality(int residueIndex) throws java.lang.IndexOutOfBoundsException, java.lang.UnsupportedOperationException
Description copied from interface:NucleotideGraph
Returns a measurement of confidence in the residue reported at the specified residueIndex in the sequence. The measure is on a logaritmic scale: P(call correct) = 1 - 10^(-v/10) where v is the quality returned from this method. If the sequence contains a gap at the specified position, this method should returnInteger.MIN_VALUE
if it is an end gap. If it is an internal gap, it should return the average quality of the non-gap positions on either side of the gap. This method may only be called ifNucleotideGraph.hasSequenceQualities()
returns true.- Specified by:
getSequenceQuality
in interfaceNucleotideGraph
- Parameters:
residueIndex
- A value0 <= residueIndex <
specifying the index in the nucleotide sequence for which to calculate the quality of the graph.NucleotideGraph.getSequenceLength()
- Returns:
- The quality score v for the residue at the specified index in the nucleotide sequence, which indicates the reliability of the nucleotide on a logarithmic scale as described above.
- Throws:
java.lang.IndexOutOfBoundsException
- if residueIndex < 0 or residueIndex >NucleotideGraph.getSequenceLength()
.java.lang.UnsupportedOperationException
- if !hasSequenceQualities().
-
hasSequenceQualities
public boolean hasSequenceQualities()
Description copied from interface:NucleotideGraph
Tests whether this graph contains information about the confidence in the associated sequence's residues, i.e. whether it is legal to callNucleotideGraph.getSequenceQuality(int)
.- Specified by:
hasSequenceQualities
in interfaceNucleotideGraph
- Returns:
- true if it is legal to call
NucleotideGraph.getSequenceQuality(int)
on this graph.
-
getChromatogramLength
public int getChromatogramLength()
Description copied from interface:NucleotideGraph
The number of points for which this graph has values, which is typically larger than the length of the nucleotide sequence because a base isn't called at every position in the graph.- Specified by:
getChromatogramLength
in interfaceNucleotideGraph
- Returns:
- the length of this graph, or 0 if this graph has no graph values for any nucleotide (i.e. 0 if
NucleotideGraph.hasChromatogramPositionsForResidues()
is false).
-
-