From 75d93e6335baedf2b33de0ba37978830791f3d10 Mon Sep 17 00:00:00 2001 From: Guillermo del Angel Date: Tue, 22 Nov 2011 22:46:12 -0500 Subject: [PATCH] Another corner condition fix: skip likelihood computation in case we cut so many bases there's no haplotype or read left --- .../sting/gatk/walkers/indels/PairHMMIndelErrorModel.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/PairHMMIndelErrorModel.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/PairHMMIndelErrorModel.java index abd933ada..6b6a7a82e 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/PairHMMIndelErrorModel.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/PairHMMIndelErrorModel.java @@ -556,8 +556,11 @@ public class PairHMMIndelErrorModel { long indStart = start - haplotype.getStartPosition(); long indStop = stop - haplotype.getStartPosition(); double readLikelihood; + if (DEBUG) + System.out.format("indStart: %d indStop: %d WinStart:%d WinStop:%d start: %d stop: %d readLength: %d C:%s\n", + indStart, indStop, ref.getWindow().getStart(), ref.getWindow().getStop(), start, stop, read.getReadLength(), read.getCigar().toString()); - if (indStart < 0 || indStop >= haplotype.getBasesAsBytes().length) { + if (indStart < 0 || indStop >= haplotype.getBasesAsBytes().length || indStart > indStop) { // read spanned more than allowed reference context: we currently can't deal with this readLikelihood =0; } else