From d84970ff75e4704a1ab44ab6db092588a3bfd73e Mon Sep 17 00:00:00 2001 From: Ryan Poplin Date: Wed, 17 Dec 2014 10:04:26 -0500 Subject: [PATCH] BQSR bug fix from @nsubtil -- Ignore SNP matches that lie outside the clipped read window -- This fixes an issue where GATK would skip the entire read if a SNP is entirely contained within a sequencing adapter. --- .../gatk/tools/walkers/bqsr/BaseRecalibrator.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/bqsr/BaseRecalibrator.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/bqsr/BaseRecalibrator.java index 3aa4ba5dd..d29f8931c 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/bqsr/BaseRecalibrator.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/bqsr/BaseRecalibrator.java @@ -313,6 +313,12 @@ public class BaseRecalibrator extends ReadWalker implements NanoSche final boolean[] knownSites = new boolean[readLength]; Arrays.fill(knownSites, false); for( final Feature f : features ) { + if ((f.getStart() < read.getSoftStart() && f.getEnd() < read.getSoftStart()) || + (f.getStart() > read.getSoftEnd() && f.getEnd() > read.getSoftEnd())) { + // feature is outside clipping window for the read, ignore + continue; + } + int featureStartOnRead = ReadUtils.getReadCoordinateForReferenceCoordinate(read.getSoftStart(), read.getCigar(), f.getStart(), ReadUtils.ClippingTail.LEFT_TAIL, true); // BUGBUG: should I use LEFT_TAIL here? if( featureStartOnRead == ReadUtils.CLIPPING_GOAL_NOT_REACHED ) { featureStartOnRead = 0;