}
}
private void showIndexBins(File bamFile,String contigName) {
SAMFileReader reader;
BAMIndex index;
reader = new SAMFileReader(bamFile);
reader.setValidationStringency(ValidationStringency.SILENT);
reader.enableIndexCaching(true);
index = reader.getIndex();
reader.queryOverlapping(contigName,1,reader.getFileHeader().getSequence(contigName).getSequenceLength()).close();
int numBins = 0;
int numChunks = 0;
int numLinearIndexEntries = 0;
try {
Field[] fields = index.getClass().getDeclaredFields();
for(Field field: fields) {
if(field.getName().equals("mLastReferenceRetrieved")) {
field.setAccessible(true);
Integer lastReferenceRetrieved = (Integer)field.get(index);
System.out.printf("Last reference retrieved: %d%n", lastReferenceRetrieved);