From 2227f4922096e955f94f0970d52c4e8a115af481 Mon Sep 17 00:00:00 2001 From: rpoplin Date: Fri, 27 May 2011 16:49:20 +0000 Subject: [PATCH] misc cleanup git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5893 348d0f76-0448-11de-a6fe-93d51630548a --- .../VariantDataManager.java | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) 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 cab42f845..801de6704 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantDataManager.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantDataManager.java @@ -208,29 +208,27 @@ public class VariantDataManager { private static double decodeAnnotation( final String annotationKey, final VariantContext vc, final boolean jitter ) { double value; - if( annotationKey.equals("QUAL") ) { - value = vc.getPhredScaledQual(); - } else { - try { + try { + if( annotationKey.equals("QUAL") ) { + value = vc.getPhredScaledQual(); + } else { value = Double.parseDouble( (String)vc.getAttribute( annotationKey ) ); - if (Double.isInfinite(value)) - value = Double.NaN; - else - if( jitter && ( annotationKey.equalsIgnoreCase("HRUN") || annotationKey.equalsIgnoreCase("FS") ) ) { // Integer valued annotations must be jittered a bit to work in this GMM - value += -0.25 + 0.5 * GenomeAnalysisEngine.getRandomGenerator().nextDouble(); - } - if(annotationKey.equals("HaplotypeScore") && MathUtils.compareDoubles(value, 0.0, 0.0001) == 0 ) { value = -0.2 + 0.4*GenomeAnalysisEngine.getRandomGenerator().nextDouble(); } - - } catch( final Exception e ) { - value = Double.NaN; // The VQSR works with missing data now by marginalizing over the missing dimension when evaluating clusters. - if( !warnedUserMissingValue ) { - logger.warn("WARNING: Missing value detected for " + annotationKey + ". The VQSR will work with missing data by marginalizing over this dimension for this variant. This warning message is only shown once so there may be other annotations missing as well."); - warnedUserMissingValue = true; + if( Double.isInfinite(value) ) { value = Double.NaN; } + if( jitter && ( annotationKey.equalsIgnoreCase("HRUN") || annotationKey.equalsIgnoreCase("FS") ) ) { // Integer valued annotations must be jittered a bit to work in this GMM + value += -0.25 + 0.5 * GenomeAnalysisEngine.getRandomGenerator().nextDouble(); } + if( annotationKey.equals("HaplotypeScore") && MathUtils.compareDoubles(value, 0.0, 0.0001) == 0 ) { value = -0.2 + 0.4*GenomeAnalysisEngine.getRandomGenerator().nextDouble(); } + } + } catch( final Exception e ) { + value = Double.NaN; // The VQSR works with missing data now by marginalizing over the missing dimension when evaluating clusters. + if( !warnedUserMissingValue ) { + logger.warn("WARNING: Missing value detected for " + annotationKey + ". The VQSR will work with missing data by marginalizing over this dimension for this variant. This warning message is only shown once so there may be other annotations missing as well."); + warnedUserMissingValue = true; } } + return value; }