Interface NucleotideGraph

    • Method Detail

      • getChromatogramValue

        int getChromatogramValue​(int nucleotideStateNumber,
                                 int graphPosition)
                          throws java.lang.IndexOutOfBoundsException
        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 if hasChromatogramValues(int) returns true for the specified nucleotide.
        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 in Nucleotides)
        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 >= getChromatogramLength()
        java.lang.UnsupportedOperationException - if !hasGaphValues(nucleotideStateNumber).
      • hasChromatogramValues

        boolean hasChromatogramValues​(int nucleotideStateNumber)
        Specifies whether it is legal to call getChromatogramValue(int, int) for the specified nucleotide.
        Parameters:
        nucleotideStateNumber - A nucleotide state number encoded in the same way as for getChromatogramValue(int, int), i.e. 0 = A, 1 = C, 2 = G, 3 = T
        Returns:
        true if is legal to call getChromatogramValue(int, int) for the specified nucleotide
        Throws:
        java.lang.IllegalArgumentException - if nucleotideStateNumber < 0 or nucleotideStateNumber > 3. It is not guaranteed that this exception will ever be thrown, even if the arguments are illegal.
      • getChromatogramPositionForResidue

        int getChromatogramPositionForResidue​(int residueIndex)
                                       throws java.lang.IndexOutOfBoundsException,
                                              java.lang.UnsupportedOperationException
        The graph position (can be used as an argument to 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).
        Parameters:
        residueIndex - A value 0 <= residueIndex < getSequenceLength() specifying the index in the nucleotide sequence for which to calculate the corresponding position in the graph.
        Returns:
        A value in the range 0 <= value < 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.
        Throws:
        java.lang.IndexOutOfBoundsException - if residueIndex < 0 or residueIndex > getSequenceLength().
        java.lang.UnsupportedOperationException - if !hasChromatogramPositionsForResidues().
      • hasChromatogramPositionsForResidues

        boolean hasChromatogramPositionsForResidues()
        Tests whether this NucleotideGraph contains information about the position of the base calls, i.e. whether it is legal to call getChromatogramPositionForResidue(int).
        Returns:
        true if this NucleotideGraph contains information about the position of the base calls.
      • getSequenceQuality

        int getSequenceQuality​(int residueIndex)
                        throws java.lang.IndexOutOfBoundsException,
                               java.lang.UnsupportedOperationException
        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 return 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.

        Parameters:
        residueIndex - A value 0 <= residueIndex < getSequenceLength() specifying the index in the nucleotide sequence for which to calculate the quality of the graph.
        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. For all positions other than end-gaps, this must be non-negative (since below 0 would imply a negative probability)
        Throws:
        java.lang.IndexOutOfBoundsException - if residueIndex < 0 or residueIndex > getSequenceLength().
        java.lang.UnsupportedOperationException - if !hasSequenceQualities().
      • hasSequenceQualities

        boolean hasSequenceQualities()
        Tests whether this graph contains information about the confidence in the associated sequence's residues, i.e. whether it is legal to call getSequenceQuality(int).
        Returns:
        true if it is legal to call getSequenceQuality(int) on this graph.
      • getChromatogramLength

        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.
        Returns:
        the length of this graph, or 0 if this graph has no graph values for any nucleotide (i.e. 0 if hasChromatogramPositionsForResidues() is false).
      • getChromatogramValues

        default int[] getChromatogramValues​(int nucleotideStateNumber)
        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 in Nucleotides)
        Returns:
        all the values returned from getChromatogramValue(int, int) for this nucleotideStateNumber for all indices in the range 0 to getChromatogramLength() (exclusive) or null if hasChromatogramValues(int)==false for this nucleotideStateNumber.
        Since:
        API 4.202510 (Geneious 2025.1.0)
      • getSequenceQualities

        default int[] getSequenceQualities​(int startIndex,
                                           int endIndex)
        Parameters:
        startIndex - the 0-based start residue index (inclusive)
        endIndex - the 0-based end residue index (exclusive)
        Returns:
        all the values returned from getSequenceQuality(int) for all residues indices in the range startIndex (inclusive) to endIndex (exclusive) or null if hasSequenceQualities()==false.
        Since:
        API 4.202510 (Geneious 2025.1.0)
      • getChromatogramPositionsForResidues

        default int[] getChromatogramPositionsForResidues​(int startIndex,
                                                          int endIndex)
        Parameters:
        startIndex - the 0-based start residue index (inclusive)
        endIndex - the 0-based end residue index (exclusive)
        Returns:
        all the values returned from getChromatogramPositionForResidue(int) for all residues indices in the range startIndex (inclusive) to endIndex (exclusive) or null if hasChromatogramPositionsForResidues()==false.
        Since:
        API 4.202510 (Geneious 2025.1.0)