@Test public void testStrandAlleleCountsBySample() throws IOException { // HaplotypeCaller creates gVCF final String CEUTRIO_BAM = validationDataLocation + "CEUTrio.HiSeq.b37.chr20.10_11mb.bam"; final WalkerTestSpec specHaplotypeCaller = new WalkerTestSpec( "-T HaplotypeCaller --disableDithering " + String.format("-R %s -I %s ", b37KGReference, CEUTRIO_BAM) + "--no_cmdline_in_header -o %s -L 20:10130000-10134800 " + "-ERC GVCF --sample_name NA12878 -variant_index_type LINEAR " + "-variant_index_parameter 128000 -A StrandAlleleCountsBySample", 1, Arrays.asList("")); specHaplotypeCaller .disableShadowBCF(); // TODO: Remove when BaseTest.assertAttributesEquals() works with SC final File gVCF = executeTest("testStrandAlleleCountsBySampleHaplotypeCaller", specHaplotypeCaller) .getFirst() .get(0); List<String> gVCFList = getAttributeValues(gVCF, new String("SAC")); // Use gVCF from HaplotypeCaller final WalkerTestSpec spec = new WalkerTestSpec( baseTestString(" -V " + gVCF.getAbsolutePath(), b37KGReference), 1, Arrays.asList("")); final File outputVCF = executeTest("testStrandAlleleCountsBySample", spec).getFirst().get(0); List<String> outputVCFList = getAttributeValues(outputVCF, new String("SAC")); // All of the SAC values in the VCF were derived from the gVCF Assert.assertTrue(gVCFList.containsAll(outputVCFList)); }
@Test(enabled = true) public void testSpanningDeletionDoesNotGetGenotypedWithNoOtherAlleles() { WalkerTestSpec spec = new WalkerTestSpec( "-T GenotypeGVCFs --no_cmdline_in_header -o %s -R " + b37KGReference + " -V " + privateTestDir + "spanningDel.delOnly.g.vcf", 1, Arrays.asList("46169d08f93e5ff57856c7b64717314b")); spec.disableShadowBCF(); executeTest("testSpanningDeletionDoesNotGetGenotypedWithNoOtherAlleles", spec); }
@Test(enabled = true) public void testSpanningDeletionsFromCombinedGVCF() { WalkerTestSpec spec = new WalkerTestSpec( "-T GenotypeGVCFs --no_cmdline_in_header -o %s -R " + b37KGReference + " -V " + privateTestDir + "spanningDel.combined.g.vcf", 1, Arrays.asList(simpleSpanningDeletionsMD5)); spec.disableShadowBCF(); executeTest("testSpanningDeletionsFromCombinedGVCFMD5", spec); }
@Test public void testSetVcfFilteredGtoNocall() { String testfile = privateTestDir + "filteredSamples.vcf"; WalkerTestSpec spec = new WalkerTestSpec( "-T SelectVariants --setFilteredGtToNocall -R " + b37KGReference + " --variant " + testfile + " -o %s --no_cmdline_in_header", 1, Arrays.asList("7771f07a9997296852ab367fac2c7a6c")); spec.disableShadowBCF(); executeTest("testSetVcfFilteredGtoNocall--" + testfile, spec); }
@Test(enabled = true) public void testMultipleSpanningDeletionsMD5() { WalkerTestSpec spec = new WalkerTestSpec( "-T GenotypeGVCFs --no_cmdline_in_header -o %s -R " + b37KGReference + " -V " + privateTestDir + "spanningDel.1.g.vcf -V " + privateTestDir + "spanningDel.2.g.vcf -V " + privateTestDir + "spanningDel.3.g.vcf", 1, Arrays.asList("1c418229117bc8f148a69eda9c496309")); spec.disableShadowBCF(); executeTest("testMultipleSpanningDeletionsMD5", spec); }
/** Section to test spanning deletions */ @Test public void testSpanningDeletions() throws IOException { final String gvcf1 = privateTestDir + "spanningDel.1.g.vcf"; final String gvcf2 = privateTestDir + "spanningDel.2.g.vcf"; final String gvcf3 = privateTestDir + "spanningDel.3.g.vcf"; // create the genotyped VCF to use as a basis for comparison against all of the combined // versions // case 0: GenotypeGVCFs(1.g.vcf, 2.g.vcf, 3.g.vcf) final WalkerTestSpec genotypeBase = new WalkerTestSpec( "-T GenotypeGVCFs --no_cmdline_in_header -o %s -R " + b37KGReference + " -V " + gvcf1 + " -V " + gvcf2 + " -V " + gvcf3, 1, Arrays.asList("")); genotypeBase.disableShadowBCF(); final File genotypeBaseVCF = executeTest("genotypeBase", genotypeBase).getFirst().get(0); final List<VariantContext> BASE_VARIANT_CONTEXTS = getVariantContexts(genotypeBaseVCF); // case 1: GenotypeGVCFs(CombineGVCFs(1.g.vcf, 2.g.vcf), 3.g.vcf) final WalkerTestSpec combine12 = new WalkerTestSpec( "-T CombineGVCFs --no_cmdline_in_header -o %s -R " + b37KGReference + " -V " + gvcf1 + " -V " + gvcf2, 1, Arrays.asList("")); combine12.disableShadowBCF(); final File combined_gVCF12 = executeTest("combine12", combine12).getFirst().get(0); final WalkerTestSpec genotype12_3 = new WalkerTestSpec( "-T GenotypeGVCFs --no_cmdline_in_header -o %s -R " + b37KGReference + " -V " + combined_gVCF12.getAbsolutePath() + " -V " + gvcf3, 1, Arrays.asList("")); genotype12_3.disableShadowBCF(); final File genotype12_3VCF = executeTest("genotype12_3", genotype12_3).getFirst().get(0); final List<VariantContext> VARIANT_CONTEXTS_12_3 = getVariantContexts(genotype12_3VCF); testVCsAreEqual(BASE_VARIANT_CONTEXTS, VARIANT_CONTEXTS_12_3); // case 2: GenotypeGVCFs(CombineGVCFs(CombineGVCFs(1.g.vcf, 2.g.vcf), 3.g.vcf)) final WalkerTestSpec combine12then3 = new WalkerTestSpec( "-T CombineGVCFs --no_cmdline_in_header -o %s -R " + b37KGReference + " -V " + combined_gVCF12 + " -V " + gvcf3, 1, Arrays.asList("")); combine12then3.disableShadowBCF(); final File combined_gVCF12then3 = executeTest("combined_gVCF12then3", combine12then3).getFirst().get(0); final WalkerTestSpec genotype12then3 = new WalkerTestSpec( "-T GenotypeGVCFs --no_cmdline_in_header -o %s -R " + b37KGReference + " -V " + combined_gVCF12then3.getAbsolutePath(), 1, Arrays.asList("")); genotype12then3.disableShadowBCF(); final File genotype12then3VCF = executeTest("genotype12then3", genotype12then3).getFirst().get(0); final List<VariantContext> VARIANT_CONTEXTS_12then3 = getVariantContexts(genotype12then3VCF); testVCsAreEqual(BASE_VARIANT_CONTEXTS, VARIANT_CONTEXTS_12then3); // case 3: GenotypeGVCFs(CombineGVCFs(CombineGVCFs(1.g.vcf, 3.g.vcf), 2.g.vcf)) final WalkerTestSpec combine13 = new WalkerTestSpec( "-T CombineGVCFs --no_cmdline_in_header -o %s -R " + b37KGReference + " -V " + gvcf1 + " -V " + gvcf3, 1, Arrays.asList("")); combine13.disableShadowBCF(); final File combined_gVCF13 = executeTest("combine13", combine13).getFirst().get(0); final WalkerTestSpec combine13then2 = new WalkerTestSpec( "-T CombineGVCFs --no_cmdline_in_header -o %s -R " + b37KGReference + " -V " + combined_gVCF13 + " -V " + gvcf2, 1, Arrays.asList("")); combine13then2.disableShadowBCF(); final File combined_gVCF13then2 = executeTest("combined_gVCF13then2", combine13then2).getFirst().get(0); final WalkerTestSpec genotype13then2 = new WalkerTestSpec( "-T GenotypeGVCFs --no_cmdline_in_header -o %s -R " + b37KGReference + " -V " + combined_gVCF13then2.getAbsolutePath(), 1, Arrays.asList("")); genotype13then2.disableShadowBCF(); final File genotype13then2VCF = executeTest("genotype13then2", genotype13then2).getFirst().get(0); final List<VariantContext> VARIANT_CONTEXTS_13then2 = getVariantContexts(genotype13then2VCF); testVCsAreEqual(BASE_VARIANT_CONTEXTS, VARIANT_CONTEXTS_13then2); // case 4: GenotypeGVCFs(CombineGVCFs(1.g.vcf, 2.g.vcf, 3.g.vcf)) final WalkerTestSpec combine123 = new WalkerTestSpec( "-T CombineGVCFs --no_cmdline_in_header -o %s -R " + b37KGReference + " -V " + gvcf1 + " -V " + gvcf2 + " -V " + gvcf3, 1, Arrays.asList("")); combine123.disableShadowBCF(); final File combined_gVCF123 = executeTest("combine123", combine123).getFirst().get(0); final WalkerTestSpec genotype123 = new WalkerTestSpec( "-T GenotypeGVCFs --no_cmdline_in_header -o %s -R " + b37KGReference + " -V " + combined_gVCF123.getAbsolutePath(), 1, Arrays.asList("")); genotype123.disableShadowBCF(); final File genotype123VCF = executeTest("genotype123", genotype123).getFirst().get(0); final List<VariantContext> VARIANT_CONTEXTS_123 = getVariantContexts(genotype123VCF); testVCsAreEqual(BASE_VARIANT_CONTEXTS, VARIANT_CONTEXTS_123); }