ant clean is your friend....fixed test code dependent on an interface change.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2660 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
a11503819a
commit
2ea768d902
|
|
@ -571,17 +571,18 @@ class LocusOverflowTracker {
|
|||
public boolean exceeded(GenomeLoc loc, int pileupSize) {
|
||||
boolean exceeded = pileupSize >= maxPileupSize;
|
||||
if (exceeded && warningsEmitted <= MAX_WARNINGS) {
|
||||
warningInQueue = true;
|
||||
if (lastLocation == null) lastLocation = loc;
|
||||
else if (lastLocation.contiguousP(loc))
|
||||
else if (lastLocation.contiguousP(loc)) {
|
||||
lastLocation = lastLocation.merge(loc);
|
||||
}
|
||||
else {
|
||||
warnUser();
|
||||
lastLocation = loc;
|
||||
}
|
||||
warningInQueue = true;
|
||||
} else if (warningInQueue) {
|
||||
lastLocation = null;
|
||||
warnUser();
|
||||
lastLocation = null;
|
||||
}
|
||||
return exceeded;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ public class LocusIteratorByStateTest extends BaseTest {
|
|||
AlignmentContext context = li.next();
|
||||
//System.err.println(context.getLocation() + " " + context.getPileup().size());
|
||||
}
|
||||
li.getLocusOverflowTracker().cleanWarningQueue();
|
||||
Assert.assertEquals(2, ((LocusIteratorOverride) li.getLocusOverflowTracker()).getWarningCount());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.broadinstitute.sting.gatk.iterators;
|
|||
import net.sf.samtools.SAMFileHeader;
|
||||
import net.sf.samtools.SAMRecord;
|
||||
import org.broadinstitute.sting.BaseTest;
|
||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
import org.broadinstitute.sting.utils.GenomeLocParser;
|
||||
import org.broadinstitute.sting.utils.Utils;
|
||||
import org.broadinstitute.sting.utils.sam.ArtificialSAMUtils;
|
||||
|
|
@ -40,10 +41,11 @@ public class LocusOverflowTrackerTest extends BaseTest {
|
|||
@Test
|
||||
public void testLocusOverflow() {
|
||||
SAMRecord rec = ArtificialSAMUtils.createArtificialRead(header, "readUno", 0, 1, 100);
|
||||
if (tracker.exceeded(rec, MAX_READS - 1))
|
||||
GenomeLoc loc = GenomeLocParser.createGenomeLoc(rec);
|
||||
if (tracker.exceeded(loc, MAX_READS - 1))
|
||||
Assert.fail("We shouldn't be exceeded when MAX_READS -1 is the input");
|
||||
if (!tracker.exceeded(rec, MAX_READS)) Assert.fail("We should be exceeded when MAX_READS is the input");
|
||||
if (!tracker.exceeded(rec, MAX_READS + 1))
|
||||
if (!tracker.exceeded(loc, MAX_READS)) Assert.fail("We should be exceeded when MAX_READS is the input");
|
||||
if (!tracker.exceeded(loc, MAX_READS + 1))
|
||||
Assert.fail("We shouldn't be exceeded when MAX_READS +1 is the input");
|
||||
}
|
||||
|
||||
|
|
@ -51,7 +53,8 @@ public class LocusOverflowTrackerTest extends BaseTest {
|
|||
public void testContinuousLocus() {
|
||||
for (int x = 1; x < 5; x++) {
|
||||
SAMRecord rec = ArtificialSAMUtils.createArtificialRead(header, "readUno", 0, x, 100);
|
||||
tracker.exceeded(rec, MAX_READS + 1);
|
||||
GenomeLoc loc = GenomeLocParser.createGenomeLoc(rec);
|
||||
tracker.exceeded(loc, MAX_READS + 1);
|
||||
}
|
||||
tracker.cleanWarningQueue();
|
||||
Assert.assertEquals(1, ((LocusIteratorOverride) tracker).getWarningCount());
|
||||
|
|
@ -61,11 +64,13 @@ public class LocusOverflowTrackerTest extends BaseTest {
|
|||
public void testTwoSeperateContinuousLoci() {
|
||||
for (int x = 1; x < 5; x++) {
|
||||
SAMRecord rec = ArtificialSAMUtils.createArtificialRead(header, "readUno", 0, x, 2);
|
||||
tracker.exceeded(rec, MAX_READS + 1);
|
||||
GenomeLoc loc = GenomeLocParser.createGenomeLoc(rec);
|
||||
tracker.exceeded(loc, MAX_READS + 1);
|
||||
}
|
||||
for (int x = 10; x < 15; x++) {
|
||||
SAMRecord rec = ArtificialSAMUtils.createArtificialRead(header, "readUno", 0, x, 2);
|
||||
tracker.exceeded(rec, MAX_READS + 1);
|
||||
GenomeLoc loc = GenomeLocParser.createGenomeLoc(rec);
|
||||
tracker.exceeded(loc, MAX_READS + 1);
|
||||
}
|
||||
tracker.cleanWarningQueue();
|
||||
Assert.assertEquals(2, ((LocusIteratorOverride) tracker).getWarningCount());
|
||||
|
|
@ -76,7 +81,8 @@ public class LocusOverflowTrackerTest extends BaseTest {
|
|||
public void testOverflow() {
|
||||
for (int x = 1; x < (LocusOverflowTracker.warningsEmitted * 3); x += 2) {
|
||||
SAMRecord rec = ArtificialSAMUtils.createArtificialRead(header, "readUno", 0, x, 100);
|
||||
tracker.exceeded(rec, MAX_READS + 1);
|
||||
GenomeLoc loc = GenomeLocParser.createGenomeLoc(rec);
|
||||
tracker.exceeded(loc, MAX_READS + 1);
|
||||
}
|
||||
tracker.cleanWarningQueue();
|
||||
Assert.assertEquals(LocusOverflowTracker.warningsEmitted, ((LocusIteratorOverride) tracker).getWarningCount());
|
||||
|
|
|
|||
Loading…
Reference in New Issue