Search in sources :

Example 1 with StartupScriptComponent

use of com.hartwig.pipeline.report.StartupScriptComponent in project pipeline5 by hartwigmedical.

the class SageCaller method outputBuilder.

protected ImmutableSageOutput.Builder outputBuilder(final SomaticRunMetadata metadata, final PipelineStatus jobStatus, final RuntimeBucket bucket, final ResultsDirectory resultsDirectory) {
    final String filteredOutputFile = sageConfiguration.filteredTemplate().apply(metadata);
    final String unfilteredOutputFile = sageConfiguration.unfilteredTemplate().apply(metadata);
    final String geneCoverageFile = sageConfiguration.geneCoverageTemplate().apply(metadata);
    final Optional<String> somaticRefSampleBqrPlot = referenceSampleBqrPlot(metadata);
    final Optional<String> somaticTumorSampleBqrPlot = tumorSampleBqrPlot(metadata);
    final ImmutableSageOutput.Builder builder = SageOutput.builder(namespace()).status(jobStatus);
    somaticRefSampleBqrPlot.ifPresent(s -> builder.maybeSomaticRefSampleBqrPlot(GoogleStorageLocation.of(bucket.name(), resultsDirectory.path(s))).addReportComponents(bqrComponent("png", bucket, resultsDirectory, metadata.reference().sampleName())).addReportComponents(bqrComponent("tsv", bucket, resultsDirectory, metadata.reference().sampleName())));
    somaticTumorSampleBqrPlot.ifPresent(s -> builder.maybeSomaticTumorSampleBqrPlot(GoogleStorageLocation.of(bucket.name(), resultsDirectory.path(s))).addReportComponents(bqrComponent("png", bucket, resultsDirectory, metadata.tumor().sampleName())).addReportComponents(bqrComponent("tsv", bucket, resultsDirectory, metadata.tumor().sampleName())));
    return builder.addFailedLogLocations(GoogleStorageLocation.of(bucket.name(), RunLogComponent.LOG_FILE)).maybeGermlineGeneCoverage(GoogleStorageLocation.of(bucket.name(), resultsDirectory.path(geneCoverageFile))).maybeSomaticTumorSampleBqrPlot(somaticTumorSampleBqrPlot.map(t -> GoogleStorageLocation.of(bucket.name(), resultsDirectory.path(t)))).maybeVariants(GoogleStorageLocation.of(bucket.name(), resultsDirectory.path(filteredOutputFile))).addReportComponents(bqrComponent("png", bucket, resultsDirectory, metadata.sampleName())).addReportComponents(bqrComponent("tsv", bucket, resultsDirectory, metadata.sampleName())).addReportComponents(vcfComponent(unfilteredOutputFile, bucket, resultsDirectory)).addReportComponents(vcfComponent(filteredOutputFile, bucket, resultsDirectory)).addReportComponents(singleFileComponent(geneCoverageFile, bucket, resultsDirectory)).addReportComponents(new RunLogComponent(bucket, namespace(), Folder.root(), resultsDirectory)).addReportComponents(new StartupScriptComponent(bucket, namespace(), Folder.root())).addDatatypes(new AddDatatype(sageConfiguration.vcfDatatype(), metadata.barcode(), new ArchivePath(Folder.root(), namespace(), filteredOutputFile))).addDatatypes(new AddDatatype(sageConfiguration.geneCoverageDatatype(), metadata.barcode(), new ArchivePath(Folder.root(), namespace(), geneCoverageFile))).addAllDatatypes(somaticRefSampleBqrPlot.stream().map(r -> new AddDatatype(sageConfiguration.tumorSampleBqrPlot(), metadata.barcode(), new ArchivePath(Folder.root(), namespace(), r))).collect(Collectors.toList())).addAllDatatypes(somaticTumorSampleBqrPlot.stream().map(t -> new AddDatatype(sageConfiguration.refSampleBqrPlot(), metadata.barcode(), new ArchivePath(Folder.root(), namespace(), t))).collect(Collectors.toList()));
}
Also used : ZippedVcfAndIndexComponent(com.hartwig.pipeline.report.ZippedVcfAndIndexComponent) SubStageInputOutput(com.hartwig.pipeline.stages.SubStageInputOutput) BashCommand(com.hartwig.pipeline.execution.vm.BashCommand) VirtualMachineJobDefinition(com.hartwig.pipeline.execution.vm.VirtualMachineJobDefinition) AlignmentPair(com.hartwig.pipeline.alignment.AlignmentPair) RuntimeBucket(com.hartwig.pipeline.storage.RuntimeBucket) PipelineStatus(com.hartwig.pipeline.execution.PipelineStatus) PersistedDataset(com.hartwig.pipeline.reruns.PersistedDataset) BashStartupScript(com.hartwig.pipeline.execution.vm.BashStartupScript) GoogleStorageLocation(com.hartwig.pipeline.storage.GoogleStorageLocation) TertiaryStage(com.hartwig.pipeline.tertiary.TertiaryStage) ArchivePath(com.hartwig.pipeline.metadata.ArchivePath) Folder(com.hartwig.pipeline.report.Folder) ResultsDirectory(com.hartwig.pipeline.ResultsDirectory) Collectors(java.util.stream.Collectors) String.format(java.lang.String.format) SingleFileComponent(com.hartwig.pipeline.report.SingleFileComponent) List(java.util.List) AddDatatype(com.hartwig.pipeline.metadata.AddDatatype) SomaticRunMetadata(com.hartwig.pipeline.metadata.SomaticRunMetadata) PersistedLocations(com.hartwig.pipeline.reruns.PersistedLocations) Optional(java.util.Optional) StartupScriptComponent(com.hartwig.pipeline.report.StartupScriptComponent) ReportComponent(com.hartwig.pipeline.report.ReportComponent) RunLogComponent(com.hartwig.pipeline.report.RunLogComponent) ArchivePath(com.hartwig.pipeline.metadata.ArchivePath) RunLogComponent(com.hartwig.pipeline.report.RunLogComponent) StartupScriptComponent(com.hartwig.pipeline.report.StartupScriptComponent) AddDatatype(com.hartwig.pipeline.metadata.AddDatatype)

