Search in sources :

Example 1 with GenomicsOptions

use of com.google.cloud.genomics.dataflow.utils.GenomicsOptions in project gatk by broadinstitute.

the class ReferenceAPISourceUnitTest method testDummy.

@Test(groups = "cloud")
public void testDummy() {
    String referenceName = HS37D5_REF_ID;
    final String expected = "AAACAGGTTA";
    // -1 because we're using closed intervals
    SimpleInterval interval = new SimpleInterval("1", 50001, 50001 + expected.length() - 1);
    Logger logger = LogManager.getLogger(ReferenceAPISourceUnitTest.class);
    GenomicsOptions options = PipelineOptionsFactory.create().as(GenomicsOptions.class);
    options.setApiKey(getGCPTestApiKey());
    options.setProject(getGCPTestProject());
    // We don't use GATKTestPipeline because we need specific options.
    final Pipeline p = TestPipeline.create(options);
    ReferenceAPISource refAPISource = makeReferenceAPISource(referenceName, p);
    ReferenceBases bases = refAPISource.getReferenceBases(p.getOptions(), interval);
    final String actual = new String(bases.getBases());
    Assert.assertEquals(actual, expected, "Wrong bases returned");
    p.run();
}
Also used : ReferenceBases(org.broadinstitute.hellbender.utils.reference.ReferenceBases) ReferenceAPISource(org.broadinstitute.hellbender.engine.datasources.ReferenceAPISource) GenomicsOptions(com.google.cloud.genomics.dataflow.utils.GenomicsOptions) SimpleInterval(org.broadinstitute.hellbender.utils.SimpleInterval) Logger(org.apache.logging.log4j.Logger) TestPipeline(com.google.cloud.dataflow.sdk.testing.TestPipeline) Pipeline(com.google.cloud.dataflow.sdk.Pipeline) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test)

Aggregations

Pipeline (com.google.cloud.dataflow.sdk.Pipeline)1 TestPipeline (com.google.cloud.dataflow.sdk.testing.TestPipeline)1 GenomicsOptions (com.google.cloud.genomics.dataflow.utils.GenomicsOptions)1 Logger (org.apache.logging.log4j.Logger)1 ReferenceAPISource (org.broadinstitute.hellbender.engine.datasources.ReferenceAPISource)1 SimpleInterval (org.broadinstitute.hellbender.utils.SimpleInterval)1 ReferenceBases (org.broadinstitute.hellbender.utils.reference.ReferenceBases)1 BaseTest (org.broadinstitute.hellbender.utils.test.BaseTest)1 Test (org.testng.annotations.Test)1