From 24cc6213026dbe1de017ebeabc2de7fbfad912ae Mon Sep 17 00:00:00 2001
From: DavyCats <davycats.dc@gmail.com>
Date: Mon, 8 Aug 2022 11:11:48 +0200
Subject: [PATCH] make purple's  somaticRainfallPlot output optional

---
 CHANGELOG.md | 2 ++
 hmftools.wdl | 6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index f750b21..be0e5a7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,8 @@ that users understand how the changes affect the new version.
 -->
 version 5.1.0-dev
 ---------------------------
++ Purple's `somaticRainfallPlot` output is now optional and included in
+  the `plots` output as well.
 + Bedtools coverage's timeMinutes now defaults to `320`.
 + Gridss' runtime attribute defaults were changed to:
   + jvmHeapSizeGb: `64`
diff --git a/hmftools.wdl b/hmftools.wdl
index 1542bdf..f878181 100644
--- a/hmftools.wdl
+++ b/hmftools.wdl
@@ -1133,7 +1133,7 @@ task Purple {
         File segmentPlot = "~{outputDir}/plot/~{tumorName}.segment.png"
         File somaticClonalityPlot = "~{outputDir}/plot/~{tumorName}.somatic.clonality.png"
         File somaticPlot = "~{outputDir}/plot/~{tumorName}.somatic.png"
-        File somaticRainfallPlot = "~{outputDir}/plot/~{tumorName}.somatic.rainfall.png"
+        File? somaticRainfallPlot = "~{outputDir}/plot/~{tumorName}.somatic.rainfall.png"
         File circosNormalRatio = "~{outputDir}/circos/~{referenceName}.ratio.circos"
         File circosBaf = "~{outputDir}/circos/~{tumorName}.baf.circos"
         File circosConf = "~{outputDir}/circos/~{tumorName}.circos.conf"
@@ -1150,8 +1150,8 @@ task Purple {
             purpleSegmentTsv, purpleSomaticClonalityTsv, purpleSomaticHistTsv,
             purpleSomaticVcf, purpleSomaticVcfIndex, purpleSvVcf, purpleSvVcfIndex,
             purpleVersion, purpleGermlineVcf, purpleGermlineVcfIndex, driverCatalogGermlineTsv]
-        Array[File] plots = [circosPlot, copynumberPlot, inputPlot, mapPlot, purityRangePlot,
-            segmentPlot, somaticClonalityPlot, somaticPlot]
+        Array[File] plots = select_all([circosPlot, copynumberPlot, inputPlot, mapPlot, purityRangePlot,
+            segmentPlot, somaticClonalityPlot, somaticPlot, somaticRainfallPlot])
         Array[File] circos = [circosNormalRatio, circosConf, circosIndel, circosLink,
             circosTumorRatio, circosGaps, circosBaf, circosCnv, circosInputConf, circosMap,
             circosSnp]
-- 
GitLab