Package net.sf.samtools.tabix
Class TabixIndex
- java.lang.Object
-
- net.sf.samtools.tabix.TabixIndex
-
public class TabixIndex extends java.lang.Object
Tabix Index (i.e. the structure stored in *.tbi file) From the paper: Binnig index: In Tabix, each bin k, 0 <= k <= 37449, represents a half-close-half-open interval [ (k-ol) sl , (k-ol+1) sl ) , where 'l' is the level of the bin l = floor[ log2(7k + 1) / 3 ] 'sl' is the size of the bin at level l sl = 2^(29 - 3 l) 'ol': is the offset at l. ol = (23 l - 1)/7 In this scheme, bins span different sizes depending on their levels: Level Bins Size (sl) ------------------------------ 0 0 512Mb 2^29 1 1-8 64Mb 2^26 2 9-72 8Mb 2^23 3 73-584 1Mb 2^20 4 585-4680 128kb 2^17 5 4681-37449 16kb 2^14 Linear index: In the linear index, we keep for each tiling 16kb window the virtual file offset of the leftmost record (i.e. having the smallest start coordinate) that overlaps the window. When we search for records overlapping a query interval, we will know from the index the leftmost record that possibly overlaps the query interval. Records having smaller coordinates than this leftmost record can be skipped and unsuccessful seek calls can be saved.
-
-
Field Summary
Fields Modifier and Type Field Description static int
TAD_LIDX_SHIFT
-
Constructor Summary
Constructors Constructor Description TabixIndex()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
binInfo(int binNumber)
TPair64[]
get(int binNum)
long
minOffset(int beg)
void
put(int bin, TPair64[] chunks)
void
readIndex(java.io.InputStream is)
void
setDebug(boolean debug)
void
setLinearIndex(long[] linearIndex)
java.lang.String
toString()
-
-
-
Field Detail
-
TAD_LIDX_SHIFT
public static final int TAD_LIDX_SHIFT
- See Also:
- Constant Field Values
-
-
Method Detail
-
binInfo
public static java.lang.String binInfo(int binNumber)
-
get
public TPair64[] get(int binNum)
-
minOffset
public long minOffset(int beg)
-
put
public void put(int bin, TPair64[] chunks)
-
readIndex
public void readIndex(java.io.InputStream is) throws java.io.IOException
- Throws:
java.io.IOException
-
setDebug
public void setDebug(boolean debug)
-
setLinearIndex
public void setLinearIndex(long[] linearIndex)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-