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:
commit
e7a8e6e8ee
|
|
@ -98,6 +98,7 @@ public final class IntervalBinding<T extends Feature> {
|
||||||
intervals = IntervalUtils.parseIntervalArguments(genomeLocParser, stringIntervals);
|
intervals = IntervalUtils.parseIntervalArguments(genomeLocParser, stringIntervals);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Collections.sort(intervals);
|
||||||
return intervals;
|
return intervals;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -285,4 +285,20 @@ public class IntervalIntegrationTest extends WalkerTest {
|
||||||
Arrays.asList(md5));
|
Arrays.asList(md5));
|
||||||
executeTest("testSymbolicAlleles", spec);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue