| Modifier and Type | Field | Description |
|---|---|---|
static int |
MAGIC_NUMBER |
| Constructor | Description |
|---|---|
TabixIndex(TabixFormat formatSpec,
List<String> sequenceNames,
BinningIndexContent[] indices) |
|
TabixIndex(File tabixFile) |
Convenient ctor that opens the file, wraps with with BGZF reader, and closes after reading index.
|
TabixIndex(InputStream inputStream) |
|
TabixIndex(Path tabixPath) |
Convenient ctor that opens the path, wraps with with BGZF reader, and closes after reading index.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
containsChromosome(String chr) |
|
boolean |
equals(Object o) |
|
boolean |
equalsIgnoreProperties(Object o) |
Returns true if this and obj are 'effectively' equivalent indices.
|
List<Block> |
getBlocks(String chr,
int start,
int end) |
Query the index.
|
TabixFormat |
getFormatSpec() |
|
Map<String,String> |
getProperties() |
No arbitrary properties in Tabix
|
List<String> |
getSequenceNames() |
|
int |
hashCode() |
|
boolean |
isCurrentVersion() |
|
void |
write(LittleEndianOutputStream los) |
all indexes are writable to disk
|
void |
write(Path tabixPath) |
Writes the index with BGZF.
|
void |
writeBasedOnFeaturePath(Path featurePath) |
Writes to a path with appropriate name and directory based on feature path.
|
write, writeBasedOnFeatureFilepublic TabixIndex(TabixFormat formatSpec, List<String> sequenceNames, BinningIndexContent[] indices)
formatSpec - Information about how to interpret the file being indexed. Unused by this class other than
written to an output file.sequenceNames - Sequences in the file being indexed, in the order they appear in the file.indices - One for each element of sequenceNamespublic TabixIndex(InputStream inputStream) throws IOException
inputStream - This is expected to be buffered and be gzip-decompressing as appropriate. Caller
should close input stream after ctor returns.IOExceptionpublic TabixIndex(File tabixFile) throws IOException
IOExceptionpublic TabixIndex(Path tabixPath) throws IOException
IOExceptionpublic List<Block> getBlocks(String chr, int start, int end)
IndexgetBlocks in interface Indexchr - the chromosomestart - the start position, one-based, inclusive.end - the end position, one-based, inclusive.public boolean isCurrentVersion()
isCurrentVersion in interface Indexpublic List<String> getSequenceNames()
getSequenceNames in interface Indexpublic boolean containsChromosome(String chr)
containsChromosome in interface Indexchr - the chromosome (or contig) namepublic Map<String,String> getProperties()
getProperties in interface Indexpublic boolean equalsIgnoreProperties(Object o)
IndexequalsIgnoreProperties in interface Indexpublic TabixFormat getFormatSpec()
public void write(Path tabixPath) throws IOException
write in interface IndextabixPath - Where to write the index.IOException - if the index is unable to write to the specified path.public void writeBasedOnFeaturePath(Path featurePath) throws IOException
writeBasedOnFeaturePath in interface IndexfeaturePath - Path being indexed.IOException - if featureFile is not a normal file.public void write(LittleEndianOutputStream los) throws IOException
Indexwrite in interface Indexlos - It is assumes that caller has done appropriate buffering and BlockCompressedOutputStream wrapping.
Caller should close output stream after invoking this method.IOException