public class TribbleIndexedFeatureReader<T extends Feature,SOURCE> extends AbstractFeatureReader<T,SOURCE>
AbstractFeatureReader.ComponentMethods
BLOCK_COMPRESSED_EXTENSIONS, codec, header
Constructor and Description |
---|
TribbleIndexedFeatureReader(String featurePath,
FeatureCodec<T,SOURCE> codec,
boolean requireIndex) |
TribbleIndexedFeatureReader(String featureFile,
FeatureCodec<T,SOURCE> codec,
Index index) |
TribbleIndexedFeatureReader(String featureFile,
String indexFile,
FeatureCodec<T,SOURCE> codec,
boolean requireIndex) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
List<String> |
getSequenceNames()
Return the sequence (chromosome/contig) names in this file, if known.
|
boolean |
hasIndex()
Whether the reader has an index or not
Default implementation returns false
|
CloseableTribbleIterator<T> |
iterator() |
CloseableTribbleIterator<T> |
query(String chr,
int start,
int end)
Return an iterator to iterate over features overlapping the specified interval
Note that TribbleIndexedFeatureReader only supports issuing and manipulating a single query
for each reader.
|
getFeatureReader, getFeatureReader, getFeatureReader, getFeatureReader, getHeader, hasBlockCompressedExtension, hasBlockCompressedExtension, hasBlockCompressedExtension, setComponentMethods
public TribbleIndexedFeatureReader(String featurePath, FeatureCodec<T,SOURCE> codec, boolean requireIndex) throws IOException
featurePath
- - path to the feature file, can be a local file path, http url, or ftp urlcodec
- - codec to decode the featuresrequireIndex
- - true if the reader will be queries for specific ranges. An index (idx) file must existIOException
public TribbleIndexedFeatureReader(String featureFile, String indexFile, FeatureCodec<T,SOURCE> codec, boolean requireIndex) throws IOException
featureFile
- - path to the feature file, can be a local file path, http url, or ftp urlindexFile
- - path to the index filecodec
- - codec to decode the featuresrequireIndex
- - true if the reader will be queries for specific ranges. An index (idx) file must existIOException
public TribbleIndexedFeatureReader(String featureFile, FeatureCodec<T,SOURCE> codec, Index index) throws IOException
featureFile
- - path to the feature file, can be a local file path, http url, or ftp urlcodec
- - codec to decode the featuresindex
- - a tribble Index objectIOException
public void close() throws IOException
IOException
public List<String> getSequenceNames()
public boolean hasIndex()
AbstractFeatureReader
hasIndex
in class AbstractFeatureReader<T extends Feature,SOURCE>
public CloseableTribbleIterator<T> query(String chr, int start, int end) throws IOException
chr
- contigstart
- start positionend
- end positionIOException
public CloseableTribbleIterator<T> iterator() throws IOException
IOException