From 75d93e6335baedf2b33de0ba37978830791f3d10 Mon Sep 17 00:00:00 2001 From: Guillermo del Angel Date: Tue, 22 Nov 2011 22:46:12 -0500 Subject: [PATCH 1/4] 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 From 32adbd614f9dc39b09fb3aa3fd9a2e910e3b4e24 Mon Sep 17 00:00:00 2001 From: Guillermo del Angel Date: Tue, 22 Nov 2011 22:48:46 -0500 Subject: [PATCH 2/4] Solve merge conflict --- .../sting/gatk/walkers/indels/PairHMMIndelErrorModel.java | 2 +- 1 file changed, 1 insertion(+), 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 95633c222..09968f47e 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 @@ -561,7 +561,7 @@ public class PairHMMIndelErrorModel { 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 || indStart > indStop) { + if (indStart < 0 || indStop >= haplotype.getBases().length || indStart > indStop) { // read spanned more than allowed reference context: we currently can't deal with this readLikelihood =0; } else From e5b85f0a786ee7c09413ec4ca81523387d27ce81 Mon Sep 17 00:00:00 2001 From: David Roazen Date: Wed, 23 Nov 2011 11:45:57 -0500 Subject: [PATCH 4/4] A toString() method for IntervalBindings Necessary since we're currently writing things like this to our VCF headers: intervals=[org.broadinstitute.sting.commandline.IntervalBinding@4ce66f56] --- .../org/broadinstitute/sting/commandline/IntervalBinding.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/java/src/org/broadinstitute/sting/commandline/IntervalBinding.java b/public/java/src/org/broadinstitute/sting/commandline/IntervalBinding.java index 82c7b20b6..9e2c9a818 100644 --- a/public/java/src/org/broadinstitute/sting/commandline/IntervalBinding.java +++ b/public/java/src/org/broadinstitute/sting/commandline/IntervalBinding.java @@ -108,4 +108,8 @@ public final class IntervalBinding { return intervals; } + + public String toString() { + return getSource(); + } }