Package htsjdk.tribble.index
Interface Index
- All Known Subinterfaces:
MutableIndex
- All Known Implementing Classes:
AbstractIndex
,IntervalTreeIndex
,LinearIndex
,TabixIndex
public interface Index
Interface for all index implementations.
An index file is used for efficient lookup of features from a feature file;
and Index represents that index file.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
containsChromosome
(String chr) boolean
Returns true if this and obj are 'effectively' equivalent indices.Query the index.boolean
void
write
(LittleEndianOutputStream stream) all indexes are writable to diskdefault void
Writes the index into a file.void
Writes the index into a path.default void
writeBasedOnFeatureFile
(File featureFile) Write an appropriately named and located Index file based on the name and location of the featureFile.void
writeBasedOnFeaturePath
(Path featurePath) Write an appropriately named and located Index file based on the name and location of the featureFile.
-
Method Details
-
getBlocks
Query the index.- Parameters:
chr
- the chromosomestart
- the start positionend
- the end position- Returns:
- a list of blocks that contain the specified interval. Can never return null
- Throws:
IllegalArgumentException
- of chr isn't part of this index
-
isCurrentVersion
boolean isCurrentVersion()- Returns:
- true if the index is up to date, false otherwise
-
getSequenceNames
- Returns:
- a list of the sequence names we've seen during indexing, in order
-
containsChromosome
- Parameters:
chr
- the chromosome (or contig) name- Returns:
- true if we have an entry; false otherwise
-
write
all indexes are writable to disk- Parameters:
stream
- the stream to write the index to. Caller must close after invocation.- Throws:
IOException
- if the index is unable to write to the specified location
-
write
Writes the index into a file. Default implementation delegates towrite(Path)
- Parameters:
idxFile
- Where to write the index.- Throws:
IOException
- if the index is unable to write to the specified file
-
write
Writes the index into a path.- Parameters:
indexPath
- Where to write the index.- Throws:
IOException
- if the index is unable to write to the specified path.
-
writeBasedOnFeatureFile
Write an appropriately named and located Index file based on the name and location of the featureFile. Default implementation delegates towriteBasedOnFeaturePath(Path)
- Parameters:
featureFile
-- Throws:
IOException
- if featureFile is not a normal file.
-
writeBasedOnFeaturePath
Write an appropriately named and located Index file based on the name and location of the featureFile. If featureFile is not a normal file, the index will silently not be written.- Parameters:
featurePath
-- Throws:
IOException
- if featureFile is not a normal file.
-
getProperties
- Returns:
- get the list of properties for this index. Returns null if no properties.
-
equalsIgnoreProperties
Returns true if this and obj are 'effectively' equivalent indices. Ignores the time stamp on the file, as this may not be the same for even identical indices- Parameters:
obj
-- Returns:
-