"CRAM index is not compatible with BAM files.");
SAMFileReader reader = new SAMFileReader(params.inputFile);
if (!reader.isBinary()) {
reader.close();
throw new SAMException(
"Input file must be bam file, not sam file.");
}
if (!reader.getFileHeader().getSortOrder()
.equals(SAMFileHeader.SortOrder.coordinate)) {
reader.close();
throw new SAMException(
"Input bam file must be sorted by coordinates");
}
File indexFile = new File(params.inputFile.getAbsolutePath()
+ ".bai");