Search in sources :

Example 1 with FeatureManager

use of org.broadinstitute.hellbender.engine.FeatureManager in project gatk by broadinstitute.

the class VariantOverlapAnnotatorUnitTest method testRsIDFeatureContextWithNoDBSnP.

@Test(dataProvider = "AnnotateRsIDData")
public void testRsIDFeatureContextWithNoDBSnP(final VariantContext toAnnotate, final List<VariantContext> dbSNPRecords, final String expectedID, final boolean expectOverlap) throws Exception {
    final File file = new File(publicTestDir + "Homo_sapiens_assembly19.dbsnp135.chr1_1M.exome_intervals.vcf");
    final FeatureContext ctx = new FeatureContext(new FeatureManager(new ArtificialFeatureContainingCommandLineProgram_ForVariantOverlap(file)), new SimpleInterval(toAnnotate));
    final VariantOverlapAnnotator annotator = makeAnnotator(file, null, "binding");
    final VariantContext annotated = annotator.annotateRsID(ctx, toAnnotate);
    Assert.assertNotNull(annotated);
    //nothing at given position
    Assert.assertEquals(annotated, toAnnotate);
}
Also used : VariantContext(htsjdk.variant.variantcontext.VariantContext) SimpleInterval(org.broadinstitute.hellbender.utils.SimpleInterval) File(java.io.File) FeatureContext(org.broadinstitute.hellbender.engine.FeatureContext) FeatureManager(org.broadinstitute.hellbender.engine.FeatureManager) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test)

Example 2 with FeatureManager

use of org.broadinstitute.hellbender.engine.FeatureManager in project gatk by broadinstitute.

the class VariantOverlapAnnotatorUnitTest method testRsIDFeatureContext.

@Test(dataProvider = "AnnotateRsIDData")
public void testRsIDFeatureContext(final VariantContext toAnnotate, final List<VariantContext> dbSNPRecords, final String expectedID, final boolean expectOverlap) throws Exception {
    final File file = new File(publicTestDir + "Homo_sapiens_assembly19.dbsnp135.chr1_1M.exome_intervals.vcf");
    final FeatureContext ctx = new FeatureContext(new FeatureManager(new ArtificialFeatureContainingCommandLineProgram_ForVariantOverlap(file)), new SimpleInterval(toAnnotate));
    final VariantOverlapAnnotator annotator = makeAnnotator(file, "dbsnp");
    final VariantContext annotated = annotator.annotateRsID(ctx, toAnnotate);
    Assert.assertNotNull(annotated);
    //nothing at given position
    Assert.assertEquals(annotated, toAnnotate);
}
Also used : VariantContext(htsjdk.variant.variantcontext.VariantContext) SimpleInterval(org.broadinstitute.hellbender.utils.SimpleInterval) File(java.io.File) FeatureContext(org.broadinstitute.hellbender.engine.FeatureContext) FeatureManager(org.broadinstitute.hellbender.engine.FeatureManager) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test)

Example 3 with FeatureManager

use of org.broadinstitute.hellbender.engine.FeatureManager in project gatk by broadinstitute.

the class VariantOverlapAnnotatorUnitTest method testAnnotateOverlapsFeatureContext.

@Test(dataProvider = "AnnotateRsIDData")
public void testAnnotateOverlapsFeatureContext(final VariantContext toAnnotate, final List<VariantContext> records, final String expectedID, final boolean expectOverlap) throws Exception {
    final File file = new File(publicTestDir + "Homo_sapiens_assembly19.dbsnp135.chr1_1M.exome_intervals.vcf");
    final FeatureContext ctx = new FeatureContext(new FeatureManager(new ArtificialFeatureContainingCommandLineProgram_ForVariantOverlap(file)), new SimpleInterval(toAnnotate));
    final VariantOverlapAnnotator annotator = makeAnnotator(file, "dbsnp");
    final VariantContext annotated = annotator.annotateOverlaps(ctx, toAnnotate);
    //nothing at given position
    Assert.assertEquals(annotated, toAnnotate);
}
Also used : VariantContext(htsjdk.variant.variantcontext.VariantContext) SimpleInterval(org.broadinstitute.hellbender.utils.SimpleInterval) File(java.io.File) FeatureContext(org.broadinstitute.hellbender.engine.FeatureContext) FeatureManager(org.broadinstitute.hellbender.engine.FeatureManager) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test)

