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, writeBasedOnFeatureFile
public 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.IOException
public TabixIndex(File tabixFile) throws IOException
IOException
public TabixIndex(Path tabixPath) throws IOException
IOException
public List<Block> getBlocks(String chr, int start, int end)
Index
getBlocks
in interface Index
chr
- the chromosomestart
- the start position, one-based, inclusive.end
- the end position, one-based, inclusive.public boolean isCurrentVersion()
isCurrentVersion
in interface Index
public List<String> getSequenceNames()
getSequenceNames
in interface Index
public boolean containsChromosome(String chr)
containsChromosome
in interface Index
chr
- the chromosome (or contig) namepublic Map<String,String> getProperties()
getProperties
in interface Index
public boolean equalsIgnoreProperties(Object o)
Index
equalsIgnoreProperties
in interface Index
public TabixFormat getFormatSpec()
public void write(Path tabixPath) throws IOException
write
in interface Index
tabixPath
- 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 Index
featurePath
- Path being indexed.IOException
- if featureFile is not a normal file.public void write(LittleEndianOutputStream los) throws IOException
Index
write
in interface Index
los
- It is assumes that caller has done appropriate buffering and BlockCompressedOutputStream wrapping.
Caller should close output stream after invoking this method.IOException