IOUtil.assertFileIsReadable(inputFile);
bam = new SAMFileReader(inputFile);
}
if (!bam.isBinary()) {
throw new SAMException("Input file must be bam file, not sam file.");
}
if (!bam.getFileHeader().getSortOrder().equals(SAMFileHeader.SortOrder.coordinate)) {
throw new SAMException("Input bam file must be sorted by coordinates");
}
BAMIndexer.createIndex(bam, OUTPUT);
log.info("Successfully wrote bam index file " + OUTPUT);