Merge pull request #1174 from broadinstitute/eb_fix_combine_for_spanning_dels

Fix for combining records in which one has a spanning deletion and ne…
This commit is contained in:
ldgauthier 2015-10-02 18:02:42 -04:00
commit 173a34a450
2 changed files with 19 additions and 3 deletions

View File

@ -237,4 +237,18 @@ public class CombineVariantsIntegrationTest extends WalkerTest {
Arrays.asList(""));
executeTest("combineSymbolicVariants: ", spec);
}
}
@Test
public void combineSpanningDels() {
// Just checking that this does not fail, hence no output files and MD5
WalkerTestSpec spec = new WalkerTestSpec(
"-T CombineVariants --no_cmdline_in_header -o %s "
+ " -R " + b37KGReference
+ " -V " + privateTestDir + "test.spanningdel.combine.1.vcf "
+ " -V " + privateTestDir + "test.spanningdel.combine.2.vcf "
+ " -genotypeMergeOptions UNIQUIFY",
0,
Arrays.asList(""));
executeTest("combineSpanningDels: ", spec);
}
}

View File

@ -1468,7 +1468,9 @@ public class GATKVariantContextUtils {
if ( extended.equals(b) )
extended = b;
map.put(a, extended);
} else if ( a.isSymbolic() ) {
}
// as long as it's not a reference allele then we want to add it as is (this covers e.g. symbolic and spanning deletion alleles)
else if ( !a.isReference() ) {
map.put(a, a);
}
}
@ -1477,7 +1479,7 @@ public class GATKVariantContextUtils {
}
static private boolean isUsableAlternateAllele(final Allele allele) {
return ! (allele.isReference() || allele.isSymbolic() );
return ! (allele.isReference() || allele.isSymbolic() || allele == Allele.SPAN_DEL );
}
public static List<VariantContext> sortVariantContextsByPriority(Collection<VariantContext> unsortedVCs, List<String> priorityListOfVCs, GenotypeMergeType mergeOption ) {