FeatureReader<T>
, Closeable
, AutoCloseable
public class TabixFeatureReader<T extends Feature,SOURCE> extends AbstractFeatureReader<T,SOURCE>
AbstractFeatureReader.ComponentMethods
BLOCK_COMPRESSED_EXTENSIONS, codec, header
Constructor | Description |
---|---|
TabixFeatureReader(String featureFile,
AsciiFeatureCodec codec) |
|
TabixFeatureReader(String featureFile,
String indexFile,
AsciiFeatureCodec codec) |
|
TabixFeatureReader(String featureFile,
String indexFile,
AsciiFeatureCodec codec,
Function<SeekableByteChannel,SeekableByteChannel> wrapper,
Function<SeekableByteChannel,SeekableByteChannel> indexWrapper) |
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
Closes the reader
|
List<String> |
getSequenceNames() |
Provides the list of sequenceNames if known.
|
boolean |
hasIndex() |
Whether the reader has an index or not
Default implementation returns false
|
CloseableTribbleIterator<T> |
iterator() |
Provides access to all the features in the reader
|
CloseableTribbleIterator<T> |
query(String chr,
int start,
int end) |
Return iterator over all features overlapping the given interval
|
getFeatureReader, getFeatureReader, getFeatureReader, getFeatureReader, getFeatureReader, getHeader, hasBlockCompressedExtension, hasBlockCompressedExtension, hasBlockCompressedExtension, isQueryable, isTabix, setComponentMethods
query
public TabixFeatureReader(String featureFile, AsciiFeatureCodec codec) throws IOException
featureFile
- - path to a feature file. Can be a local file, http url, or ftp urlcodec
- IOException
public TabixFeatureReader(String featureFile, String indexFile, AsciiFeatureCodec codec) throws IOException
featureFile
- - path to a feature file. Can be a local file, http url, or ftp urlindexFile
- - path to the index file.codec
- IOException
public TabixFeatureReader(String featureFile, String indexFile, AsciiFeatureCodec codec, Function<SeekableByteChannel,SeekableByteChannel> wrapper, Function<SeekableByteChannel,SeekableByteChannel> indexWrapper) throws IOException
featureFile
- path to a feature file. Can be a local file, http url, or ftp urlindexFile
- path to the index file.wrapper
- a wrapper to apply to the byte stream from the featureResource allowing injecting features
like caching and prefetching of the stream, may be null, will only be applied if featureFile
is a uri representing a Path
indexWrapper
- a wrapper to apply to the byte stream from the indexResource, may be null, will only be
applied if indexFile is a uri representing a Path
IOException
public boolean hasIndex()
AbstractFeatureReader
hasIndex
in class AbstractFeatureReader<T extends Feature,SOURCE>
public List<String> getSequenceNames()
FeatureReader
public CloseableTribbleIterator<T> query(String chr, int start, int end) throws IOException
chr
- start
- end
- IOException
public CloseableTribbleIterator<T> iterator() throws IOException
FeatureReader
IOException
- If there's a problem reading.public void close() throws IOException
FeatureReader
IOException