From 8708753a6ab88ea54b0ac981cd0b472576cbd501 Mon Sep 17 00:00:00 2001 From: depristo Date: Thu, 9 Sep 2010 02:32:46 +0000 Subject: [PATCH] checkin for removal git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4237 348d0f76-0448-11de-a6fe-93d51630548a --- .../playground/gatk/walkers/QSampleWalker.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/QSampleWalker.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/QSampleWalker.java index c19b5b2d0..9331394b7 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/QSampleWalker.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/QSampleWalker.java @@ -36,6 +36,7 @@ import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.walkers.*; +import org.broadinstitute.sting.gatk.walkers.genotyper.BatchedCallsMerger; import org.broadinstitute.sting.gatk.walkers.genotyper.UnifiedArgumentCollection; import org.broadinstitute.sting.gatk.walkers.genotyper.UnifiedGenotyperEngine; import org.broadinstitute.sting.gatk.walkers.genotyper.VariantCallContext; @@ -110,7 +111,15 @@ public class QSampleWalker extends RodWalker implements TreeRe if ( genotypesVC == null ) return 0; // protect ourselves for runs with BTI - VariantCallContext vcc = UG_engine.runGenotyper(tracker, ref, context); + // set of het samples + Set hetSamples = new HashSet(); + for ( String sample : samples ) { + if ( genotypesVC.getGenotype(sample).isHet() ) + hetSamples.add(sample); + } + + AlignmentContext hetsContext = BatchedCallsMerger.filterForSamples(context.getBasePileup(), hetSamples); + VariantCallContext vcc = UG_engine.runGenotyper(tracker, ref, hetsContext); logger.info(String.format("Visiting site %s", context.getLocation())); for ( String sample : samples ) { @@ -135,7 +144,7 @@ public class QSampleWalker extends RodWalker implements TreeRe private static int HET_INDEX = 1; private double scoreSample(String sample, VariantCallContext vcc) { if ( vcc == null || vcc.vc == null || vcc.vc.getGenotype(sample) == null ) - return 0.0; + return 0.33; else { // get GLs GenotypeLikelihoods gl = vcc.vc.getGenotype(sample).getLikelihoods();