Package htsjdk.tribble.index.linear
Class LinearIndex.ChrIndex
- java.lang.Object
-
- htsjdk.tribble.index.linear.LinearIndex.ChrIndex
-
- All Implemented Interfaces:
ChrIndex
- Enclosing class:
- LinearIndex
public static class LinearIndex.ChrIndex extends Object implements ChrIndex
Blocks are organized as a simple flat list: Block 0 Block 1 Block 2 There's a constant bin width, so that each block corresponds to a specific interval over the genome based on its index, as in: Block 0: (0 - binWidth] Block 1: (binWidth - 2 * binWidth] Block 2: (2 * binWidth - 3 * binWidth] Note that covered regions are open on the left ( and closed on the right ]. In general, if block i is the ith block (starting from 0), then block i contains all records that have starting position > (i * binWidth) and <= ((i + 1) * binWidth))
-
-
Constructor Summary
Constructors Constructor Description ChrIndex()
Default constructor needed for factory methods -- DO NOT REMOVE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
double
getAverageFeatureSize()
List<Block>
getBlocks()
List<Block>
getBlocks(int start, int end)
double
getFeaturesPerBlock()
String
getName()
int
getNBlocks()
int
getNFeatures()
long
getTotalSize()
int
hashCode()
void
incrementFeatureCount()
LinearIndex.ChrIndex
optimize(double threshold)
void
read(LittleEndianInputStream dis)
void
updateLongestFeature(int featureLength)
void
write(LittleEndianOutputStream dos)
-
-
-
Method Detail
-
getNBlocks
public int getNBlocks()
-
updateLongestFeature
public void updateLongestFeature(int featureLength)
-
getNFeatures
public int getNFeatures()
-
incrementFeatureCount
public void incrementFeatureCount()
-
write
public void write(LittleEndianOutputStream dos) throws IOException
- Specified by:
write
in interfaceChrIndex
- Throws:
IOException
-
read
public void read(LittleEndianInputStream dis) throws IOException
- Specified by:
read
in interfaceChrIndex
- Throws:
IOException
-
getTotalSize
public long getTotalSize()
- Returns:
- Total size of all blocks
-
getAverageFeatureSize
public double getAverageFeatureSize()
-
getFeaturesPerBlock
public double getFeaturesPerBlock()
-
optimize
public LinearIndex.ChrIndex optimize(double threshold)
-
-