Interface FeatureReader<T extends Feature>

Type Parameters:
T - a feature type
All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
AbstractFeatureReader, TabixFeatureReader, TribbleIndexedFeatureReader

public interface FeatureReader<T extends Feature> extends Closeable
the basic interface that feature sources need to match
  • Method Details

    • query

      CloseableTribbleIterator<T> query(String chr, int start, int end) throws IOException
      Query the reader for a particular interval corresponding to a contig and a 1-based closed
      Parameters:
      chr - the contig to be queried
      start - the start of the interval (1-based) to be queried
      end - the last base in the interval to be queried
      Returns:
      an iterator containing the features that at in the interval.
      Throws:
      IOException - If there's a problem reading or if the reader is not queryable, e.g. if it doesn't have an index.
    • query

      default CloseableTribbleIterator<T> query(Locatable locus) throws IOException
      Query the reader for a particular interval corresponding to a contig and a 1-based closed
      Parameters:
      locus - The locus to be queried
      Returns:
      an iterator containing the features that at in the interval.
      Throws:
      IOException - If there's a problem reading or if the reader is not queryable, e.g. if it doesn't have an index.
    • iterator

      Provides access to all the features in the reader
      Returns:
      an iterator to all the features in the reader
      Throws:
      IOException - If there's a problem reading.
    • close

      void close() throws IOException
      Closes the reader
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • getSequenceNames

      List<String> getSequenceNames()
      Provides the list of sequenceNames if known. Otherwise will return an empty list.
      Returns:
      the list of sequenceNames if known. Otherwise will return an empty list.
    • getHeader

      Object getHeader()
      Provide access to the header of the reader
      Returns:
      the header of the reader. May be null.
    • isQueryable

      default boolean isQueryable()
      Returns:
      true if the reader has an index, which means that it can be queried. Must be implemented to return true if the implementation supports query(Locatable)