Search in sources :

Example 6 with AnalysisOutputBlob

use of com.hartwig.events.AnalysisOutputBlob in project pipeline5 by hartwigmedical.

the class StagedOutputPublisherTest method verifySecondaryAnalysis.

private void verifySecondaryAnalysis(final String extension, final String indexExtension, final String namespace) throws com.fasterxml.jackson.core.JsonProcessingException {
    when(state.status()).thenReturn(PipelineStatus.SUCCESS);
    Blob tumorBamBlob = withBucketAndMd5(blob(TestInputs.tumorSample() + "/" + namespace + "/" + TestInputs.tumorSample() + "." + extension));
    Blob tumorBaiBlob = withBucketAndMd5(blob(TestInputs.tumorSample() + "/" + namespace + "/" + TestInputs.tumorSample() + "." + extension + "." + indexExtension));
    Blob refBamBlob = withBucketAndMd5(blob(TestInputs.tumorSample() + "/" + namespace + "/" + TestInputs.referenceSample() + "." + extension));
    Blob refBaiBlob = withBucketAndMd5(blob(TestInputs.tumorSample() + "/" + namespace + "/" + TestInputs.referenceSample() + "." + extension + "." + indexExtension));
    Page<Blob> page = pageOf(tumorBamBlob, tumorBaiBlob, refBamBlob, refBaiBlob);
    ArgumentCaptor<PubsubMessage> messageArgumentCaptor = publish(page, TestInputs.defaultSomaticRunMetadata());
    PipelineComplete result = OBJECT_MAPPER.readValue(new String(messageArgumentCaptor.getValue().getData().toByteArray()), PipelineComplete.class);
    assertThat(result.pipeline().context()).isEqualTo(Context.DIAGNOSTIC);
    assertThat(result.pipeline().analyses().get(0).type()).isEqualTo(Type.ALIGNMENT);
    assertThat(result.pipeline().analyses().get(0).output()).hasSize(4);
    assertThat(result.pipeline().analyses().get(0).output()).extracting(AnalysisOutputBlob::filename).containsExactlyInAnyOrder(TestInputs.tumorSample() + "." + extension, TestInputs.tumorSample() + "." + extension + "." + indexExtension, TestInputs.referenceSample() + "." + extension, TestInputs.referenceSample() + "." + extension + "." + indexExtension);
}
Also used : PipelineComplete(com.hartwig.events.PipelineComplete) Blob(com.google.cloud.storage.Blob) AnalysisOutputBlob(com.hartwig.events.AnalysisOutputBlob) PubsubMessage(com.google.pubsub.v1.PubsubMessage)

Example 7 with AnalysisOutputBlob

use of com.hartwig.events.AnalysisOutputBlob in project pipeline5 by hartwigmedical.

the class StagedOutputPublisherTest method verifyGermline.

public void verifyGermline(final String filename, final String expectedFile, final String namespace) throws com.fasterxml.jackson.core.JsonProcessingException {
    when(state.status()).thenReturn(PipelineStatus.SUCCESS);
    Blob vcf = withBucketAndMd5(blob(namespace + TestInputs.referenceSample() + filename));
    Page<Blob> page = pageOf(vcf);
    ArgumentCaptor<PubsubMessage> messageArgumentCaptor = publish(page, TestInputs.defaultSomaticRunMetadata());
    PipelineComplete result = OBJECT_MAPPER.readValue(new String(messageArgumentCaptor.getValue().getData().toByteArray()), PipelineComplete.class);
    assertThat(result.pipeline().analyses().get(2).type()).isEqualTo(Type.GERMLINE);
    assertThat(result.pipeline().analyses().get(2).output()).extracting(AnalysisOutputBlob::filename).containsExactlyInAnyOrder(expectedFile);
}
Also used : PipelineComplete(com.hartwig.events.PipelineComplete) Blob(com.google.cloud.storage.Blob) AnalysisOutputBlob(com.hartwig.events.AnalysisOutputBlob) PubsubMessage(com.google.pubsub.v1.PubsubMessage)

Aggregations

PubsubMessage (com.google.pubsub.v1.PubsubMessage)7 AnalysisOutputBlob (com.hartwig.events.AnalysisOutputBlob)7 PipelineComplete (com.hartwig.events.PipelineComplete)7 Test (org.junit.Test)5 Blob (com.google.cloud.storage.Blob)3 Analysis (com.hartwig.events.Analysis)3