From d7430c23f86ef10d364e0e9b0c93d2f330cc3fc0 Mon Sep 17 00:00:00 2001 From: rpoplin Date: Tue, 14 Jun 2011 20:23:43 +0000 Subject: [PATCH] Bringing VQSR up to date with the 1000G v2b changes git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@6000 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/gatk/walkers/annotator/FisherStrand.java | 3 +-- .../sting/gatk/walkers/annotator/HaplotypeScore.java | 5 ++--- .../walkers/variantrecalibration/VariantDataManager.java | 5 ++++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/FisherStrand.java b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/FisherStrand.java index af2bd7a9a..66d927e1c 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/FisherStrand.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/FisherStrand.java @@ -47,10 +47,9 @@ public class FisherStrand implements InfoFieldAnnotation, StandardAnnotation { private static final double MIN_PVALUE = 1E-320; public Map annotate(RefMetaDataTracker tracker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { - if ( ! vc.isVariant() || vc.isFiltered() ) + if ( ! vc.isVariant() || vc.isFiltered() ) return null; - int[][] table; if (vc.isBiallelic() && vc.isSNP()) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java index 05914d4b5..cb7bcbeed 100644 --- a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java @@ -101,7 +101,6 @@ public class HaplotypeScore implements InfoFieldAnnotation, StandardAnnotation { } else return null; - } } } @@ -168,13 +167,13 @@ public class HaplotypeScore implements InfoFieldAnnotation, StandardAnnotation { // Now retrieve the N most popular haplotypes if (consensusHaplotypeQueue.size() > 0) { - // Since the consensus haplotypes are in a quality-ordered priority queue, the two best haplotypes are just the first two in the queue + // The consensus haplotypes are in a quality-ordered priority queue, so the best haplotypes are just the ones at the front of the queue final Haplotype haplotype1 = consensusHaplotypeQueue.poll(); Listhlist = new ArrayList(); hlist.add(new Haplotype(haplotype1.getBasesAsBytes(), 60)); - for (int k=1;k < haplotypesToCompute; k++) { + for (int k=1; k < haplotypesToCompute; k++) { Haplotype haplotype2 = consensusHaplotypeQueue.poll(); if(haplotype2 == null ) { haplotype2 = haplotype1; } // Sometimes only the reference haplotype can be found hlist.add(new Haplotype(haplotype2.getBasesAsBytes(), 20)); diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantDataManager.java b/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantDataManager.java index 2aaa4c04b..72282e6d8 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantDataManager.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantDataManager.java @@ -211,14 +211,17 @@ public class VariantDataManager { try { if( annotationKey.equalsIgnoreCase("QUAL") ) { value = vc.getPhredScaledQual(); + } else if( annotationKey.equalsIgnoreCase("DP") ) { + value = Double.parseDouble( (String)vc.getAttribute( "DP" ) ) / Double.parseDouble( (String)vc.getAttribute( "AN" ) ); } else { value = Double.parseDouble( (String)vc.getAttribute( annotationKey ) ); if( Double.isInfinite(value) ) { value = Double.NaN; } - if( annotationKey.equalsIgnoreCase("InbreedingCoeff") && value > 0.01 ) { value = Double.NaN; } + if( annotationKey.equalsIgnoreCase("InbreedingCoeff") && value > 0.05 ) { value = Double.NaN; } if( jitter && annotationKey.equalsIgnoreCase("HRUN") ) { // Integer valued annotations must be jittered a bit to work in this GMM value += -0.25 + 0.5 * GenomeAnalysisEngine.getRandomGenerator().nextDouble(); } if( annotationKey.equalsIgnoreCase("HaplotypeScore") && MathUtils.compareDoubles(value, 0.0, 0.0001) == 0 ) { value = -0.2 + 0.4*GenomeAnalysisEngine.getRandomGenerator().nextDouble(); } + if( annotationKey.equalsIgnoreCase("FS") && MathUtils.compareDoubles(value, 0.0, 0.01) == 0 ) { value = -0.2 + 0.4*GenomeAnalysisEngine.getRandomGenerator().nextDouble(); } } } catch( final Exception e ) {