diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/HybSelPerformanceWalker.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/HybSelPerformanceWalker.java index ba9b5c4df..a4a665cea 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/HybSelPerformanceWalker.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/HybSelPerformanceWalker.java @@ -13,12 +13,14 @@ import org.broadinstitute.sting.utils.fasta.IndexedFastaSequenceFile; import java.util.List; import java.util.Collection; import java.io.IOException; +import java.io.File; import net.sf.samtools.SAMRecord; import net.sf.samtools.util.StringUtil; import net.sf.picard.reference.ReferenceSequence; import edu.mit.broad.picard.util.Interval; import edu.mit.broad.picard.util.OverlapDetector; +import edu.mit.broad.picard.directed.IntervalList; @By(DataSource.REFERENCE) public class HybSelPerformanceWalker extends LocusWalker { @@ -31,6 +33,11 @@ public class HybSelPerformanceWalker extends LocusWalker> results) { - out.println("location\tlength\tgc\tavg_coverage\tnormalized_coverage\thit_twice\tfreestanding"); + out.println("location\tlength\tgc\tavg_coverage\tnormalized_coverage\thit_twice\tfreestanding\tboosted"); // first zip through and build an overlap detector of all the intervals, so later // we can calculate if this interval is free-standing @@ -102,6 +109,15 @@ public class HybSelPerformanceWalker extends LocusWalker booster = new OverlapDetector(-BOOSTER_DISTANCE,0); + if (BOOSTER_FILE != null) { + IntervalList il = IntervalList.fromFile(BOOSTER_FILE); + List l = il.getUniqueIntervals(); + booster.addAll(l, l); + } + + + // now zip through and calculate the total average coverage long totalCoverage = 0; @@ -132,12 +148,16 @@ public class HybSelPerformanceWalker extends LocusWalker hits = od.getOverlaps(makeInterval(target)); + Interval targetInterval = makeInterval(target); + + Collection hits = od.getOverlaps(targetInterval); boolean freestanding = (hits.size() == 1); - out.printf("%s:%d-%d\t%d\t%6.4f\t%6.4f\t%6.4f\t%d\t%d\n", + boolean boosted = (booster.getOverlaps(targetInterval).size() > 0); + + out.printf("%s:%d-%d\t%d\t%6.4f\t%6.4f\t%6.4f\t%d\t%d\t%d\n", target.getContig(), target.getStart(), target.getStop(), length, gc, - avgCoverage, normCoverage, ((ti.hitTwice)?1:0), ((freestanding)?1:0) + avgCoverage, normCoverage, ((ti.hitTwice)?1:0), ((freestanding)?1:0), ((boosted)?1:0) );