Modifier and Type | Field and Description |
---|---|
static int |
MAGIC_NUMBER |
Constructor and Description |
---|
TabixIndex(java.io.File tabixFile)
Convenient ctor that opens the file, wraps with with BGZF reader, and closes after reading index.
|
TabixIndex(java.io.InputStream inputStream) |
TabixIndex(java.nio.file.Path tabixPath)
Convenient ctor that opens the path, wraps with with BGZF reader, and closes after reading index.
|
TabixIndex(TabixFormat formatSpec,
java.util.List<java.lang.String> sequenceNames,
BinningIndexContent[] indices) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsChromosome(java.lang.String chr) |
boolean |
equals(java.lang.Object o) |
boolean |
equalsIgnoreProperties(java.lang.Object o)
Returns true if this and obj are 'effectively' equivalent indices.
|
java.util.List<Block> |
getBlocks(java.lang.String chr,
int start,
int end)
Query the index.
|
TabixFormat |
getFormatSpec() |
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
No arbitrary properties in Tabix
|
java.util.List<java.lang.String> |
getSequenceNames() |
int |
hashCode() |
boolean |
isCurrentVersion() |
void |
write(LittleEndianOutputStream los)
all indexes are writable to disk
|
void |
write(java.nio.file.Path tabixPath)
Writes the index with BGZF.
|
void |
writeBasedOnFeaturePath(java.nio.file.Path featurePath)
Writes to a path with appropriate name and directory based on feature path.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
write, writeBasedOnFeatureFile
public TabixIndex(TabixFormat formatSpec, java.util.List<java.lang.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(java.io.InputStream inputStream) throws java.io.IOException
inputStream
- This is expected to be buffered and be gzip-decompressing as appropriate. Caller
should close input stream after ctor returns.java.io.IOException
public TabixIndex(java.io.File tabixFile) throws java.io.IOException
java.io.IOException
public TabixIndex(java.nio.file.Path tabixPath) throws java.io.IOException
java.io.IOException
public java.util.List<Block> getBlocks(java.lang.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 java.util.List<java.lang.String> getSequenceNames()
getSequenceNames
in interface Index
public boolean containsChromosome(java.lang.String chr)
containsChromosome
in interface Index
chr
- the chromosome (or contig) namepublic java.util.Map<java.lang.String,java.lang.String> getProperties()
getProperties
in interface Index
public boolean equalsIgnoreProperties(java.lang.Object o)
Index
equalsIgnoreProperties
in interface Index
public TabixFormat getFormatSpec()
public void write(java.nio.file.Path tabixPath) throws java.io.IOException
public void writeBasedOnFeaturePath(java.nio.file.Path featurePath) throws java.io.IOException
writeBasedOnFeaturePath
in interface Index
featurePath
- Path being indexed.java.io.IOException
- if featureFile is not a normal file.public void write(LittleEndianOutputStream los) throws java.io.IOException
Index
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object