public class BAMIndexer extends Object
Constructor | Description |
---|---|
BAMIndexer(File output,
SAMFileHeader fileHeader) |
|
BAMIndexer(OutputStream output,
SAMFileHeader fileHeader) |
Prepare to index a BAM.
|
BAMIndexer(Path output,
SAMFileHeader fileHeader) |
Modifier and Type | Method | Description |
---|---|---|
static void |
createAndWriteIndex(File input,
File output,
boolean textOutput) |
Generates a BAM index file, either textual or binary, from an input BAI file.
|
static void |
createIndex(SamReader reader,
File output) |
Generates a BAM index file from an input BAM file
|
static void |
createIndex(SamReader reader,
File output,
Log log) |
Generates a BAM index file from an input BAM file
|
static void |
createIndex(SamReader reader,
Path output) |
Generates a BAM index file from an input BAM file
|
static void |
createIndex(SamReader reader,
Path output,
Log log) |
Generates a BAM index file from an input BAM file
|
void |
finish() |
After all the alignment records have been processed, finish is called.
|
void |
processAlignment(SAMRecord rec) |
Record any index information for a given BAM record.
|
public BAMIndexer(Path output, SAMFileHeader fileHeader)
output
- binary BAM Index (.bai) filefileHeader
- header for the corresponding bam filepublic BAMIndexer(File output, SAMFileHeader fileHeader)
output
- binary BAM Index (.bai) filefileHeader
- header for the corresponding bam filepublic BAMIndexer(OutputStream output, SAMFileHeader fileHeader)
output
- Index will be written here. output will be closed when finish() method is called.fileHeader
- header for the corresponding bam file.public void processAlignment(SAMRecord rec)
rec
- The BAM recordpublic void finish()
public static void createAndWriteIndex(File input, File output, boolean textOutput)
output
- BAM Index (.bai) file (or bai.txt file when text)textOutput
- Whether to create text output or binarypublic static void createIndex(SamReader reader, Path output)
reader
- SamReader for input BAM fileoutput
- Path for output index filepublic static void createIndex(SamReader reader, File output)
reader
- SamReader for input BAM fileoutput
- File for output index filepublic static void createIndex(SamReader reader, Path output, Log log)
reader
- SamReader for input BAM fileoutput
- Path for output index file