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.IOException
public TabixIndex(File tabixFile) 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(File tabixFile) throws IOException
write
in interface Index
tabixFile
- 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 Index
featureFile
- File being indexed.IOException
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