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(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(java.io.File tabixFile)
Writes the index with BGZF.
|
void |
write(LittleEndianOutputStream los)
all indexes are writable to disk
|
void |
writeBasedOnFeatureFile(java.io.File featureFile)
Writes to a file with appropriate name and directory based on feature file.
|
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 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.io.File tabixFile)
tabixFile
- Where to write the index.public void writeBasedOnFeatureFile(java.io.File featureFile) throws java.io.IOException
writeBasedOnFeatureFile
in interface Index
featureFile
- File being indexed.java.io.IOException
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