Package htsjdk.tribble
Interface FeatureReader<T extends Feature>
- Type Parameters:
T
- a feature type
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
AbstractFeatureReader
,TabixFeatureReader
,TribbleIndexedFeatureReader
the basic interface that feature sources need to match
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the readerProvide access to the header of the readerProvides the list of sequenceNames if known.default boolean
iterator()
Provides access to all the features in the readerdefault CloseableTribbleIterator<T>
Query the reader for a particular interval corresponding to a contig and a 1-based closedQuery the reader for a particular interval corresponding to a contig and a 1-based closed
-
Method Details
-
query
Query the reader for a particular interval corresponding to a contig and a 1-based closed- Parameters:
chr
- the contig to be queriedstart
- the start of the interval (1-based) to be queriedend
- 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
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
Closes the reader- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
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)
-