From 0e04e952455cfe5cb4c5a7ba5c87a4ff6da5d8df Mon Sep 17 00:00:00 2001 From: asivache Date: Thu, 17 Feb 2011 16:15:42 +0000 Subject: [PATCH] Bug fix: when extracting reference sequence for the event from the reference genome, the tool was treating Deletions and MNPs of length N in exactly the same way: ref_bases[current_pos+1,...,current_pos+N]. This is correct for Deletions but not for MNPs git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5258 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/gatk/walkers/variantutils/ValidateVariants.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariants.java b/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariants.java index 3fca6088b..19932ca2b 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariants.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariants.java @@ -120,10 +120,14 @@ public class ValidateVariants extends RodWalker { return; } + // deletions are associated with the (position of) the last (preceding) non-deleted base; + // hence to get actually deleted bases we need offset = 1 + int offset = 1 ; + if ( vc.getType() == VariantContext.Type.MNP ) offset = 0; // if it's an MNP, the reported position IS the first modified base byte[] refBytes = ref.getBases(); byte[] trueRef = new byte[reportedRefAllele.length()]; for (int i = 0; i < reportedRefAllele.length(); i++) - trueRef[i] = refBytes[i+1]; + trueRef[i] = refBytes[i+offset]; observedRefAllele = Allele.create(trueRef, true); } // SNPs, etc.