diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java index c4a0480ef..0455290e3 100644 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java @@ -91,8 +91,6 @@ public class HaplotypeScore extends InfoFieldAnnotation implements StandardAnnot final Map stratifiedPerReadAlleleLikelihoodMap) { if (vc.isSNP() && stratifiedContexts != null) return annotatePileup(ref, stratifiedContexts, vc); - else if (stratifiedPerReadAlleleLikelihoodMap != null && vc.isVariant()) - return annotateWithLikelihoods(stratifiedPerReadAlleleLikelihoodMap, vc); else return null; } @@ -133,31 +131,6 @@ public class HaplotypeScore extends InfoFieldAnnotation implements StandardAnnot return map; } - private Map annotateWithLikelihoods(final Map stratifiedPerReadAlleleLikelihoodMap, - final VariantContext vc) { - - final MathUtils.RunningAverage scoreRA = new MathUtils.RunningAverage(); - for (final Genotype genotype : vc.getGenotypes()) { - final PerReadAlleleLikelihoodMap perReadAlleleLikelihoodMap = stratifiedPerReadAlleleLikelihoodMap.get(genotype.getSampleName()); - if (perReadAlleleLikelihoodMap == null) - continue; - - Double d = scoreIndelsAgainstHaplotypes(perReadAlleleLikelihoodMap); - if (d == null) - continue; - scoreRA.add(d); // Taking the simple average of all sample's score since the score can be negative and the RMS doesn't make sense - } - - // if (scoreRA.observationCount() == 0) - // return null; - - // annotate the score in the info field - final Map map = new HashMap(); - map.put(getKeyNames().get(0), String.format("%.4f", scoreRA.mean())); - return map; - - } - private static class HaplotypeComparator implements Comparator, Serializable { public int compare(Haplotype a, Haplotype b) { @@ -412,39 +385,6 @@ public class HaplotypeScore extends InfoFieldAnnotation implements StandardAnnot return mismatches - expected; } - - private Double scoreIndelsAgainstHaplotypes(final PerReadAlleleLikelihoodMap perReadAlleleLikelihoodMap) { - final ArrayList haplotypeScores = new ArrayList(); - - if (perReadAlleleLikelihoodMap.isEmpty()) - return null; - - for (Map el : perReadAlleleLikelihoodMap.getLikelihoodMapValues()) { - - // retrieve likelihood information corresponding to this read - // Score all the reads in the pileup, even the filtered ones - final double[] scores = new double[el.size()]; - int i = 0; - for (Map.Entry a : el.entrySet()) { - scores[i++] = -a.getValue(); - if (DEBUG) { - System.out.printf(" vs. haplotype %d = %f%n", i - 1, scores[i - 1]); - } - } - - haplotypeScores.add(scores); - } - - // indel likelihoods are strict log-probs, not phred scored - double overallScore = 0.0; - for (final double[] readHaplotypeScores : haplotypeScores) { - overallScore += MathUtils.arrayMin(readHaplotypeScores); - } - - return overallScore; - - } - public List getKeyNames() { return Arrays.asList("HaplotypeScore"); }