Permalink
Browse files

Temp. to PairHMM to avoid bad likelihoods

-- Simply caps PairHMM likelihoods from rising above 0 by taking the min of the likelihood and 0.  Will be properly fixed in GATK 2.5 with better PairHMM implementation.
  • Loading branch information...
1 parent 5e89f01 commit 7ab7c873a1c584c4e97c75fef7963d7aa77ef507 Mark DePristo committed Mar 18, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 public/java/src/org/broadinstitute/sting/utils/pairhmm/PairHMM.java
@@ -122,7 +122,10 @@ public final double computeReadLikelihoodGivenHaplotypeLog10( final byte[] haplo
if ( overallGCP.length != readBases.length ) throw new IllegalArgumentException("Read bases and overall GCP aren't the same size: " + readBases.length + " vs " + overallGCP.length);
if ( hapStartIndex < 0 || hapStartIndex > haplotypeBases.length ) throw new IllegalArgumentException("hapStartIndex is bad, must be between 0 and haplotype length " + haplotypeBases.length + " but got " + hapStartIndex);
- final double result = subComputeReadLikelihoodGivenHaplotypeLog10(haplotypeBases, readBases, readQuals, insertionGOP, deletionGOP, overallGCP, hapStartIndex, recacheReadValues);
+ double result = subComputeReadLikelihoodGivenHaplotypeLog10(haplotypeBases, readBases, readQuals, insertionGOP, deletionGOP, overallGCP, hapStartIndex, recacheReadValues);
+
+ // TODO -- remove max when PairHMM no longer returns likelihoods >= 0
+ result = Math.min(result, 0.0);
if ( MathUtils.goodLog10Probability(result) )
return result;

0 comments on commit 7ab7c87

Please sign in to comment.