Merge branch 'master' of github.com:broadinstitute/gsa-unstable
This commit is contained in:
commit
3355216366
|
|
@ -109,12 +109,16 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
dictionary = reference.getSequenceDictionary();
|
dictionary = reference.getSequenceDictionary();
|
||||||
genomeLocParser = new GenomeLocParser(dictionary);
|
genomeLocParser = new GenomeLocParser(dictionary);
|
||||||
|
|
||||||
|
// TODO: test shard boundaries
|
||||||
|
|
||||||
intervals = new ArrayList<GenomeLoc>();
|
intervals = new ArrayList<GenomeLoc>();
|
||||||
intervals.add(genomeLocParser.createGenomeLoc("1", 10, 20));
|
intervals.add(genomeLocParser.createGenomeLoc("1", 10, 20));
|
||||||
intervals.add(genomeLocParser.createGenomeLoc("1", 1, 999));
|
intervals.add(genomeLocParser.createGenomeLoc("1", 1, 999));
|
||||||
intervals.add(genomeLocParser.createGenomeLoc("1", 1000, 1999));
|
intervals.add(genomeLocParser.createGenomeLoc("1", 1000, 1999));
|
||||||
intervals.add(genomeLocParser.createGenomeLoc("1", 2000, 2999));
|
intervals.add(genomeLocParser.createGenomeLoc("1", 2000, 2999));
|
||||||
intervals.add(genomeLocParser.createGenomeLoc("1", 10000, 20000));
|
intervals.add(genomeLocParser.createGenomeLoc("1", 10000, 20000));
|
||||||
|
intervals.add(genomeLocParser.createGenomeLoc("1", 249250600, 249250621));
|
||||||
|
intervals.add(genomeLocParser.createGenomeLoc("2", 1, 100));
|
||||||
intervals.add(genomeLocParser.createGenomeLoc("20", 10000, 10100));
|
intervals.add(genomeLocParser.createGenomeLoc("20", 10000, 10100));
|
||||||
intervals = IntervalUtils.sortAndMergeIntervals(genomeLocParser, intervals, IntervalMergingRule.OVERLAPPING_ONLY).toList();
|
intervals = IntervalUtils.sortAndMergeIntervals(genomeLocParser, intervals, IntervalMergingRule.OVERLAPPING_ONLY).toList();
|
||||||
|
|
||||||
|
|
@ -126,6 +130,7 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
reads.add(buildSAMRecord("boundary_unequal", "1", 1990, 2008));
|
reads.add(buildSAMRecord("boundary_unequal", "1", 1990, 2008));
|
||||||
reads.add(buildSAMRecord("extended_and_np", "1", 990, 1990));
|
reads.add(buildSAMRecord("extended_and_np", "1", 990, 1990));
|
||||||
reads.add(buildSAMRecord("outside_intervals", "1", 5000, 6000));
|
reads.add(buildSAMRecord("outside_intervals", "1", 5000, 6000));
|
||||||
|
reads.add(buildSAMRecord("end_of_chr1", "1", 249250600, 249250700));
|
||||||
reads.add(buildSAMRecord("simple20", "20", 10025, 10075));
|
reads.add(buildSAMRecord("simple20", "20", 10025, 10075));
|
||||||
|
|
||||||
// required by LocusIteratorByState, and I prefer to list them in test case order above
|
// required by LocusIteratorByState, and I prefer to list them in test case order above
|
||||||
|
|
@ -139,8 +144,6 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
List<GenomeLoc> activeIntervals = getIsActiveIntervals(walker, intervals);
|
List<GenomeLoc> activeIntervals = getIsActiveIntervals(walker, intervals);
|
||||||
// Contract: Every genome position in the analysis interval(s) is processed by the walker's isActive() call
|
// Contract: Every genome position in the analysis interval(s) is processed by the walker's isActive() call
|
||||||
verifyEqualIntervals(intervals, activeIntervals);
|
verifyEqualIntervals(intervals, activeIntervals);
|
||||||
|
|
||||||
// TODO: more tests and edge cases
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<GenomeLoc> getIsActiveIntervals(DummyActiveRegionWalker walker, List<GenomeLoc> intervals) {
|
private List<GenomeLoc> getIsActiveIntervals(DummyActiveRegionWalker walker, List<GenomeLoc> intervals) {
|
||||||
|
|
@ -171,8 +174,6 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
|
|
||||||
Collection<ActiveRegion> activeRegions = getActiveRegions(walker, intervals).values();
|
Collection<ActiveRegion> activeRegions = getActiveRegions(walker, intervals).values();
|
||||||
verifyActiveRegionCoverage(intervals, activeRegions);
|
verifyActiveRegionCoverage(intervals, activeRegions);
|
||||||
|
|
||||||
// TODO: more tests and edge cases
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void verifyActiveRegionCoverage(List<GenomeLoc> intervals, Collection<ActiveRegion> activeRegions) {
|
private void verifyActiveRegionCoverage(List<GenomeLoc> intervals, Collection<ActiveRegion> activeRegions) {
|
||||||
|
|
@ -231,6 +232,7 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
// boundary_unequal: Primary in 1:1000-1999, Non-Primary in 1:2000-2999
|
// boundary_unequal: Primary in 1:1000-1999, Non-Primary in 1:2000-2999
|
||||||
// extended_and_np: Non-Primary in 1:1-999, Primary in 1:1000-1999, Extended in 1:2000-2999
|
// extended_and_np: Non-Primary in 1:1-999, Primary in 1:1000-1999, Extended in 1:2000-2999
|
||||||
// outside_intervals: none
|
// outside_intervals: none
|
||||||
|
// end_of_chr1: Primary in 1:249250600-249250621
|
||||||
// simple20: Primary in 20:10000-10100
|
// simple20: Primary in 20:10000-10100
|
||||||
|
|
||||||
Map<GenomeLoc, ActiveRegion> activeRegions = getActiveRegions(walker, intervals);
|
Map<GenomeLoc, ActiveRegion> activeRegions = getActiveRegions(walker, intervals);
|
||||||
|
|
@ -245,6 +247,7 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
verifyReadNotPlaced(region, "boundary_unequal");
|
verifyReadNotPlaced(region, "boundary_unequal");
|
||||||
verifyReadNotPlaced(region, "extended_and_np");
|
verifyReadNotPlaced(region, "extended_and_np");
|
||||||
verifyReadNotPlaced(region, "outside_intervals");
|
verifyReadNotPlaced(region, "outside_intervals");
|
||||||
|
verifyReadNotPlaced(region, "end_of_chr1");
|
||||||
verifyReadNotPlaced(region, "simple20");
|
verifyReadNotPlaced(region, "simple20");
|
||||||
|
|
||||||
region = activeRegions.get(genomeLocParser.createGenomeLoc("1", 1000, 1999));
|
region = activeRegions.get(genomeLocParser.createGenomeLoc("1", 1000, 1999));
|
||||||
|
|
@ -256,6 +259,7 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
getRead(region, "boundary_unequal");
|
getRead(region, "boundary_unequal");
|
||||||
getRead(region, "extended_and_np");
|
getRead(region, "extended_and_np");
|
||||||
verifyReadNotPlaced(region, "outside_intervals");
|
verifyReadNotPlaced(region, "outside_intervals");
|
||||||
|
verifyReadNotPlaced(region, "end_of_chr1");
|
||||||
verifyReadNotPlaced(region, "simple20");
|
verifyReadNotPlaced(region, "simple20");
|
||||||
|
|
||||||
region = activeRegions.get(genomeLocParser.createGenomeLoc("1", 2000, 2999));
|
region = activeRegions.get(genomeLocParser.createGenomeLoc("1", 2000, 2999));
|
||||||
|
|
@ -267,6 +271,19 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
verifyReadNotPlaced(region, "boundary_unequal");
|
verifyReadNotPlaced(region, "boundary_unequal");
|
||||||
verifyReadNotPlaced(region, "extended_and_np");
|
verifyReadNotPlaced(region, "extended_and_np");
|
||||||
verifyReadNotPlaced(region, "outside_intervals");
|
verifyReadNotPlaced(region, "outside_intervals");
|
||||||
|
verifyReadNotPlaced(region, "end_of_chr1");
|
||||||
|
verifyReadNotPlaced(region, "simple20");
|
||||||
|
|
||||||
|
region = activeRegions.get(genomeLocParser.createGenomeLoc("1", 249250600, 249250621));
|
||||||
|
|
||||||
|
verifyReadNotPlaced(region, "simple");
|
||||||
|
verifyReadNotPlaced(region, "overlap_equal");
|
||||||
|
verifyReadNotPlaced(region, "overlap_unequal");
|
||||||
|
verifyReadNotPlaced(region, "boundary_equal");
|
||||||
|
verifyReadNotPlaced(region, "boundary_unequal");
|
||||||
|
verifyReadNotPlaced(region, "extended_and_np");
|
||||||
|
verifyReadNotPlaced(region, "outside_intervals");
|
||||||
|
getRead(region, "end_of_chr1");
|
||||||
verifyReadNotPlaced(region, "simple20");
|
verifyReadNotPlaced(region, "simple20");
|
||||||
|
|
||||||
region = activeRegions.get(genomeLocParser.createGenomeLoc("20", 10000, 10100));
|
region = activeRegions.get(genomeLocParser.createGenomeLoc("20", 10000, 10100));
|
||||||
|
|
@ -278,9 +295,8 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
verifyReadNotPlaced(region, "boundary_unequal");
|
verifyReadNotPlaced(region, "boundary_unequal");
|
||||||
verifyReadNotPlaced(region, "extended_and_np");
|
verifyReadNotPlaced(region, "extended_and_np");
|
||||||
verifyReadNotPlaced(region, "outside_intervals");
|
verifyReadNotPlaced(region, "outside_intervals");
|
||||||
|
verifyReadNotPlaced(region, "end_of_chr1");
|
||||||
getRead(region, "simple20");
|
getRead(region, "simple20");
|
||||||
|
|
||||||
// TODO: more tests and edge cases
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -300,6 +316,7 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
// boundary_unequal: Primary in 1:1000-1999, Non-Primary in 1:2000-2999
|
// boundary_unequal: Primary in 1:1000-1999, Non-Primary in 1:2000-2999
|
||||||
// extended_and_np: Non-Primary in 1:1-999, Primary in 1:1000-1999, Extended in 1:2000-2999
|
// extended_and_np: Non-Primary in 1:1-999, Primary in 1:1000-1999, Extended in 1:2000-2999
|
||||||
// outside_intervals: none
|
// outside_intervals: none
|
||||||
|
// end_of_chr1: Primary in 1:249250600-249250621
|
||||||
// simple20: Primary in 20:10000-10100
|
// simple20: Primary in 20:10000-10100
|
||||||
|
|
||||||
Map<GenomeLoc, ActiveRegion> activeRegions = getActiveRegions(walker, intervals);
|
Map<GenomeLoc, ActiveRegion> activeRegions = getActiveRegions(walker, intervals);
|
||||||
|
|
@ -314,6 +331,7 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
verifyReadNotPlaced(region, "boundary_unequal");
|
verifyReadNotPlaced(region, "boundary_unequal");
|
||||||
getRead(region, "extended_and_np");
|
getRead(region, "extended_and_np");
|
||||||
verifyReadNotPlaced(region, "outside_intervals");
|
verifyReadNotPlaced(region, "outside_intervals");
|
||||||
|
verifyReadNotPlaced(region, "end_of_chr1");
|
||||||
verifyReadNotPlaced(region, "simple20");
|
verifyReadNotPlaced(region, "simple20");
|
||||||
|
|
||||||
region = activeRegions.get(genomeLocParser.createGenomeLoc("1", 1000, 1999));
|
region = activeRegions.get(genomeLocParser.createGenomeLoc("1", 1000, 1999));
|
||||||
|
|
@ -325,6 +343,7 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
getRead(region, "boundary_unequal");
|
getRead(region, "boundary_unequal");
|
||||||
getRead(region, "extended_and_np");
|
getRead(region, "extended_and_np");
|
||||||
verifyReadNotPlaced(region, "outside_intervals");
|
verifyReadNotPlaced(region, "outside_intervals");
|
||||||
|
verifyReadNotPlaced(region, "end_of_chr1");
|
||||||
verifyReadNotPlaced(region, "simple20");
|
verifyReadNotPlaced(region, "simple20");
|
||||||
|
|
||||||
region = activeRegions.get(genomeLocParser.createGenomeLoc("1", 2000, 2999));
|
region = activeRegions.get(genomeLocParser.createGenomeLoc("1", 2000, 2999));
|
||||||
|
|
@ -336,6 +355,19 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
getRead(region, "boundary_unequal");
|
getRead(region, "boundary_unequal");
|
||||||
verifyReadNotPlaced(region, "extended_and_np");
|
verifyReadNotPlaced(region, "extended_and_np");
|
||||||
verifyReadNotPlaced(region, "outside_intervals");
|
verifyReadNotPlaced(region, "outside_intervals");
|
||||||
|
verifyReadNotPlaced(region, "end_of_chr1");
|
||||||
|
verifyReadNotPlaced(region, "simple20");
|
||||||
|
|
||||||
|
region = activeRegions.get(genomeLocParser.createGenomeLoc("1", 249250600, 249250621));
|
||||||
|
|
||||||
|
verifyReadNotPlaced(region, "simple");
|
||||||
|
verifyReadNotPlaced(region, "overlap_equal");
|
||||||
|
verifyReadNotPlaced(region, "overlap_unequal");
|
||||||
|
verifyReadNotPlaced(region, "boundary_equal");
|
||||||
|
verifyReadNotPlaced(region, "boundary_unequal");
|
||||||
|
verifyReadNotPlaced(region, "extended_and_np");
|
||||||
|
verifyReadNotPlaced(region, "outside_intervals");
|
||||||
|
getRead(region, "end_of_chr1");
|
||||||
verifyReadNotPlaced(region, "simple20");
|
verifyReadNotPlaced(region, "simple20");
|
||||||
|
|
||||||
region = activeRegions.get(genomeLocParser.createGenomeLoc("20", 10000, 10100));
|
region = activeRegions.get(genomeLocParser.createGenomeLoc("20", 10000, 10100));
|
||||||
|
|
@ -347,9 +379,8 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
verifyReadNotPlaced(region, "boundary_unequal");
|
verifyReadNotPlaced(region, "boundary_unequal");
|
||||||
verifyReadNotPlaced(region, "extended_and_np");
|
verifyReadNotPlaced(region, "extended_and_np");
|
||||||
verifyReadNotPlaced(region, "outside_intervals");
|
verifyReadNotPlaced(region, "outside_intervals");
|
||||||
|
verifyReadNotPlaced(region, "end_of_chr1");
|
||||||
getRead(region, "simple20");
|
getRead(region, "simple20");
|
||||||
|
|
||||||
// TODO: more tests and edge cases
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -370,6 +401,7 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
// boundary_unequal: Primary in 1:1000-1999, Non-Primary in 1:2000-2999
|
// boundary_unequal: Primary in 1:1000-1999, Non-Primary in 1:2000-2999
|
||||||
// extended_and_np: Non-Primary in 1:1-999, Primary in 1:1000-1999, Extended in 1:2000-2999
|
// extended_and_np: Non-Primary in 1:1-999, Primary in 1:1000-1999, Extended in 1:2000-2999
|
||||||
// outside_intervals: none
|
// outside_intervals: none
|
||||||
|
// end_of_chr1: Primary in 1:249250600-249250621
|
||||||
// simple20: Primary in 20:10000-10100
|
// simple20: Primary in 20:10000-10100
|
||||||
|
|
||||||
Map<GenomeLoc, ActiveRegion> activeRegions = getActiveRegions(walker, intervals);
|
Map<GenomeLoc, ActiveRegion> activeRegions = getActiveRegions(walker, intervals);
|
||||||
|
|
@ -384,6 +416,7 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
verifyReadNotPlaced(region, "boundary_unequal");
|
verifyReadNotPlaced(region, "boundary_unequal");
|
||||||
getRead(region, "extended_and_np");
|
getRead(region, "extended_and_np");
|
||||||
verifyReadNotPlaced(region, "outside_intervals");
|
verifyReadNotPlaced(region, "outside_intervals");
|
||||||
|
verifyReadNotPlaced(region, "end_of_chr1");
|
||||||
verifyReadNotPlaced(region, "simple20");
|
verifyReadNotPlaced(region, "simple20");
|
||||||
|
|
||||||
region = activeRegions.get(genomeLocParser.createGenomeLoc("1", 1000, 1999));
|
region = activeRegions.get(genomeLocParser.createGenomeLoc("1", 1000, 1999));
|
||||||
|
|
@ -395,6 +428,7 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
getRead(region, "boundary_unequal");
|
getRead(region, "boundary_unequal");
|
||||||
getRead(region, "extended_and_np");
|
getRead(region, "extended_and_np");
|
||||||
verifyReadNotPlaced(region, "outside_intervals");
|
verifyReadNotPlaced(region, "outside_intervals");
|
||||||
|
verifyReadNotPlaced(region, "end_of_chr1");
|
||||||
verifyReadNotPlaced(region, "simple20");
|
verifyReadNotPlaced(region, "simple20");
|
||||||
|
|
||||||
region = activeRegions.get(genomeLocParser.createGenomeLoc("1", 2000, 2999));
|
region = activeRegions.get(genomeLocParser.createGenomeLoc("1", 2000, 2999));
|
||||||
|
|
@ -406,6 +440,19 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
getRead(region, "boundary_unequal");
|
getRead(region, "boundary_unequal");
|
||||||
getRead(region, "extended_and_np");
|
getRead(region, "extended_and_np");
|
||||||
verifyReadNotPlaced(region, "outside_intervals");
|
verifyReadNotPlaced(region, "outside_intervals");
|
||||||
|
verifyReadNotPlaced(region, "end_of_chr1");
|
||||||
|
verifyReadNotPlaced(region, "simple20");
|
||||||
|
|
||||||
|
region = activeRegions.get(genomeLocParser.createGenomeLoc("1", 249250600, 249250621));
|
||||||
|
|
||||||
|
verifyReadNotPlaced(region, "simple");
|
||||||
|
verifyReadNotPlaced(region, "overlap_equal");
|
||||||
|
verifyReadNotPlaced(region, "overlap_unequal");
|
||||||
|
verifyReadNotPlaced(region, "boundary_equal");
|
||||||
|
verifyReadNotPlaced(region, "boundary_unequal");
|
||||||
|
verifyReadNotPlaced(region, "extended_and_np");
|
||||||
|
verifyReadNotPlaced(region, "outside_intervals");
|
||||||
|
getRead(region, "end_of_chr1");
|
||||||
verifyReadNotPlaced(region, "simple20");
|
verifyReadNotPlaced(region, "simple20");
|
||||||
|
|
||||||
region = activeRegions.get(genomeLocParser.createGenomeLoc("20", 10000, 10100));
|
region = activeRegions.get(genomeLocParser.createGenomeLoc("20", 10000, 10100));
|
||||||
|
|
@ -417,9 +464,13 @@ public class TraverseActiveRegionsTest extends BaseTest {
|
||||||
verifyReadNotPlaced(region, "boundary_unequal");
|
verifyReadNotPlaced(region, "boundary_unequal");
|
||||||
verifyReadNotPlaced(region, "extended_and_np");
|
verifyReadNotPlaced(region, "extended_and_np");
|
||||||
verifyReadNotPlaced(region, "outside_intervals");
|
verifyReadNotPlaced(region, "outside_intervals");
|
||||||
|
verifyReadNotPlaced(region, "end_of_chr1");
|
||||||
getRead(region, "simple20");
|
getRead(region, "simple20");
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: more tests and edge cases
|
@Test
|
||||||
|
public void testUnmappedReads() {
|
||||||
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
private void verifyReadNotPlaced(ActiveRegion region, String readName) {
|
private void verifyReadNotPlaced(ActiveRegion region, String readName) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package org.broadinstitute.sting.gatk.walkers;
|
||||||
|
|
||||||
|
import org.broadinstitute.sting.WalkerTest;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class PrintReadsLargeScaleTest extends WalkerTest {
|
||||||
|
@Test( timeOut = 1000 * 60 * 60 * 20 ) // 60 seconds * 60 seconds / minute * 20 minutes
|
||||||
|
public void testRealignerTargetCreator() {
|
||||||
|
WalkerTestSpec spec = new WalkerTestSpec(
|
||||||
|
"-R " + b37KGReference +
|
||||||
|
" -T PrintReads" +
|
||||||
|
" -I " + evaluationDataLocation + "CEUTrio.HiSeq.WEx.b37.NA12892.clean.dedup.recal.1.bam" +
|
||||||
|
" -o /dev/null",
|
||||||
|
0,
|
||||||
|
new ArrayList<String>(0));
|
||||||
|
executeTest("testPrintReadsWholeExomeChr1", spec);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue