Package htsjdk.samtools
Interface SamReader.Indexing
- All Known Implementing Classes:
CRAMFileReader
,SamReader.PrimitiveSamReaderToSamReaderAdapter
,SRAFileReader
- Enclosing interface:
- SamReader
public static interface SamReader.Indexing
Facet for index-related operations.
-
Method Summary
Modifier and TypeMethodDescriptionGets an index tagged with the BrowseableBAMIndex interface.Gets a pointer spanning all reads in the BAM file.getIndex()
Retrieves the index for the given file type.boolean
Returns true if the supported index is browseable, meaning the bins in it can be traversed and chunk data inspected and retrieved.iterator
(SAMFileSpan chunks) Iterate through the given chunks in the file.
-
Method Details
-
getIndex
BAMIndex getIndex()Retrieves the index for the given file type. Ensure that the index is of the specified type.- Returns:
- An index of the given type.
-
hasBrowseableIndex
boolean hasBrowseableIndex()Returns true if the supported index is browseable, meaning the bins in it can be traversed and chunk data inspected and retrieved.- Returns:
- True if the index supports the BrowseableBAMIndex interface. False otherwise.
-
getBrowseableIndex
BrowseableBAMIndex getBrowseableIndex()Gets an index tagged with the BrowseableBAMIndex interface. Throws an exception if no such index is available.- Returns:
- An index with a browseable interface, if possible.
- Throws:
SAMException
- if no such index is available.
-
iterator
Iterate through the given chunks in the file.- Parameters:
chunks
- List of chunks for which to retrieve data.- Returns:
- An iterator over the given chunks.
-
getFilePointerSpanningReads
SAMFileSpan getFilePointerSpanningReads()Gets a pointer spanning all reads in the BAM file.- Returns:
- Unbounded pointer to the first record, in chunk format.
-