for (int i = 0; i < container.slices.length; i++) {
Slice s = container.slices[i];
List<CramRecord> list = BLOCK_PROTO.getRecords(s, container.h,
cramHeader.samFileHeader, new TreeMap<String, Long>());
CramRecord first = list.get(0);
CramRecord last = list.get(list.size() - 1);
assertEquals(s.alignmentStart, first.getAlignmentStart());
int end = last.calcualteAlignmentEnd();
System.out.println(end);
if (s.alignmentSpan != last.calcualteAlignmentEnd()
- first.getAlignmentStart())
fail(String
.format("Slice %d alignment span mismatch: %d, %d, %d, %d, %d, %s, %s\n",
i, s.alignmentStart, s.alignmentSpan,
first.getAlignmentStart(),
last.getAlignmentStart(),
last.calcualteAlignmentEnd(),
first.getReadName(), last.getReadName()));
}
}
CramRecord firstRecord1 = records.get(0);
CramRecord lastRecord1 = records.get(records.size() - 1);
assertEquals(container.alignmentStart, firstRecord1.getAlignmentStart());
if (container.alignmentSpan != lastRecord1.calcualteAlignmentEnd()
- firstRecord1.getAlignmentStart())
fail(String
.format("Container alignment span mismatch: %d, %d, %d, %d, %d, %s, %s\n",
container.alignmentStart, container.alignmentSpan,
firstRecord1.getAlignmentStart(),
lastRecord1.getAlignmentStart(),
lastRecord1.calcualteAlignmentEnd(),
firstRecord1.getReadName(),
lastRecord1.getReadName()));
}