| Modifier and Type | Field and Description |
|---|---|
static int |
MAGIC_NUMBER |
| Constructor and Description |
|---|
TabixIndex(File tabixFile)
Convenient ctor that opens the file, wraps with with BGZF reader, and closes after reading index.
|
TabixIndex(InputStream inputStream) |
TabixIndex(TabixFormat formatSpec,
List<String> sequenceNames,
BinningIndexContent[] indices) |
| Modifier and Type | Method and 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(File tabixFile)
Writes the index with BGZF.
|
void |
write(LittleEndianOutputStream los)
all indexes are writable to disk
|
void |
writeBasedOnFeatureFile(File featureFile)
Writes to a file with appropriate name and directory based on feature file.
|
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.IOExceptionpublic TabixIndex(File tabixFile) 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(File tabixFile) throws IOException
write in interface IndextabixFile - Where to write the index.IOException - if the index is unable to write to the specified filepublic void writeBasedOnFeatureFile(File featureFile) throws IOException
writeBasedOnFeatureFile in interface IndexfeatureFile - File being indexed.IOExceptionpublic 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