Class ABITrace


  • public class ABITrace
    extends Object
    Title: ABITrace

    ABITrace is a class for managing ABI file information, it is capable of opening an ABI file and storing the most important fields, which can be recalled as simple java types. It can also return an image corresponding to the trace. It has three constructors with input types File, URL, and byte[].

    ABI files contain two sets of basecall and sequence data, one that was originally created programatically and the other, which is an editable copy. This version of this object only references the original unedited data.

    • Constructor Summary

      Constructors 
      Constructor Description
      ABITrace​(byte[] ABIFileData)
      The byte[] constructor parses an ABI file represented as a byte array.
      ABITrace​(File ABIFile)
      The File constructor opens a local ABI file and parses the content.
      ABITrace​(URL ABIFile)
      The URL constructor opens an ABI file from any URL.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int[] getBasecalls()
      Returns an int[] array that represents the basecalls - each int in the array corresponds to an x-coordinate point in the graph that is a peak (a base location).
      BufferedImage getImage​(int imageHeight, int widthScale)
      Returns a BufferedImage that represents the entire trace.
      int[] getQcalls()
      Returns an int[] array that represents the quality - each int in the array corresponds to an quality value 90-255) in the graph at a base location).
      AbstractSequence<NucleotideCompound> getSequence()
      Returns the original programmatically determined (unedited) sequence as a AbstractSequence.
      int getSequenceLength()
      Returns the length of the sequence (number of bases) in this trace.
      int[] getTrace​(String base)
      Returns one of the four traces - all of the y-coordinate values, each of which correspond to a single x-coordinate relative to the position in the array, so that if element 4 in the array is 972, then x is 4 and y is 972 for that point.
      int getTraceLength()
      Returns the length of the trace (number of x-coordinate points in the graph).
    • Constructor Detail

      • ABITrace

        public ABITrace​(File ABIFile)
                 throws IOException
        The File constructor opens a local ABI file and parses the content.
        Parameters:
        ABIFile - is a java.io.File on the local file system.
        Throws:
        IOException - if there is a problem reading the file.
        IllegalArgumentException - if the file is not a valid ABI file.
      • ABITrace

        public ABITrace​(URL ABIFile)
                 throws IOException
        The URL constructor opens an ABI file from any URL.
        Parameters:
        ABIFile - is a java.net.URL for an ABI trace file.
        Throws:
        IOException - if there is a problem reading from the URL.
        IllegalArgumentException - if the URL does not contain a valid ABI file.
      • ABITrace

        public ABITrace​(byte[] ABIFileData)
        The byte[] constructor parses an ABI file represented as a byte array.
        Parameters:
        ABIFileData - - byte array
        Throws:
        IllegalArgumentException - if the data does not represent a valid ABI file.
    • Method Detail

      • getSequenceLength

        public int getSequenceLength()
        Returns the length of the sequence (number of bases) in this trace.
        Returns:
        int seqLength
      • getTraceLength

        public int getTraceLength()
        Returns the length of the trace (number of x-coordinate points in the graph).
        Returns:
        int traceLength
      • getBasecalls

        public int[] getBasecalls()
        Returns an int[] array that represents the basecalls - each int in the array corresponds to an x-coordinate point in the graph that is a peak (a base location).
        Returns:
        int[] Basecalls
      • getQcalls

        public int[] getQcalls()
        Returns an int[] array that represents the quality - each int in the array corresponds to an quality value 90-255) in the graph at a base location).
        Returns:
        int[] qCalls
      • getTrace

        public int[] getTrace​(String base)
                       throws CompoundNotFoundException
        Returns one of the four traces - all of the y-coordinate values, each of which correspond to a single x-coordinate relative to the position in the array, so that if element 4 in the array is 972, then x is 4 and y is 972 for that point.
        Parameters:
        base - - the DNA String to retrieve the trace values for
        Returns:
        an array of ints giving the entire trace for that base
        Throws:
        CompoundNotFoundException - if the base is not valid
      • getImage

        public BufferedImage getImage​(int imageHeight,
                                      int widthScale)
        Returns a BufferedImage that represents the entire trace. The height can be set precisely in pixels, the width in pixels is determined by the scaling factor times the number of points in the trace (getTraceLength()). The entire trace is represented in the returned image.
        Parameters:
        imageHeight - - desired height of the image in pixels.
        widthScale - - how many horizontal pixels to use to represent a single x-coordinate (try 2).
        Returns:
        BufferedImage image