Example 4 with FeatureManager

use of org.broadinstitute.hellbender.engine.FeatureManager in project gatk by broadinstitute.

the class VariantOverlapAnnotatorUnitTest method testRsIDFeatureContextWith2Sets.

@Test(dataProvider = "AnnotateRsIDData")
public void testRsIDFeatureContextWith2Sets(final VariantContext toAnnotate, final List<VariantContext> dbSNPRecords, final String expectedID, final boolean expectOverlap) throws Exception {
    final File file = new File(publicTestDir + "Homo_sapiens_assembly19.dbsnp135.chr1_1M.exome_intervals.vcf");
    final FeatureContext ctx = new FeatureContext(new FeatureManager(new ArtificialFeatureContainingCommandLineProgram_ForVariantOverlap(file)), new SimpleInterval(toAnnotate));
    final VariantOverlapAnnotator annotator = makeAnnotator(file, "dbsnp", "binding");
    final VariantContext annotated = annotator.annotateRsID(ctx, toAnnotate);
    Assert.assertNotNull(annotated);
    //nothing at given position
    Assert.assertEquals(annotated, toAnnotate);
}
Also used : VariantContext(htsjdk.variant.variantcontext.VariantContext) SimpleInterval(org.broadinstitute.hellbender.utils.SimpleInterval) File(java.io.File) FeatureContext(org.broadinstitute.hellbender.engine.FeatureContext) FeatureManager(org.broadinstitute.hellbender.engine.FeatureManager) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test)

Example 5 with FeatureManager

use of org.broadinstitute.hellbender.engine.FeatureManager in project gatk by broadinstitute.

the class VariantOverlapAnnotatorUnitTest method testAnnotateOverlapsFeatureContextWith2Sets.

@Test(dataProvider = "AnnotateRsIDData")
public void testAnnotateOverlapsFeatureContextWith2Sets(final VariantContext toAnnotate, final List<VariantContext> records, final String expectedID, final boolean expectOverlap) throws Exception {
    final File file = new File(publicTestDir + "Homo_sapiens_assembly19.dbsnp135.chr1_1M.exome_intervals.vcf");
    final FeatureContext ctx = new FeatureContext(new FeatureManager(new ArtificialFeatureContainingCommandLineProgram_ForVariantOverlap(file)), new SimpleInterval(toAnnotate));
    final VariantOverlapAnnotator annotator = makeAnnotator(file, "dbsnp", "binding");
    final VariantContext annotated = annotator.annotateOverlaps(ctx, toAnnotate);
    //nothing at given position
    Assert.assertEquals(annotated, toAnnotate);
}
Also used : VariantContext(htsjdk.variant.variantcontext.VariantContext) SimpleInterval(org.broadinstitute.hellbender.utils.SimpleInterval) File(java.io.File) FeatureContext(org.broadinstitute.hellbender.engine.FeatureContext) FeatureManager(org.broadinstitute.hellbender.engine.FeatureManager) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test)

Aggregations

VariantContext (htsjdk.variant.variantcontext.VariantContext)5 File (java.io.File)5 FeatureContext (org.broadinstitute.hellbender.engine.FeatureContext)5 FeatureManager (org.broadinstitute.hellbender.engine.FeatureManager)5 SimpleInterval (org.broadinstitute.hellbender.utils.SimpleInterval)5 BaseTest (org.broadinstitute.hellbender.utils.test.BaseTest)5 Test (org.testng.annotations.Test)5