diff --git a/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantContext.java b/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantContext.java index 3d375aba2..5787b591f 100755 --- a/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantContext.java +++ b/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantContext.java @@ -1343,6 +1343,15 @@ public class VariantContext implements Feature { // to enable tribble intergrati return (int)stop; } + private boolean hasSymbolicAlleles() { + for (Allele a: getAlleles()) { + if (a.isSymbolic()) { + return true; + } + } + return false; + } + public static VariantContext createVariantContextWithPaddedAlleles(VariantContext inputVC, byte inputRefBase, boolean refBaseShouldBeAppliedToEndOfAlleles) { Allele refAllele = inputVC.getReference(); @@ -1352,7 +1361,9 @@ public class VariantContext implements Feature { // to enable tribble intergrati // We need to pad a VC with a common base if the length of the reference allele is less than the length of the VariantContext. // This happens because the position of e.g. an indel is always one before the actual event (as per VCF convention). long locLength = (inputVC.getEnd() - inputVC.getStart()) + 1; - if (refAllele.length() == locLength) + if (inputVC.hasSymbolicAlleles()) + padVC = true; + else if (refAllele.length() == locLength) padVC = false; else if (refAllele.length() == locLength-1) padVC = true;