From 55f61b1f881d3441bc48452962a9b00de15a3181 Mon Sep 17 00:00:00 2001 From: asivache Date: Tue, 3 Nov 2009 16:08:11 +0000 Subject: [PATCH] Bug fix in adjustment of the shift position. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1966 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/gatk/walkers/indels/IndelGenotyperV2Walker.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelGenotyperV2Walker.java b/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelGenotyperV2Walker.java index 5929eea38..d57fcdebe 100644 --- a/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelGenotyperV2Walker.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelGenotyperV2Walker.java @@ -286,6 +286,7 @@ public class IndelGenotyperV2Walker extends ReadWalker { if ( DEBUG ) System.out.println("DEBUG>> indel observations present within "+NQS_WIDTH+" bases ahead. Resetting shift to "+request); attempts++; if ( attempts == 4 ) { + System.out.println("DEBUG>> attempts to preserve full NQS window failed; now trying to find any suitable position.") ; failure = true; break; } @@ -297,14 +298,15 @@ public class IndelGenotyperV2Walker extends ReadWalker { // first position after the shift (this is bad for other reasons); if it breaks a nqs window, so be it request = initial_request; attempts = 0; - while ( tumor_context.hasIndelsInInterval(request,request) || - normal_context.hasIndelsInInterval(request,request) ) { + while ( tumor_context.hasIndelsInInterval(request,request+1) || + normal_context.hasIndelsInInterval(request,request+1) ) { request--; if ( DEBUG ) System.out.println("DEBUG>> indel observations present within "+NQS_WIDTH+" bases ahead. Resetting shift to "+request); attempts++; if ( attempts == 50 ) throw new StingException("Indel at every position in the interval ["+request+", "+initial_request+"]. Can not find a break to shift context window to"); } } + if ( DEBUG ) System.out.println("DEBUG>> Found acceptable target position "+request); return request; }