use of com.hartwig.events.PipelineComplete 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");
}
use of com.hartwig.events.PipelineComplete 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);
}
use of com.hartwig.events.PipelineComplete 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);
}
use of com.hartwig.events.PipelineComplete in project pipeline5 by hartwigmedical.
the class StagedOutputPublisherTest method usesDatatypeAndBarcodeWhenFileMatched.
@Test
public void usesDatatypeAndBarcodeWhenFileMatched() throws Exception {
when(state.status()).thenReturn(PipelineStatus.SUCCESS);
String path = TestInputs.referenceSample() + "/germline_caller/reference.germline.vcf.gz";
Blob vcf = withBucketAndMd5(blob(path));
Page<Blob> page = pageOf(vcf);
StageOutput stageOutput = mock(StageOutput.class);
when(stageOutput.datatypes()).thenReturn(List.of(new AddDatatype(DataType.GERMLINE_VARIANTS, "barcode", new ArchivePath(Folder.from(TestInputs.referenceRunMetadata()), "germline_caller", "reference.germline.vcf.gz"))));
when(state.stageOutputs()).thenReturn(List.of(stageOutput));
ArgumentCaptor<PubsubMessage> published = publish(page, TestInputs.defaultSingleSampleRunMetadata());
PipelineComplete result = OBJECT_MAPPER.readValue(new String(published.getValue().getData().toByteArray()), PipelineComplete.class);
assertThat(result.pipeline().analyses().get(2).output().get(0).datatype()).hasValue("GERMLINE_VARIANTS");
assertThat(result.pipeline().analyses().get(2).output().get(0).barcode()).hasValue("barcode");
}
Aggregations