Package htsjdk.tribble.index
Class DynamicIndexCreator
java.lang.Object
htsjdk.tribble.index.TribbleIndexCreator
htsjdk.tribble.index.DynamicIndexCreator
- All Implemented Interfaces:
IndexCreator
A DynamicIndexCreator creates the proper index based on an
IndexFactory.IndexBalanceApproach and
the characteristics of the file. Ultimately this is either a LinearIndex or an IntervalTreeIndex, with index
parameters based on whether seek time or file size is to be minimized.-
Field Summary
Fields inherited from class htsjdk.tribble.index.TribbleIndexCreator
properties -
Constructor Summary
ConstructorsConstructorDescriptionDynamicIndexCreator(File inputFile, IndexFactory.IndexBalanceApproach iba) DynamicIndexCreator(Path inputPath, IndexFactory.IndexBalanceApproach iba) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFeature(Feature f, long filePosition) Add a feature to the indexvoidaddProperty(String key, String value) finalizeIndex(long finalFilePosition) Create the index, given the stream of features passed in to this pointprotected static LinkedHashMap<Double, TribbleIndexCreator> scoreIndexes(double densityOfFeatures, Map<IndexFactory.IndexType, TribbleIndexCreator> indexes, int longestFeature, IndexFactory.IndexBalanceApproach iba) score the available indexes for the specified density and feature lengths The scoring method is trying to determine how many features would be returned for a sample one base query; or: (features/seek).Methods inherited from class htsjdk.tribble.index.TribbleIndexCreator
setIndexSequenceDictionary
-
Constructor Details
-
DynamicIndexCreator
-
DynamicIndexCreator
-
-
Method Details
-
finalizeIndex
Description copied from interface:IndexCreatorCreate the index, given the stream of features passed in to this point- Parameters:
finalFilePosition- the final file position, for indexes that have to close out with the final position- Returns:
- an index object
-
addFeature
Description copied from interface:IndexCreatorAdd a feature to the index- Parameters:
f- the feature, of which start, end, and contig must be filled infilePosition- the current file position, at the beginning of the specified feature
-
scoreIndexes
protected static LinkedHashMap<Double,TribbleIndexCreator> scoreIndexes(double densityOfFeatures, Map<IndexFactory.IndexType, TribbleIndexCreator> indexes, int longestFeature, IndexFactory.IndexBalanceApproach iba) score the available indexes for the specified density and feature lengths The scoring method is trying to determine how many features would be returned for a sample one base query; or: (features/seek). For the interval index this is clear: it's the bin size (interval is binned by feature count). for Linear indexes it's the density of features X the number of bins we need to retrieve (which is determined by the bin size X the longest feature).- Parameters:
densityOfFeatures- the density of features (features/base)indexes- Map from IndexType -> IndexCreatorlongestFeature- the longest feature we've foundiba- the index balancing approach- Returns:
- the best index available for the target indexes
-
addProperty
- Overrides:
addPropertyin classTribbleIndexCreator
-