public final class SBIIndex
extends java.lang.Object
implements java.io.Serializable
BAMSBIIndexer.| Modifier and Type | Class and Description |
|---|---|
static class |
SBIIndex.Header |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FILE_EXTENSION
Deprecated.
since June 2019 Use
FileExtensions.SBI instead. |
| Constructor and Description |
|---|
SBIIndex(SBIIndex.Header header,
long[] virtualOffsets)
Create an in-memory SBI with the given virtual offsets.
|
| Modifier and Type | Method and Description |
|---|---|
long |
dataFileLength()
Returns the length of the data file in bytes.
|
boolean |
equals(java.lang.Object o) |
Chunk |
getChunk(long splitStart,
long splitEnd)
Return a chunk that corresponds to the given range in the data file.
|
long |
getGranularity()
Returns the granularity of the index, that is the number of alignments between subsequent entries in the index,
or zero if not specified.
|
SBIIndex.Header |
getHeader()
Returns the index header.
|
long[] |
getVirtualOffsets()
Returns the entries in the index.
|
int |
hashCode() |
static SBIIndex |
load(java.io.InputStream in)
Load an SBI into memory from a stream.
|
static SBIIndex |
load(java.nio.file.Path path)
Load an SBI into memory from a path.
|
long |
size()
Returns number of entries in the index.
|
java.util.List<Chunk> |
split(long splitSize)
Split the data file for this index into non-overlapping chunks of roughly the given size that cover the whole
file and that can be read independently of one another.
|
java.lang.String |
toString() |
@Deprecated public static final java.lang.String FILE_EXTENSION
FileExtensions.SBI instead.public SBIIndex(SBIIndex.Header header, long[] virtualOffsets)
virtualOffsets - the offsets in the indexpublic static SBIIndex load(java.nio.file.Path path) throws java.io.IOException
path - the path to the SBI filejava.io.IOException - as per java IO contractpublic static SBIIndex load(java.io.InputStream in)
in - the stream to read the SBI frompublic SBIIndex.Header getHeader()
public long getGranularity()
public long[] getVirtualOffsets()
public long size()
public long dataFileLength()
public java.util.List<Chunk> split(long splitSize)
splitSize - the rough size of each split in bytesgetChunk(long, long)public Chunk getChunk(long splitStart, long splitEnd)
splitStart - the start of the file range (inclusive)splitEnd - the start of the file range (exclusive)split(long)public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object