public interface NucleotideGraph
Optional phred-like quality information on the residues of a
sequence, and an optional chromatogram graph.
For some sequences such as 454 flowgrams, only phred-like quality information for each sequence residues exists. Other sequences, e.g. ABI traces, will have both the quality information and a chromatogram graph.
A chromatogram graph may exist for any subset of the four bases (A, C, G, T)
(see hasChromatogramValues(int)). If a chromatogram exists, then its values are specified
through getChromatogramValue(int, int). The positions in the chromatogram where the
bases were called, i.e. which corresponds to positions in the sequence, are
specified through getChromatogramPositionForResidue(int).
Typically the site positions of the subsequent residues should be spaced regularly through the graph, but slight variations occur due to inaccuracies in the sequencing process. However, it is required that the positions for increasing residue indices also increase. It is not specified what Geneious will do if it encounters a NucleotideGraph that violates this requirement.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
NucleotideGraph.ImmutableGraphProvider
An interface a NucleotideGraph may implement to indicate it can provide an immutable instance of itself.
|
| Modifier and Type | Method and 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 to
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 |
getSequenceLength()
The
length of the nucleotide sequence that can be annotated with this graph. |
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 call
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.
|
int getChromatogramValue(int nucleotideStateNumber,
int graphPosition)
throws IndexOutOfBoundsException
hasChromatogramValues(int) returns true for the
specified nucleotide.nucleotideStateNumber - The nucleotide for which to retrieve the graph value, encoded as
0 = A, 1 = C, 2 = G, 3 = T (alphabetic order, same as in Nucleotides)graphPosition - The position in the sequence for which to query the graph value,
with 0 <= graphPosition < graph lengthIndexOutOfBoundsException - if graphPosition < 0 or graphPosition >= getChromatogramLength()UnsupportedOperationException - if !hasGaphValues(nucleotideStateNumber).boolean hasChromatogramValues(int nucleotideStateNumber)
getChromatogramValue(int, int) for the specified nucleotide.nucleotideStateNumber - A nucleotide state number encoded in the same way as for getChromatogramValue(int, int),
i.e. 0 = A, 1 = C, 2 = G, 3 = TgetChromatogramValue(int, int) for the specified nucleotideIllegalArgumentException - if nucleotideStateNumber < 0 or nucleotideStateNumber > 3.
It is not guaranteed that this exception will ever be thrown, even if the arguments are illegal.int getChromatogramPositionForResidue(int residueIndex)
throws IndexOutOfBoundsException,
UnsupportedOperationException
getChromatogramValue(int, int)) where the
nucleotide at the specified residue index has been called. This method may only be called if
hasChromatogramPositionsForResidues() returns true.
The graph sites are guaranteed to have the same order as the sequence nucleotides. Therefore,
any implementation must ensure that if i < j, then
getChromatogramPositionForResidue(i) <= getChromatogramPositionForResidue(j).residueIndex - A value 0 <= residueIndex < getSequenceLength() specifying
the index in the nucleotide sequence for which to calculate the corresponding position in the graph.getChromatogramLength(), specifiying the
graph position where the nucleotide that is at position residueIndex has been
called. For positions residueIndex where the
sequence
length consisting of values
between 0 and getChromatogramLength()-1 inclusive. For a residueIndex where the sequence holds
a '-', the returned site position must always be Integer.MIN_VALUE.IndexOutOfBoundsException - if residueIndex < 0 or residueIndex > getSequenceLength().UnsupportedOperationException - if !hasChromatogramPositionsForResidues().boolean hasChromatogramPositionsForResidues()
getChromatogramPositionForResidue(int).int getSequenceQuality(int residueIndex)
throws IndexOutOfBoundsException,
UnsupportedOperationException
Integer.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 if hasSequenceQualities() returns true.residueIndex - A value 0 <= residueIndex < getSequenceLength() specifying
the index in the nucleotide sequence for which to calculate the quality of the graph.IndexOutOfBoundsException - if residueIndex < 0 or residueIndex > getSequenceLength().UnsupportedOperationException - if !hasSequenceQualities().boolean hasSequenceQualities()
getSequenceQuality(int).getSequenceQuality(int) on this graph.int getSequenceLength()
length of the nucleotide sequence that can be annotated with this graph.
If a class implements both this interface and SequenceDocument, then the return value
of this method must be equal to getCharSequence().length()
Also if hasChromatogramPositionsForResidues() or hasSequenceQualities() is true, the return
value indicates the range of legal values to pass to getChromatogramPositionForResidue(int)
and getSequenceQuality(int).int getChromatogramLength()