Merge pull request #1334 from broadinstitute/db_issue_1294

Fixed treatment of SPAN_DEL in ReadBackedPhasing and MNF merging.  Closes #1294.
This commit is contained in:
David Benjamin 2016-05-12 16:37:33 -04:00
commit e34ec0fbbb
2 changed files with 20 additions and 3 deletions

View File

@ -297,8 +297,8 @@ class PhasingUtils {
*/
static boolean mergeIntoMNPvalidationCheck(GenomeLocParser genomeLocParser, VariantContext vc1, VariantContext vc2) {
// Can only merge "simple" base strings (i.e., SNPs or MNPs, but not indels):
final boolean vc1CanBeMerged = vc1.isSNP() || vc1.isMNP();
final boolean vc2CanBeMerged = vc2.isSNP() || vc2.isMNP();
final boolean vc1CanBeMerged = (vc1.isSNP() || vc1.isMNP()) && !vc1.hasAllele(Allele.SPAN_DEL);
final boolean vc2CanBeMerged = (vc2.isSNP() || vc2.isMNP()) && !vc2.hasAllele(Allele.SPAN_DEL);
if (!vc1CanBeMerged || !vc2CanBeMerged)
return false;

View File

@ -70,7 +70,6 @@ public class ReadBackedPhasingIntegrationTest extends WalkerTest {
" --no_cmdline_in_header";
}
@Test
public void test1() {
WalkerTestSpec spec = new WalkerTestSpec(
@ -170,4 +169,22 @@ public class ReadBackedPhasingIntegrationTest extends WalkerTest {
Arrays.asList("630816da701b9ea8674c23c91fa61bec"));
executeTest("Merge SNPs if on the same read", spec);
}
@Test
public void testDontMergeSpanningDeletions() {
WalkerTestSpec spec = new WalkerTestSpec(
"-T ReadBackedPhasing" +
" -R " + b37KGReferenceWithDecoy +
" -I " + privateTestDir + "phasing_test_with_span_del_1.bam" +
" -I " + privateTestDir + "phasing_test_with_span_del_2.bam" +
" -I " + privateTestDir + "phasing_test_with_span_del_3.bam" +
" -I " + privateTestDir + "phasing_test_with_span_del_4.bam" +
" --variant " + privateTestDir + "phasing_test_with_span_del.vcf" +
" -enableMergeToMNP" +
" -o %s" +
" --no_cmdline_in_header",
1,
Arrays.asList("b334de5ad35665f0d65034197ac05b32"));
executeTest("Don't merge symbolic SPAN_DEL (*) alleles (into the nonexistent ** MNP).", spec);
}
}