diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/ExactAFCalculationModel.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/ExactAFCalculationModel.java index 3be8fc29e..43d74a055 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/ExactAFCalculationModel.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/ExactAFCalculationModel.java @@ -134,8 +134,7 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel { protected Map generateCalls(Map contexts, Map GLs, int bestAFguess) { - // first experiment: refine do genotype assignment by Hardy Weinberg equilibrium assumption. - HashMap calls = new HashMap(); + HashMap calls = new HashMap(); double[][] pathMetricArray = new double[GLs.size()+1][bestAFguess+1]; @@ -144,6 +143,13 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel { ArrayList sampleIndices = new ArrayList(); int sampleIdx = 0; + // todo - optimize initialization + for (int k=0; k <= bestAFguess; k++) + for (int j=0; j <= GLs.size(); j++) + pathMetricArray[j][k] = -1e30; + + pathMetricArray[0][0] = 0.0; + if (SIMPLE_GREEDY_GENOTYPER) { sampleIndices.addAll(GLs.keySet()); sampleIdx = GLs.size(); @@ -222,10 +228,7 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel { if (qual <= 0.0) { qual = 0.0; - myAlleles.clear(); - myAlleles.add(Allele.NO_CALL); - myAlleles.add(Allele.NO_CALL); - } + } attributes.put(VCFConstants.GENOTYPE_QUALITY_KEY,String.format("%4.2f", 10*qual)); diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/UnifiedGenotyperEngine.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/UnifiedGenotyperEngine.java index c32fcd371..6214d0901 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/UnifiedGenotyperEngine.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/UnifiedGenotyperEngine.java @@ -230,7 +230,8 @@ public class UnifiedGenotyperEngine { // todo - temp fix until we can deal with extended events properly //VariantContext vc = new VariantContext("UG_call", loc.getContig(), loc.getStart(), loc.getStop(), alleles, genotypes, phredScaledConfidence/10.0, passesCallThreshold(phredScaledConfidence, atTriggerTrack) ? null : filter, attributes); VariantContext vc = new VariantContext("UG_call", loc.getContig(), loc.getStart(), - loc.getStart()+refAllele.length(), alleles, genotypes, phredScaledConfidence/10.0, passesCallThreshold(phredScaledConfidence, atTriggerTrack) ? null : filter, attributes); + Math.max(loc.getStart()+refAllele.length()-1,loc.getStart()), + alleles, genotypes, phredScaledConfidence/10.0, passesCallThreshold(phredScaledConfidence, atTriggerTrack) ? null : filter, attributes); if ( annotationEngine != null ) {