Example 2 with StartupScriptComponent

use of com.hartwig.pipeline.report.StartupScriptComponent in project pipeline5 by hartwigmedical.

the class Gripss method output.

@Override
public GripssOutput output(final SomaticRunMetadata metadata, final PipelineStatus jobStatus, final RuntimeBucket bucket, final ResultsDirectory resultsDirectory) {
    String filteredVcfFile = filteredVcf(metadata);
    String unfilteredVcfFile = unfilteredVcf(metadata);
    return GripssOutput.builder(namespace()).status(jobStatus).maybeFilteredVariants(GoogleStorageLocation.of(bucket.name(), resultsDirectory.path(basename(filteredVcfFile)))).maybeUnfilteredVariants(GoogleStorageLocation.of(bucket.name(), resultsDirectory.path(basename(unfilteredVcfFile)))).addFailedLogLocations(GoogleStorageLocation.of(bucket.name(), RunLogComponent.LOG_FILE)).addReportComponents(new ZippedVcfAndIndexComponent(bucket, namespace(), Folder.root(), basename(unfilteredVcfFile), basename(unfilteredVcfFile), resultsDirectory)).addReportComponents(new ZippedVcfAndIndexComponent(bucket, namespace(), Folder.root(), basename(filteredVcfFile), basename(filteredVcfFile), resultsDirectory)).addReportComponents(new RunLogComponent(bucket, namespace(), Folder.root(), resultsDirectory)).addReportComponents(new StartupScriptComponent(bucket, namespace(), Folder.root())).addDatatypes(new AddDatatype(unfilteredDatatype(), metadata.barcode(), new ArchivePath(Folder.root(), namespace(), basename(unfilteredVcfFile))), new AddDatatype(filteredDatatype(), metadata.barcode(), new ArchivePath(Folder.root(), namespace(), basename(filteredVcfFile)))).build();
}
Also used : ArchivePath(com.hartwig.pipeline.metadata.ArchivePath) RunLogComponent(com.hartwig.pipeline.report.RunLogComponent) StartupScriptComponent(com.hartwig.pipeline.report.StartupScriptComponent) AddDatatype(com.hartwig.pipeline.metadata.AddDatatype) ZippedVcfAndIndexComponent(com.hartwig.pipeline.report.ZippedVcfAndIndexComponent)

