Merge pull request #140 from broadinstitute/dr_interval_intersection_bug_GSA-909

Intervals: fix bug where we could fail to find the intersection of unsorted/missorted interval lists
This commit is contained in:
Mark DePristo 2013-04-02 11:59:01 -07:00
commit e7a8e6e8ee
2 changed files with 17 additions and 0 deletions

View File

@ -98,6 +98,7 @@ public final class IntervalBinding<T extends Feature> {
intervals = IntervalUtils.parseIntervalArguments(genomeLocParser, stringIntervals);
}
Collections.sort(intervals);
return intervals;
}

View File

@ -285,4 +285,20 @@ public class IntervalIntegrationTest extends WalkerTest {
Arrays.asList(md5));
executeTest("testSymbolicAlleles", spec);
}
@Test
public void testIntersectionOfLexicographicallySortedIntervals() {
final String md5 = "18be9375e5a753f766616a51eb6131f0";
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
" -T CountLoci" +
" -I " + privateTestDir + "NA12878.4.snippet.bam" +
" -R " + b37KGReference +
" -L " + privateTestDir + "lexicographicallySortedIntervals.bed" +
" -L 4" +
" -isr INTERSECTION" +
" -o %s",
1, // just one output file
Arrays.asList(md5));
executeTest("testIntersectionOfLexicographicallySortedIntervals", spec);
}
}