Search in sources :

Example 1 with Analysis

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

the class ResearchMetadataApiTest method publishesPipelineStagedEventOnCompletionSingleSampleFile.

@Test
public void publishesPipelineStagedEventOnCompletionSingleSampleFile() throws Exception {
    ArgumentCaptor<PubsubMessage> pubsubMessageArgumentCaptor = pipelineCompleteWithFile("set/reference/aligner/reference.bam", TestOutput.builder().status(PipelineStatus.SUCCESS).build());
    PipelineComplete result = ObjectMappers.get().readValue(pubsubMessageArgumentCaptor.getValue().getData().toByteArray(), PipelineComplete.class);
    Analysis analysis = result.pipeline().analyses().get(0);
    assertThat(analysis.molecule()).isEqualTo(Molecule.DNA);
    AnalysisOutputBlob blobResult = analysis.output().get(0);
    assertThat(blobResult.datatype()).isEmpty();
    assertThat(blobResult.root()).isEqualTo("set");
    assertThat(blobResult.sampleSubdir()).hasValue("reference");
    assertThat(blobResult.namespace()).hasValue("aligner");
    assertThat(blobResult.filename()).isEqualTo("reference.bam");
}
Also used : PipelineComplete(com.hartwig.events.PipelineComplete) Analysis(com.hartwig.events.Analysis) AnalysisOutputBlob(com.hartwig.events.AnalysisOutputBlob) PubsubMessage(com.google.pubsub.v1.PubsubMessage) Test(org.junit.Test)

Example 2 with Analysis

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

the class ResearchMetadataApiTest method publishesPipelineStagedEventOnCompletionRootFile.

@Test
public void publishesPipelineStagedEventOnCompletionRootFile() throws Exception {
    ArgumentCaptor<PubsubMessage> pubsubMessageArgumentCaptor = pipelineCompleteWithFile("set/run.log", TestOutput.builder().status(PipelineStatus.SUCCESS).build());
    PipelineComplete result = ObjectMappers.get().readValue(pubsubMessageArgumentCaptor.getValue().getData().toByteArray(), PipelineComplete.class);
    Analysis analysis = result.pipeline().analyses().get(1);
    assertThat(analysis.molecule()).isEqualTo(Molecule.DNA);
    AnalysisOutputBlob blobResult = analysis.output().get(0);
    assertThat(blobResult.datatype()).isEmpty();
    assertThat(blobResult.root()).isEqualTo("set");
    assertThat(blobResult.sampleSubdir()).isEmpty();
    assertThat(blobResult.namespace()).isEmpty();
    assertThat(blobResult.filename()).isEqualTo("run.log");
}
Also used : PipelineComplete(com.hartwig.events.PipelineComplete) Analysis(com.hartwig.events.Analysis) AnalysisOutputBlob(com.hartwig.events.AnalysisOutputBlob) PubsubMessage(com.google.pubsub.v1.PubsubMessage) Test(org.junit.Test)

Example 3 with Analysis

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

the class ResearchMetadataApiTest method publishesPipelineStagedEventOnCompletion.

@Test
public void publishesPipelineStagedEventOnCompletion() throws Exception {
    ArgumentCaptor<PubsubMessage> pubsubMessageArgumentCaptor = pipelineCompleteWithFile("set/purple/tumor.purple.somatic.vcf.gz", TestOutput.builder().status(PipelineStatus.SUCCESS).build());
    PipelineComplete result = ObjectMappers.get().readValue(pubsubMessageArgumentCaptor.getValue().getData().toByteArray(), PipelineComplete.class);
    assertThat(result.pipeline().runId()).isEqualTo(1);
    assertThat(result.pipeline().setId()).isEqualTo(SET_ID);
    assertThat(result.pipeline().sample()).isEqualTo("tumor");
    assertThat(result.pipeline().version()).isEqualTo(Versions.pipelineMajorMinorVersion());
    Analysis analysis = result.pipeline().analyses().get(1);
    assertThat(analysis.molecule()).isEqualTo(Molecule.DNA);
    AnalysisOutputBlob blobResult = analysis.output().get(0);
    assertThat(blobResult.barcode()).isEmpty();
    assertThat(blobResult.bucket()).isEqualTo("bucket");
    assertThat(blobResult.datatype()).isEmpty();
    assertThat(blobResult.root()).isEqualTo("set");
    assertThat(blobResult.sampleSubdir()).isEmpty();
    assertThat(blobResult.namespace()).hasValue("purple");
    assertThat(blobResult.filename()).isEqualTo("tumor.purple.somatic.vcf.gz");
}
Also used : PipelineComplete(com.hartwig.events.PipelineComplete) Analysis(com.hartwig.events.Analysis) AnalysisOutputBlob(com.hartwig.events.AnalysisOutputBlob) PubsubMessage(com.google.pubsub.v1.PubsubMessage) Test(org.junit.Test)

Aggregations

PubsubMessage (com.google.pubsub.v1.PubsubMessage)3 Analysis (com.hartwig.events.Analysis)3 AnalysisOutputBlob (com.hartwig.events.AnalysisOutputBlob)3 PipelineComplete (com.hartwig.events.PipelineComplete)3 Test (org.junit.Test)3