Package htsjdk.samtools.cram
Class CRAIIndex
- java.lang.Object
-
- htsjdk.samtools.cram.CRAIIndex
-
public class CRAIIndex extends Object
CRAI index used for CRAM files.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCRAIIndex.CRAIIndexException
-
Field Summary
Fields Modifier and Type Field Description static StringCRAI_INDEX_SUFFIX
-
Constructor Summary
Constructors Constructor Description CRAIIndex()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEntry(CRAIEntry entry)Add a single entry to the CRAI index.static List<CRAIEntry>find(List<CRAIEntry> list, int seqId, int start, int span)static intfindLastAlignedEntry(List<CRAIEntry> list)Find index of the last aligned entry in the list.List<CRAIEntry>getCRAIEntries()static CRAIEntrygetLeftmost(List<CRAIEntry> list)static SeekableStreamopenCraiFileAsBaiStream(File cramIndexFile, SAMSequenceDictionary dictionary)static SeekableStreamopenCraiFileAsBaiStream(InputStream indexStream, SAMSequenceDictionary dictionary)voidprocessContainer(Container c)Create index entries for a single container.voidwriteIndex(OutputStream os)Write out the index to an output stream;
-
-
-
Field Detail
-
CRAI_INDEX_SUFFIX
public static final String CRAI_INDEX_SUFFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
addEntry
public void addEntry(CRAIEntry entry)
Add a single entry to the CRAI index.- Parameters:
entry- entry to be added
-
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 c)
Create index entries for a single container.- Parameters:
c- the container to index
-
openCraiFileAsBaiStream
public static SeekableStream openCraiFileAsBaiStream(File cramIndexFile, SAMSequenceDictionary dictionary) throws IOException
- Throws:
IOException
-
openCraiFileAsBaiStream
public static SeekableStream openCraiFileAsBaiStream(InputStream indexStream, SAMSequenceDictionary dictionary) throws IOException, CRAIIndex.CRAIIndexException
-
findLastAlignedEntry
public static int findLastAlignedEntry(List<CRAIEntry> list)
Find index of the last aligned entry in the list. Assumes the index is sorted by coordinate and unmapped entries (with sequence id = -1) follow the mapped entries.- Parameters:
list- a list of CRAI entries- Returns:
- integer index of the last entry with sequence id not equal to -1
-
-