Skip to content

Commit

Permalink
remove ignored tests in SVContextUnitTest (#5159)
Browse files Browse the repository at this point in the history
  • Loading branch information
SHuang-Broad authored and Valentin Ruano Rubio committed Sep 17, 2018
1 parent 0619f17 commit f81f3ed
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import htsjdk.variant.variantcontext.Allele;
import htsjdk.variant.variantcontext.StructuralVariantType;
import htsjdk.variant.variantcontext.VariantContext;
import htsjdk.variant.vcf.VCFConstants;
import htsjdk.variant.vcf.VCFFileReader;
import org.broadinstitute.hellbender.GATKBaseTest;
import org.broadinstitute.hellbender.engine.spark.datasources.ReferenceMultiSparkSource;
Expand Down Expand Up @@ -120,7 +121,7 @@ public void testComposeReferenceHaplotype(final VariantContext vc, @SuppressWarn
* to obtain the reference alternative haplotype.
* @param vc input variant context.
*/
@Test(dataProvider="validVariantContexts", dependsOnMethods = {"testCreate", "testType", "testLength"}, groups = "sv")
@Test(dataProvider="validInsertionsAndDeletions", dependsOnMethods = {"testCreate", "testType", "testLength"}, groups = "sv")
public void testComposeAlternativeHaplotype(final VariantContext vc, @SuppressWarnings("unused") final ReferenceMultiSparkSource reference) throws IOException {
final SVContext svc = SVContext.of(vc);
if (svc.getStructuralVariantType() != StructuralVariantType.INS && svc.getStructuralVariantType() != StructuralVariantType.DEL) {
Expand Down Expand Up @@ -151,13 +152,12 @@ public void testComposeAlternativeHaplotype(final VariantContext vc, @SuppressWa
Assert.assertEquals(altHaplotype.getBases(), expectedBases, svc.getStructuralVariantType().name() + " " + new String(altHaplotype.getBases()) + " vs " + new String(expectedBases));
}


/**
* Tests {@link SVContext#getBreakPointIntervals(int, SAMSequenceDictionary, boolean)}.
* to obtain the reference haplotype.
* @param vc input variant context.
*/
@Test(dataProvider="validVariantContexts", dependsOnMethods = {"testCreate", "testType", "testLength"}, groups = "sv")
@Test(dataProvider="validInsertionsAndDeletions", dependsOnMethods = {"testCreate", "testType", "testLength"}, groups = "sv")
public void testGetBreakPoints(final VariantContext vc, @SuppressWarnings("unused") final ReferenceMultiSparkSource reference) throws IOException {
testGetBreakPoints(vc, reference, 0);
testGetBreakPoints(vc, reference, 10);
Expand Down Expand Up @@ -222,6 +222,22 @@ public Object[][] validVariantContexts(){
}
}

@DataProvider(name="validInsertionsAndDeletions")
public Object[][] validInsertionsAndDeletions(){
final ReferenceMultiSparkSource reference = referenceMultiSource(REFERENCE_FILE.getAbsolutePath());
try (final VCFFileReader reader = new VCFFileReader(VALID_VARIANTS_FILE, false)) {
return Utils.stream(reader)
.filter(vc -> {
final StructuralVariantType svtype = StructuralVariantType.valueOf(vc.getAttributeAsString(VCFConstants.SVTYPE, ""));
return svtype.equals(StructuralVariantType.INS) || svtype.equals(StructuralVariantType.DEL);
})
.map(vc -> new Object[]{vc, reference})
.toArray(Object[][]::new);
} catch (final Throwable ex) {
throw new TestException("could not load the valid context file: " + VALID_VARIANTS_FILE.getAbsolutePath(), ex);
}
}

@DataProvider(name = "outputVariantTestFilesData")
public Object[][] outputVariantTestFilesData() {

Expand Down

0 comments on commit f81f3ed

Please sign in to comment.