From 0a16519aa2591050e28a3dd871664cf9844a0207 Mon Sep 17 00:00:00 2001 From: aaron Date: Thu, 25 Jun 2009 18:30:32 +0000 Subject: [PATCH] a couple of additions to the tests, plus a change to the artificial resource pool to support the queryContained flag git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1099 348d0f76-0448-11de-a6fe-93d51630548a --- .../simpleDataSources/ArtificialResourcePool.java | 6 +++++- .../datasources/simpleDataSources/SAMByIntervalTest.java | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/java/test/org/broadinstitute/sting/gatk/datasources/simpleDataSources/ArtificialResourcePool.java b/java/test/org/broadinstitute/sting/gatk/datasources/simpleDataSources/ArtificialResourcePool.java index 452502592..c79b7eab9 100644 --- a/java/test/org/broadinstitute/sting/gatk/datasources/simpleDataSources/ArtificialResourcePool.java +++ b/java/test/org/broadinstitute/sting/gatk/datasources/simpleDataSources/ArtificialResourcePool.java @@ -68,7 +68,11 @@ public class ArtificialResourcePool extends SAMIteratorPool { if (segment instanceof MappedStreamSegment && iterator instanceof ArtificialSAMQueryIterator) { ArtificialSAMQueryIterator queryIterator = (ArtificialSAMQueryIterator)iterator; MappedStreamSegment mappedSegment = (MappedStreamSegment)segment; - queryIterator.queryContained(mappedSegment.locus.getContig(), (int)mappedSegment.locus.getStart(), (int)mappedSegment.locus.getStop()); + if (!this.queryOverlapping) { + queryIterator.queryContained(mappedSegment.locus.getContig(), (int)mappedSegment.locus.getStart(), (int)mappedSegment.locus.getStop()); + } else { + queryIterator.queryOverlapping(mappedSegment.locus.getContig(), (int)mappedSegment.locus.getStart(), (int)mappedSegment.locus.getStop()); + } return queryIterator; } else if (segment instanceof UnmappedStreamSegment) { diff --git a/java/test/org/broadinstitute/sting/gatk/datasources/simpleDataSources/SAMByIntervalTest.java b/java/test/org/broadinstitute/sting/gatk/datasources/simpleDataSources/SAMByIntervalTest.java index 520594ae7..ff86c771f 100644 --- a/java/test/org/broadinstitute/sting/gatk/datasources/simpleDataSources/SAMByIntervalTest.java +++ b/java/test/org/broadinstitute/sting/gatk/datasources/simpleDataSources/SAMByIntervalTest.java @@ -79,6 +79,7 @@ public class SAMByIntervalTest extends BaseTest { */ @Before public void doForEachTest() { + fl = new ArrayList(); // sequence @@ -122,7 +123,7 @@ public class SAMByIntervalTest extends BaseTest { */ @Test public void testSingleRead() { - testRead(1,ArtificialSAMUtils.DEFAULT_READ_LENGTH,1); + testRead(1,ArtificialSAMUtils.DEFAULT_READ_LENGTH,50); } /** @@ -130,7 +131,7 @@ public class SAMByIntervalTest extends BaseTest { */ @Test public void testChromosome() { - testRead(1, READ_COUNT, READ_COUNT -ArtificialSAMUtils.DEFAULT_READ_LENGTH+1); // +1 because we go from 1 up to 101 + testRead(1, READ_COUNT, READ_COUNT); } /** @@ -138,7 +139,7 @@ public class SAMByIntervalTest extends BaseTest { */ @Test public void testMiddle() { - testRead(20, READ_COUNT-20, READ_COUNT -ArtificialSAMUtils.DEFAULT_READ_LENGTH-40+2); + testRead(20, READ_COUNT-20,61); }