Interface ReferenceSequenceFile

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
BlockCompressedIndexedFastaSequenceFile, FastaSequenceFile, IndexedFastaSequenceFile, SRAIndexedSequenceFile

public interface ReferenceSequenceFile extends Closeable
An interface for working with files of reference sequences regardless of the file format being used.
  • Method Details

    • getSequenceDictionary

      SAMSequenceDictionary getSequenceDictionary()
      Must return a sequence dictionary with at least the following fields completed for each sequence: name, length.
      Returns:
      a list of sequence records representing the sequences in this reference file
    • nextSequence

      ReferenceSequence nextSequence()
      Retrieves the next whole sequences from the file.
      Returns:
      a ReferenceSequence or null if at the end of the file
    • reset

      void reset()
      Resets the ReferenceSequenceFile so that the next call to nextSequence() will return the first sequence in the file.
    • isIndexed

      boolean isIndexed()
      Returns:
      true if getSequence and getSubsequenceAt methods are allowed.
    • getSequence

      ReferenceSequence getSequence(String contig)
      Retrieves the complete sequence described by this contig.
      Parameters:
      contig - contig whose data should be returned.
      Returns:
      The full sequence associated with this contig.
      Throws:
      UnsupportedOperationException - if !sIndexed.
    • getSubsequenceAt

      ReferenceSequence getSubsequenceAt(String contig, long start, long stop)
      Gets the subsequence of the contig in the range [start,stop]
      Parameters:
      contig - Contig whose subsequence to retrieve.
      start - inclusive, 1-based start of region.
      stop - inclusive, 1-based stop of region.
      Returns:
      The partial reference sequence associated with this range.
      Throws:
      UnsupportedOperationException - if !sIndexed.
    • toString

      String toString()
      Overrides:
      toString in class Object
      Returns:
      Reference name, file name, or something other human-readable representation.
    • close

      void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException