public class LinearIndex extends AbstractIndex
Modifier and Type | Class and Description |
---|---|
static class |
LinearIndex.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 ].
|
AbstractIndex.BlockStats, AbstractIndex.IndexType
Modifier and Type | Field and Description |
---|---|
static boolean |
enableAdaptiveIndexing |
static int |
INDEX_TYPE |
static double |
MAX_FEATURES_PER_BIN |
chrIndices, flags, indexedFile, indexedFileMD5, indexedFileSize, indexedFileTS, MAGIC_NUMBER, version, VERSION
Constructor and Description |
---|
LinearIndex(java.io.InputStream inputStream)
Load from file.
|
LinearIndex(java.util.List<LinearIndex.ChrIndex> indices,
java.io.File featureFile)
Initialize using the specified
indices |
LinearIndex(java.lang.String featureFile)
Initialize with default parameters
|
Modifier and Type | Method and Description |
---|---|
java.lang.Class |
getChrIndexClass()
returns the class for the index type
|
java.util.List<java.lang.String> |
getSequenceNames() |
protected int |
getType()
get the index type
|
boolean |
isCurrentVersion()
check the current version against the version we read in
|
Index |
optimize() |
Index |
optimize(double threshold)
Adapative optimization of the linear index
|
protected void |
setTS(long ts) |
void |
writeTable(java.io.PrintStream out)
Code to convert linear index to a text table for analysis
|
addProperties, addProperty, containsChromosome, equalsIgnoreProperties, finalizeIndex, getBlocks, getBlocks, getBlockStats, getFlags, getIndexedFile, getIndexedFileMD5, getIndexedFileSize, getIndexedFileTS, getProperties, getVersion, hasFileSize, hasMD5, hasTimestamp, printIndexInfo, read, setMD5, statsSummary, validateIndexHeader, write, write, writeBasedOnFeatureFile
public static final double MAX_FEATURES_PER_BIN
public static final int INDEX_TYPE
public static boolean enableAdaptiveIndexing
public LinearIndex(java.util.List<LinearIndex.ChrIndex> indices, java.io.File featureFile)
indices
indices
- featureFile
- public LinearIndex(java.lang.String featureFile)
featureFile
- File for which this is an indexpublic LinearIndex(java.io.InputStream inputStream) throws java.io.IOException
inputStream
- This method assumes that the input stream is already buffered as appropriate.java.io.IOException
public boolean isCurrentVersion()
AbstractIndex
isCurrentVersion
in interface Index
isCurrentVersion
in class AbstractIndex
protected int getType()
AbstractIndex
getType
in class AbstractIndex
public java.util.List<java.lang.String> getSequenceNames()
getSequenceNames
in interface Index
getSequenceNames
in class AbstractIndex
public java.lang.Class getChrIndexClass()
AbstractIndex
getChrIndexClass
in class AbstractIndex
public Index optimize(double threshold)
threshold
- threshold to use for optimizing each constituent chrIndex
public Index optimize()
public void writeTable(java.io.PrintStream out)
out
- Stream to which to write out table toprotected final void setTS(long ts)