Fixed JIRA GSA-520 for Guillermo: when intervals with zero coverage were present, DiagnoseTargets was trying to merge them with the next interval (even if non-overlapping) which would cause problems later on when it checked to make sure that intervals were strictly overlapping.

This commit is contained in:
Eric Banks 2012-09-07 14:25:57 -04:00
parent ed3d9b050f
commit b1677fc719
1 changed files with 8 additions and 0 deletions

View File

@ -246,6 +246,14 @@ public class DiagnoseTargets extends LocusWalker<Long, Long> {
*/
private void addNewOverlappingIntervals(GenomeLoc refLocus) {
GenomeLoc interval = intervalListIterator.peek();
// skip any intervals with no coverage that we have passed
while (interval != null && interval.isBefore(refLocus)) {
intervalListIterator.next(); // discard the interval (we've already added it to the map)
interval = intervalListIterator.peek();
}
// add any intervals that overlap this one
while (interval != null && !interval.isPast(refLocus)) {
intervalMap.put(interval, createIntervalStatistic(interval));
intervalListIterator.next(); // discard the interval (we've already added it to the map)