From aaf674d9db948f048934334eea589f6e245a7456 Mon Sep 17 00:00:00 2001 From: ebanks Date: Thu, 24 Dec 2009 03:06:46 +0000 Subject: [PATCH] Cleaned up this annotation. Still experimental. As of now, it's not useful. More analysis is needed to determine how to handle cases where UG is unsure whether a sample is het or hom. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2442 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/gatk/walkers/annotator/HardyWeinberg.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HardyWeinberg.java b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HardyWeinberg.java index 7fedcdc08..e41f0c639 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HardyWeinberg.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HardyWeinberg.java @@ -30,6 +30,11 @@ public class HardyWeinberg implements VariantAnnotation { for ( Genotype genotype : genotypes ) { if ( genotype.isNoCall() ) continue; + + // TODO - fix me: + // Right now we just ignore genotypes that are not confident, but this throws off + // our HW ratios. More analysis is needed to determine the right thing to do when + // the genotyper cannot decide whether a given sample is het or hom var. if ( genotype.getNegLog10PError() < MIN_NEG_LOG10_PERROR ) continue; @@ -41,8 +46,11 @@ public class HardyWeinberg implements VariantAnnotation { homCount++; } + if ( refCount + hetCount + homCount == 0) + return null; + double pvalue = HardyWeinbergCalculation.hwCalculate(refCount, hetCount, homCount); - System.out.println(refCount + " " + hetCount + " " + homCount + " " + pvalue); + //System.out.println(refCount + " " + hetCount + " " + homCount + " " + pvalue); return String.format("%.1f", QualityUtils.phredScaleErrorRate(pvalue)); }