Example 3 with StartupScriptComponent

use of com.hartwig.pipeline.report.StartupScriptComponent in project pipeline5 by hartwigmedical.

the class CramConversion method output.

@Override
public CramOutput output(final SingleSampleRunMetadata metadata, final PipelineStatus jobStatus, final RuntimeBucket bucket, final ResultsDirectory resultsDirectory) {
    String cram = new File(outputCram).getName();
    String crai = FileTypes.crai(cram);
    Folder folder = Folder.from(metadata);
    return CramOutput.builder().status(jobStatus).addFailedLogLocations(GoogleStorageLocation.of(bucket.name(), RunLogComponent.LOG_FILE)).addReportComponents(new RunLogComponent(bucket, NAMESPACE, folder, resultsDirectory), new StartupScriptComponent(bucket, NAMESPACE, folder), new SingleFileComponent(bucket, NAMESPACE, folder, cram, cram, resultsDirectory), new SingleFileComponent(bucket, NAMESPACE, folder, crai, crai, resultsDirectory)).addDatatypes(new AddDatatype(DataType.ALIGNED_READS, metadata.barcode(), new ArchivePath(Folder.from(metadata), namespace(), cram)), new AddDatatype(DataType.ALIGNED_READS_INDEX, metadata.barcode(), new ArchivePath(Folder.from(metadata), namespace(), crai))).build();
}
Also used : SingleFileComponent(com.hartwig.pipeline.report.SingleFileComponent) ArchivePath(com.hartwig.pipeline.metadata.ArchivePath) RunLogComponent(com.hartwig.pipeline.report.RunLogComponent) StartupScriptComponent(com.hartwig.pipeline.report.StartupScriptComponent) Folder(com.hartwig.pipeline.report.Folder) File(java.io.File) AddDatatype(com.hartwig.pipeline.metadata.AddDatatype)

Aggregations

AddDatatype (com.hartwig.pipeline.metadata.AddDatatype)3 ArchivePath (com.hartwig.pipeline.metadata.ArchivePath)3 RunLogComponent (com.hartwig.pipeline.report.RunLogComponent)3 StartupScriptComponent (com.hartwig.pipeline.report.StartupScriptComponent)3 Folder (com.hartwig.pipeline.report.Folder)2 SingleFileComponent (com.hartwig.pipeline.report.SingleFileComponent)2 ZippedVcfAndIndexComponent (com.hartwig.pipeline.report.ZippedVcfAndIndexComponent)2 ResultsDirectory (com.hartwig.pipeline.ResultsDirectory)1 AlignmentPair (com.hartwig.pipeline.alignment.AlignmentPair)1 PipelineStatus (com.hartwig.pipeline.execution.PipelineStatus)1 BashCommand (com.hartwig.pipeline.execution.vm.BashCommand)1 BashStartupScript (com.hartwig.pipeline.execution.vm.BashStartupScript)1 VirtualMachineJobDefinition (com.hartwig.pipeline.execution.vm.VirtualMachineJobDefinition)1 SomaticRunMetadata (com.hartwig.pipeline.metadata.SomaticRunMetadata)1 ReportComponent (com.hartwig.pipeline.report.ReportComponent)1 PersistedDataset (com.hartwig.pipeline.reruns.PersistedDataset)1 PersistedLocations (com.hartwig.pipeline.reruns.PersistedLocations)1 SubStageInputOutput (com.hartwig.pipeline.stages.SubStageInputOutput)1 GoogleStorageLocation (com.hartwig.pipeline.storage.GoogleStorageLocation)1 RuntimeBucket (com.hartwig.pipeline.storage.RuntimeBucket)1