Package htsjdk.tribble.index.linear
Class LinearIndex
java.lang.Object
htsjdk.tribble.index.AbstractIndex
htsjdk.tribble.index.linear.LinearIndex
- All Implemented Interfaces:
Index
,MutableIndex
Index defined by dividing the genome by chromosome, then each chromosome into bins of fixed width (in
genomic coordinates). Features are allocated to bins by start position. The longest feature in each
recorded and used to adjust the start position of a query to include all bins that might have a feature
that overlaps the query interval. This works well for feature sets of approximately homogeneous length,
or whose longest feature is on the order of the bin width or less.
magicNumber integer
type integer
version integer
filename null terminated character array
filesize long
lastModified long
md5 String
flags integer
------ LINEAR INDEX
nChromosomes integer
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Blocks are organized as a simple flat list:Nested classes/interfaces inherited from class htsjdk.tribble.index.AbstractIndex
AbstractIndex.BlockStats, AbstractIndex.IndexType
-
Field Summary
Modifier and TypeFieldDescriptionstatic boolean
static final int
static final double
Fields inherited from class htsjdk.tribble.index.AbstractIndex
chrIndices, flags, indexedFileMD5, indexedFileSize, indexedFileTS, indexedPath, logger, MAGIC_NUMBER, version, VERSION
-
Constructor Summary
ConstructorDescriptionLinearIndex
(InputStream inputStream) Load from file.LinearIndex
(String featureFile) Initialize with default parametersLinearIndex
(Path featurePath) Initialize with default parametersLinearIndex
(List<LinearIndex.ChrIndex> indices, File featureFile) Initialize using the specifiedindices
LinearIndex
(List<LinearIndex.ChrIndex> indices, Path featureFile) Initialize using the specifiedindices
-
Method Summary
Modifier and TypeMethodDescriptionreturns the class for the index typeprotected int
getType()
get the index typeboolean
check the current version against the version we read inoptimize()
optimize
(double threshold) Adapative optimization of the linear indexprotected final void
setTS
(long ts) void
writeTable
(PrintStream out) Code to convert linear index to a text table for analysisMethods inherited from class htsjdk.tribble.index.AbstractIndex
addProperties, addProperty, containsChromosome, equalsIgnoreProperties, finalizeIndex, getBlocks, getBlocks, getBlockStats, getFlags, getIndexedFile, getIndexedFileMD5, getIndexedFileSize, getIndexedFileTS, getIndexedPath, getProperties, getVersion, hasFileSize, hasMD5, hasTimestamp, printIndexInfo, read, setMD5, statsSummary, validateIndexHeader, write, write, writeBasedOnFeaturePath
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface htsjdk.tribble.index.Index
write, writeBasedOnFeatureFile
-
Field Details
-
MAX_FEATURES_PER_BIN
public static final double MAX_FEATURES_PER_BIN -
INDEX_TYPE
public static final int INDEX_TYPE -
enableAdaptiveIndexing
public static boolean enableAdaptiveIndexing
-
-
Constructor Details
-
LinearIndex
Initialize using the specifiedindices
- Parameters:
indices
-featureFile
-
-
LinearIndex
Initialize using the specifiedindices
- Parameters:
indices
-featureFile
-
-
LinearIndex
Initialize with default parameters- Parameters:
featureFile
- File for which this is an index
-
LinearIndex
Initialize with default parameters- Parameters:
featurePath
- Path for which this is an index
-
LinearIndex
Load from file.- Parameters:
inputStream
- This method assumes that the input stream is already buffered as appropriate.- Throws:
IOException
-
-
Method Details
-
isCurrentVersion
public boolean isCurrentVersion()Description copied from class:AbstractIndex
check the current version against the version we read in- Specified by:
isCurrentVersion
in interfaceIndex
- Overrides:
isCurrentVersion
in classAbstractIndex
- Returns:
- true if we're up to date, false otherwise
-
getType
protected int getType()Description copied from class:AbstractIndex
get the index type- Specified by:
getType
in classAbstractIndex
- Returns:
- The index type
-
getSequenceNames
- Specified by:
getSequenceNames
in interfaceIndex
- Overrides:
getSequenceNames
in classAbstractIndex
- Returns:
- a list of the sequence names we've seen during indexing, in order
-
getChrIndexClass
Description copied from class:AbstractIndex
returns the class for the index type- Specified by:
getChrIndexClass
in classAbstractIndex
- Returns:
- a Class, from which a new instance can be created
-
optimize
Adapative optimization of the linear index- Parameters:
threshold
- threshold to use for optimizing each constituentchrIndex
- Returns:
- The new optimized index
-
optimize
-
writeTable
Code to convert linear index to a text table for analysis- Parameters:
out
- Stream to which to write out table to
-
setTS
protected final void setTS(long ts)
-