From ff2f4df043eae05bfc338898155a34bb50becd06 Mon Sep 17 00:00:00 2001 From: Mauricio Carneiro Date: Wed, 28 Sep 2011 16:07:00 -0400 Subject: [PATCH] Fixed hardclipping inside indel (right tail) when hard clipping the right tail of a read falls inside a deletion, clipping should fall back to the last base before the deletion to follow the ReadClipper's contract. --- .../src/org/broadinstitute/sting/utils/sam/ReadUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/java/src/org/broadinstitute/sting/utils/sam/ReadUtils.java b/public/java/src/org/broadinstitute/sting/utils/sam/ReadUtils.java index 14ebbaa6f..e0a3a5a53 100755 --- a/public/java/src/org/broadinstitute/sting/utils/sam/ReadUtils.java +++ b/public/java/src/org/broadinstitute/sting/utils/sam/ReadUtils.java @@ -893,6 +893,10 @@ public class ReadUtils { // base before the deletion (see warning in function contracts) else if (fallsInsideDeletion && !endsWithinCigar) readBases += shift - 1; + + // If we reached our goal inside a deletion then we must backtrack to the last base before the deletion + else if (fallsInsideDeletion && endsWithinCigar) + readBases--; } }