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
Nested ClassesModifier and TypeClassDescriptionstatic classBlocks are organized as a simple flat list:Nested classes/interfaces inherited from class htsjdk.tribble.index.AbstractIndex
AbstractIndex.BlockStats, AbstractIndex.IndexType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanstatic final intstatic final doubleFields inherited from class htsjdk.tribble.index.AbstractIndex
chrIndices, flags, indexedFileMD5, indexedFileSize, indexedFileTS, indexedPath, logger, MAGIC_NUMBER, version, VERSION -
Constructor Summary
ConstructorsConstructorDescriptionLinearIndex(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 specifiedindicesLinearIndex(List<LinearIndex.ChrIndex> indices, Path featureFile) Initialize using the specifiedindices -
Method Summary
Modifier and TypeMethodDescriptionreturns the class for the index typeprotected intgetType()get the index typebooleancheck the current version against the version we read inoptimize()optimize(double threshold) Adapative optimization of the linear indexprotected final voidsetTS(long ts) voidwriteTable(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, writeBasedOnFeaturePathMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:AbstractIndexcheck the current version against the version we read in- Specified by:
isCurrentVersionin interfaceIndex- Overrides:
isCurrentVersionin classAbstractIndex- Returns:
- true if we're up to date, false otherwise
-
getType
protected int getType()Description copied from class:AbstractIndexget the index type- Specified by:
getTypein classAbstractIndex- Returns:
- The index type
-
getSequenceNames
- Specified by:
getSequenceNamesin interfaceIndex- Overrides:
getSequenceNamesin classAbstractIndex- Returns:
- a list of the sequence names we've seen during indexing, in order
-
getChrIndexClass
Description copied from class:AbstractIndexreturns the class for the index type- Specified by:
getChrIndexClassin 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)
-