use of com.hartwig.events.AnalysisOutputBlob 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");
}
use of com.hartwig.events.AnalysisOutputBlob in project pipeline5 by hartwigmedical.
the class ResearchMetadataApiTest method publishesPipelineStagedEventOnCompletionWithDataType.
@Test
public void publishesPipelineStagedEventOnCompletionWithDataType() throws Exception {
ArgumentCaptor<PubsubMessage> pubsubMessageArgumentCaptor = pipelineCompleteWithFile("set/purple/tumor.purple.somatic.vcf.gz", TestOutput.builder().status(PipelineStatus.SUCCESS).addDatatypes(new AddDatatype(DataType.SOMATIC_VARIANTS_PURPLE, "tumor", new ArchivePath(Folder.root(), "purple", "tumor.purple.somatic.vcf.gz"))).build());
PipelineComplete result = ObjectMappers.get().readValue(pubsubMessageArgumentCaptor.getValue().getData().toByteArray(), PipelineComplete.class);
AnalysisOutputBlob blobResult = result.pipeline().analyses().get(1).output().get(0);
assertThat(blobResult.datatype()).hasValue("SOMATIC_VARIANTS_PURPLE");
}
use of com.hartwig.events.AnalysisOutputBlob 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");
}
use of com.hartwig.events.AnalysisOutputBlob 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");
}
use of com.hartwig.events.AnalysisOutputBlob in project pipeline5 by hartwigmedical.
the class StagedOutputPublisherTest method publishesDnaTertiaryAnalysisOnVcf.
@Test
public void publishesDnaTertiaryAnalysisOnVcf() throws Exception {
when(state.status()).thenReturn(PipelineStatus.SUCCESS);
Blob vcf = withBucketAndMd5(blob("/sage/" + TestInputs.tumorSample() + ".vcf"));
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(1).type()).isEqualTo(Type.SOMATIC);
assertThat(result.pipeline().analyses().get(1).output()).extracting(AnalysisOutputBlob::filename).containsExactlyInAnyOrder("tumor.vcf");
}
Aggregations