final GenomeLoc previousInterval = intervalList.peekFirst(); // peekFirst returns null if interval list is empty (WGS).
distance = currentLocus.distanceAcrossContigs(previousLocus, getToolkit().getSAMFileHeader()) - 1;
if (previousInterval != null && !previousInterval.containsP(currentLocus)) {
intervalList.removeFirst(); // we're done with the previous interval
final GenomeLoc currentInterval = intervalList.peekFirst();
distance -= currentInterval.distanceAcrossContigs(previousInterval, getToolkit().getSAMFileHeader()) - 1;
}
}
uncoveredBases += distance;
}