Package htsjdk.samtools.cram

# Class CRAIIndex

java.lang.Object
htsjdk.samtools.cram.CRAIIndex

public class CRAIIndex extends Object
CRAI index used for CRAM files.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`CRAI_INDEX_SUFFIX`
Deprecated.
since June 2019 Use `FileExtensions.CRAM_INDEX` instead.

## Constructor Summary

Constructors
Constructor
Description
`CRAIIndex()`

## Method Summary

Modifier and Type
Method
Description
`void`
`addEntries(Collection<CRAIEntry> toAdd)`
Add multiple entries to the CRAI index.
`void`
`addEntry(CRAIEntry entry)`
Add a single entry to the CRAI index.
`static List<CRAIEntry>`
`find(List<CRAIEntry> list, int seqId, int start, int span)`
Currently unused, but retained for the native rai query implementation
`static int`
`findLastAlignedEntry(List<CRAIEntry> list)`
Currently unused, but retained for the native rai query implementation
`List<CRAIEntry>`
`getCRAIEntries()`
`static CRAIEntry`
`getLeftmost(List<CRAIEntry> list)`
Currently unused, but retained for the native rai query implementation
`static SeekableStream`
`openCraiFileAsBaiStream(File cramIndexFile, SAMSequenceDictionary dictionary)`
`static SeekableStream`
`openCraiFileAsBaiStream(InputStream indexStream, SAMSequenceDictionary dictionary)`
`void`
`processContainer(Container container)`
Create index entries for a single container.
`void`
`writeIndex(OutputStream os)`
Write out the index to an output stream;

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### CRAI_INDEX_SUFFIX

@Deprecated public static final String CRAI_INDEX_SUFFIX
Deprecated.
since June 2019 Use `FileExtensions.CRAM_INDEX` instead.

See Also:
  - Constant Field Values

## Constructor Details

### CRAIIndex

public CRAIIndex()

## Method Details

### addEntry

public void addEntry(CRAIEntry entry)
Add a single entry to the CRAI index.

Parameters:
  `entry` - entry to be added

### addEntries

public void addEntries(Collection<CRAIEntry> toAdd)
Add multiple entries to the CRAI index.

Parameters:
  `toAdd` - entries to be added

### getCRAIEntries

public List<CRAIEntry> getCRAIEntries()

### writeIndex

public void writeIndex(OutputStream os)
Write out the index to an output stream;

Parameters:
  `os` - Stream to write index to

### processContainer

public void processContainer(Container container)
Create index entries for a single container.

Parameters:
  `container` - the container to index

### openCraiFileAsBaiStream

public static SeekableStream openCraiFileAsBaiStream(File cramIndexFile, SAMSequenceDictionary dictionary)

### openCraiFileAsBaiStream

public static SeekableStream openCraiFileAsBaiStream(InputStream indexStream, SAMSequenceDictionary dictionary)

### find

public static List<CRAIEntry> find(List<CRAIEntry> list, int seqId, int start, int span)
Currently unused, but retained for the native rai query implementation

### getLeftmost

public static CRAIEntry getLeftmost(List<CRAIEntry> list)
Currently unused, but retained for the native rai query implementation

### findLastAlignedEntry

public static int findLastAlignedEntry(List<CRAIEntry> list)
Currently unused, but retained for the native rai query implementation