From c635de101170252de9adb13a418db66d6a9e5176 Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Wed, 17 Apr 2024 18:21:37 -0400 Subject: [PATCH 01/23] first commit of QUICviz WDL --- .dockstore.yml | 7 +- PECGS-QUICviz/QUICviz.inputs.json | 11 ++++ PECGS-QUICviz/QUICviz.wdl | 104 ++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 PECGS-QUICviz/QUICviz.inputs.json create mode 100644 PECGS-QUICviz/QUICviz.wdl diff --git a/.dockstore.yml b/.dockstore.yml index 74db3c3..8bc0a06 100644 --- a/.dockstore.yml +++ b/.dockstore.yml @@ -118,4 +118,9 @@ workflows: subclass: WDL primaryDescriptorPath: /CleanupFailedSubmissions/Cleanup_Failed_Submissions.wdl testParameterFiles: - - /CleanupFailedSubmissions/Cleanup_Failed_Submissions.inputs.json \ No newline at end of file + - /CleanupFailedSubmissions/Cleanup_Failed_Submissions.inputs.json + - name: QUICviz + subclass: WDL + primaryDescriptorPath: /PECGS-QUICviz/QUICviz.wdl + testParameterFiles: + - /PECGS-QUICviz/QUICviz.inputs.json \ No newline at end of file diff --git a/PECGS-QUICviz/QUICviz.inputs.json b/PECGS-QUICviz/QUICviz.inputs.json new file mode 100644 index 0000000..755606c --- /dev/null +++ b/PECGS-QUICviz/QUICviz.inputs.json @@ -0,0 +1,11 @@ +{ + "QUICviz.calledCopyRatioSegTumor": "File", + "QUICviz.oncotatedCalledTumor": "File", + "QUICviz.allelicCountsNormal": "File", + "QUICviz.denoisedCopyRatiosTumor": "File", + "QUICviz.denoisedCopyRatiosNormal": "File", + "QUICviz.allelicCountsTumor": "File", + "QUICviz.tumorType": "String", + "QUICviz.sampleID": "String" +} + diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl new file mode 100644 index 0000000..6260a8b --- /dev/null +++ b/PECGS-QUICviz/QUICviz.wdl @@ -0,0 +1,104 @@ +version 1.0 + +workflow QUICviz { + input { + String sampleID + String tumorType + File allelicCountsNormal + File allelicCountsTumor + File denoisedCopyRatiosNormal + File denoisedCopyRatiosTumor + File calledCopyRatioSegTumor + File oncotatedCalledTumor + } + call QUICviz { + input: + sampleID = sampleID, + tumorType = tumorType, + allelicCountsNormal = allelicCountsNormal, + allelicCountsTumor = allelicCountsTumor, + denoisedCopyRatiosNormal = denoisedCopyRatiosNormal, + denoisedCopyRatiosTumor = denoisedCopyRatiosTumor, + calledCopyRatioSegTumor = calledCopyRatioSegTumor, + oncotatedCalledTumor = oncotatedCalledTumor + } + call mergeImages { + input: + SampleID = sampleID, + TumorType = tumorType, + plot = QUICviz.plot + } + output { + File QUICvizPDF = mergeImages.compiled_pdf + } + meta { + author: "Yueyao Gao" + email: "tag@broadinstitute.org" + description: "QUICviz.wdl is based on the QUICviz_v0.3 R script developed by Alex Neil, which is a tool for visualizing CNV data" + } +} + +task QUICviz { + input { + String sampleID + String tumorType + File allelicCountsNormal + File allelicCountsTumor + File denoisedCopyRatiosNormal + File denoisedCopyRatiosTumor + File calledCopyRatioSegTumor + File oncotatedCalledTumor + } + command <<< + Rscript /BaseImage/CMI_QUICviz/scripts/QUICviz_v0.3.R \ + --sample ~{sampleID} \ + --tumor_type ~{tumorType} \ + --normal_acf ~{allelicCountsNormal} \ + --normal_cr ~{denoisedCopyRatiosNormal} \ + --tumor_acf ~{allelicCountsTumor} \ + --tumor_cr ~{denoisedCopyRatiosTumor} \ + --tumor_cr_seg ~{calledCopyRatioSegTumor} \ + --tumor_seg_oncotated ~{oncotatedCalledTumor} \ + --output_dir /BaseImage/CMI_QUICviz/outputs/ + + >>> + output { + Array[File] plot = glob("/BaseImage/CMI_QUICviz/outputs/*.png") + } + runtime { + docker: "us-central1-docker.pkg.dev/tag-team-160914/gptag-dockers/cmi_quicviz:0.3.0" + memory: "16 GB" + cpu: "4" + disks: "local-disk 100 HDD" + } +} +task mergeImages { + input { + String SampleID + String TumorType + Array[File] plot + } + command <<< + for i in ~{plot}; do mv $i /output/images/; done + + python <>> + output { + File compiled_pdf = "/output/~{SampleID}_~{TumorType}_QUICviz.pdf" + } + runtime { + docker: "us.gcr.io/tag-team-160914/neovax-parsley:2.2.1.0" + memory: "16 GB" + cpu: "4" + disks: "local-disk 100 HDD" + } +} \ No newline at end of file From ddb59ba57c347f5689f89bcfe5d79012412da143 Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Thu, 18 Apr 2024 09:02:00 -0400 Subject: [PATCH 02/23] adjust the output path --- PECGS-QUICviz/QUICviz.wdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 6260a8b..2471906 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -63,7 +63,7 @@ task QUICviz { >>> output { - Array[File] plot = glob("/BaseImage/CMI_QUICviz/outputs/*.png") + Array[File] plot = glob("outputs/*.png") } runtime { docker: "us-central1-docker.pkg.dev/tag-team-160914/gptag-dockers/cmi_quicviz:0.3.0" From 7f392e39c1028ff4e3a9f894c894c8c9580c6576 Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Thu, 18 Apr 2024 09:17:18 -0400 Subject: [PATCH 03/23] make docker image an optional input --- PECGS-QUICviz/QUICviz.wdl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 2471906..1f24df6 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -4,6 +4,7 @@ workflow QUICviz { input { String sampleID String tumorType + String quicvizDocker = "us-central1-docker.pkg.dev/tag-team-160914/gptag-dockers/cmi_quicviz:0.3.0" File allelicCountsNormal File allelicCountsTumor File denoisedCopyRatiosNormal @@ -15,6 +16,7 @@ workflow QUICviz { input: sampleID = sampleID, tumorType = tumorType, + quicvizDocker = quicvizDocker, allelicCountsNormal = allelicCountsNormal, allelicCountsTumor = allelicCountsTumor, denoisedCopyRatiosNormal = denoisedCopyRatiosNormal, @@ -42,6 +44,7 @@ task QUICviz { input { String sampleID String tumorType + String quicvizDocker File allelicCountsNormal File allelicCountsTumor File denoisedCopyRatiosNormal @@ -66,7 +69,7 @@ task QUICviz { Array[File] plot = glob("outputs/*.png") } runtime { - docker: "us-central1-docker.pkg.dev/tag-team-160914/gptag-dockers/cmi_quicviz:0.3.0" + docker: quicvizDocker memory: "16 GB" cpu: "4" disks: "local-disk 100 HDD" From 12600b8cd47dd9a3802f98c3d920e8985e69050e Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Thu, 18 Apr 2024 09:33:19 -0400 Subject: [PATCH 04/23] specify R script PATH --- PECGS-QUICviz/QUICviz.wdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 1f24df6..dc8fc75 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -53,7 +53,7 @@ task QUICviz { File oncotatedCalledTumor } command <<< - Rscript /BaseImage/CMI_QUICviz/scripts/QUICviz_v0.3.R \ + /usr/local/bin/Rscript /BaseImage/CMI_QUICviz/scripts/QUICviz_v0.3.R \ --sample ~{sampleID} \ --tumor_type ~{tumorType} \ --normal_acf ~{allelicCountsNormal} \ From 520a4befa163aad3e5995d08814b131198912c54 Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Thu, 18 Apr 2024 09:56:18 -0400 Subject: [PATCH 05/23] test Rscript with help message --- PECGS-QUICviz/QUICviz.wdl | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index dc8fc75..1bba1e9 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -53,16 +53,20 @@ task QUICviz { File oncotatedCalledTumor } command <<< - /usr/local/bin/Rscript /BaseImage/CMI_QUICviz/scripts/QUICviz_v0.3.R \ - --sample ~{sampleID} \ - --tumor_type ~{tumorType} \ - --normal_acf ~{allelicCountsNormal} \ - --normal_cr ~{denoisedCopyRatiosNormal} \ - --tumor_acf ~{allelicCountsTumor} \ - --tumor_cr ~{denoisedCopyRatiosTumor} \ - --tumor_cr_seg ~{calledCopyRatioSegTumor} \ - --tumor_seg_oncotated ~{oncotatedCalledTumor} \ - --output_dir /BaseImage/CMI_QUICviz/outputs/ + set -e + Sys.which("Rscript") + + /usr/local/bin/Rscript /BaseImage/CMI_QUICviz/scripts/QUICviz_v0.3.R -h +# \ +# --sample ~{sampleID} \ +# --tumor_type ~{tumorType} \ +# --normal_acf ~{allelicCountsNormal} \ +# --normal_cr ~{denoisedCopyRatiosNormal} \ +# --tumor_acf ~{allelicCountsTumor} \ +# --tumor_cr ~{denoisedCopyRatiosTumor} \ +# --tumor_cr_seg ~{calledCopyRatioSegTumor} \ +# --tumor_seg_oncotated ~{oncotatedCalledTumor} \ +# --output_dir /BaseImage/CMI_QUICviz/outputs/ >>> output { From 89d5a98f14b73783194bbcb6f8500bdb856ced35 Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Thu, 18 Apr 2024 11:51:33 -0400 Subject: [PATCH 06/23] modified QUICviz docker image and update the R command --- PECGS-QUICviz/QUICviz.wdl | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 1bba1e9..a50f01c 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -54,19 +54,17 @@ task QUICviz { } command <<< set -e - Sys.which("Rscript") - /usr/local/bin/Rscript /BaseImage/CMI_QUICviz/scripts/QUICviz_v0.3.R -h -# \ -# --sample ~{sampleID} \ -# --tumor_type ~{tumorType} \ -# --normal_acf ~{allelicCountsNormal} \ -# --normal_cr ~{denoisedCopyRatiosNormal} \ -# --tumor_acf ~{allelicCountsTumor} \ -# --tumor_cr ~{denoisedCopyRatiosTumor} \ -# --tumor_cr_seg ~{calledCopyRatioSegTumor} \ -# --tumor_seg_oncotated ~{oncotatedCalledTumor} \ -# --output_dir /BaseImage/CMI_QUICviz/outputs/ + Rscript /BaseImage/CMI_QUICviz/scripts/QUICviz_v0.3.R \ + --sample ~{sampleID} \ + --tumor_type ~{tumorType} \ + --normal_acf ~{allelicCountsNormal} \ + --normal_cr ~{denoisedCopyRatiosNormal} \ + --tumor_acf ~{allelicCountsTumor} \ + --tumor_cr ~{denoisedCopyRatiosTumor} \ + --tumor_cr_seg ~{calledCopyRatioSegTumor} \ + --tumor_seg_oncotated ~{oncotatedCalledTumor} \ + --output_dir /BaseImage/CMI_QUICviz/outputs/ >>> output { From 045b6daea6307fa96f5ec3bbba41717bb40f919b Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Thu, 18 Apr 2024 12:33:18 -0400 Subject: [PATCH 07/23] fix wrong path --- PECGS-QUICviz/QUICviz.wdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index a50f01c..924409e 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -55,7 +55,7 @@ task QUICviz { command <<< set -e - Rscript /BaseImage/CMI_QUICviz/scripts/QUICviz_v0.3.R \ + Rscript /BaseImage/CMI_QUICviz/scripts/CMI_QUICviz_v0.3.R \ --sample ~{sampleID} \ --tumor_type ~{tumorType} \ --normal_acf ~{allelicCountsNormal} \ From d78b5b0f07fd2317ecaa97358508261c57aecea1 Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Fri, 19 Apr 2024 14:03:29 -0400 Subject: [PATCH 08/23] created the output folder before running QUICviz --- PECGS-QUICviz/QUICviz.wdl | 1 + 1 file changed, 1 insertion(+) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 924409e..43f3aa5 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -54,6 +54,7 @@ task QUICviz { } command <<< set -e + mkdir -p /BaseImage/CMI_QUICviz/outputs/ Rscript /BaseImage/CMI_QUICviz/scripts/CMI_QUICviz_v0.3.R \ --sample ~{sampleID} \ From 93eae4e2ee830d5fd6955a0c2ddcb54c5e1217e3 Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Fri, 19 Apr 2024 14:53:54 -0400 Subject: [PATCH 09/23] updated the output directory --- PECGS-QUICviz/QUICviz.wdl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 43f3aa5..29fabf8 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -67,9 +67,11 @@ task QUICviz { --tumor_seg_oncotated ~{oncotatedCalledTumor} \ --output_dir /BaseImage/CMI_QUICviz/outputs/ + ls /BaseImage/CMI_QUICviz/outputs/ + readlink -f /BaseImage/CMI_QUICviz/outputs/*png >>> output { - Array[File] plot = glob("outputs/*.png") + Array[File] plot = glob("/BaseImage/CMI_QUICviz/outputs/*.png") } runtime { docker: quicvizDocker From aa3323cd6f37e968415945f174ffc9d2d9d1fcfe Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Fri, 19 Apr 2024 15:06:14 -0400 Subject: [PATCH 10/23] added output directory --- PECGS-QUICviz/QUICviz.wdl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 29fabf8..bec5177 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -54,7 +54,7 @@ task QUICviz { } command <<< set -e - mkdir -p /BaseImage/CMI_QUICviz/outputs/ + mkdir outputs Rscript /BaseImage/CMI_QUICviz/scripts/CMI_QUICviz_v0.3.R \ --sample ~{sampleID} \ @@ -65,13 +65,13 @@ task QUICviz { --tumor_cr ~{denoisedCopyRatiosTumor} \ --tumor_cr_seg ~{calledCopyRatioSegTumor} \ --tumor_seg_oncotated ~{oncotatedCalledTumor} \ - --output_dir /BaseImage/CMI_QUICviz/outputs/ + --output_dir outputs/ - ls /BaseImage/CMI_QUICviz/outputs/ - readlink -f /BaseImage/CMI_QUICviz/outputs/*png + ls outputs/ + readlink -f outputs/*png >>> output { - Array[File] plot = glob("/BaseImage/CMI_QUICviz/outputs/*.png") + Array[File] plot = glob("outputs/*.png") } runtime { docker: quicvizDocker From 84aadff4035038f3bafaf36c683414046d605e9e Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Mon, 22 Apr 2024 07:43:00 -0400 Subject: [PATCH 11/23] added sep to the arrayed file --- PECGS-QUICviz/QUICviz.wdl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index bec5177..322b010 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -24,11 +24,13 @@ workflow QUICviz { calledCopyRatioSegTumor = calledCopyRatioSegTumor, oncotatedCalledTumor = oncotatedCalledTumor } + + Array[File] QUICvizPlots = QUICviz.plot call mergeImages { input: SampleID = sampleID, TumorType = tumorType, - plot = QUICviz.plot + plot = QUICvizPlots } output { File QUICvizPDF = mergeImages.compiled_pdf @@ -87,7 +89,7 @@ task mergeImages { Array[File] plot } command <<< - for i in ~{plot}; do mv $i /output/images/; done + for i in `ls ~{sep=" " plot}`; do mv $i /output/images/; done python < Date: Mon, 22 Apr 2024 09:16:42 -0400 Subject: [PATCH 12/23] edited output path --- PECGS-QUICviz/QUICviz.wdl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 322b010..c8f1c58 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -89,7 +89,8 @@ task mergeImages { Array[File] plot } command <<< - for i in `ls ~{sep=" " plot}`; do mv $i /output/images/; done + mkdir -p output/images + for i in `ls ~{sep=" " plot}`; do mv $i output/images/; done python <>> output { - File compiled_pdf = "/output/~{SampleID}_~{TumorType}_QUICviz.pdf" + File compiled_pdf = "output/~{SampleID}_~{TumorType}_QUICviz.pdf" } runtime { docker: "us.gcr.io/tag-team-160914/neovax-parsley:2.2.1.0" From 639b7fca8d4a4ae598d3994b2b8872a4e5fc6725 Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Mon, 22 Apr 2024 09:46:35 -0400 Subject: [PATCH 13/23] updated the conda environment --- PECGS-QUICviz/QUICviz.wdl | 1 + 1 file changed, 1 insertion(+) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index c8f1c58..968473e 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -92,6 +92,7 @@ task mergeImages { mkdir -p output/images for i in `ls ~{sep=" " plot}`; do mv $i output/images/; done + source activate NeoVax-Input-Parser python < Date: Mon, 22 Apr 2024 09:56:09 -0400 Subject: [PATCH 14/23] updated the environment --- PECGS-QUICviz/QUICviz.wdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 968473e..079880f 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -93,8 +93,8 @@ task mergeImages { for i in `ls ~{sep=" " plot}`; do mv $i output/images/; done source activate NeoVax-Input-Parser - python < Date: Mon, 22 Apr 2024 10:14:10 -0400 Subject: [PATCH 15/23] updated the merge file type --- PECGS-QUICviz/QUICviz.wdl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 079880f..33570e4 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -91,6 +91,7 @@ task mergeImages { command <<< mkdir -p output/images for i in `ls ~{sep=" " plot}`; do mv $i output/images/; done + ls output/images/ source activate NeoVax-Input-Parser pip3 install img2pdf @@ -100,7 +101,7 @@ task mergeImages { import os with open(f"output/~{SampleID}_~{TumorType}_QUICviz.pdf","wb") as f: - f.write(img2pdf.convert(glob.glob("output/images/*.jpg"))) + f.write(img2pdf.convert(glob.glob("output/images/*.png"))) CODE >>> From a942592c6a2bba0ea9d2d04ba6288849d34669d9 Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Mon, 22 Apr 2024 10:30:04 -0400 Subject: [PATCH 16/23] sort output before merge --- PECGS-QUICviz/QUICviz.wdl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 33570e4..001061f 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -100,8 +100,14 @@ task mergeImages { import glob import os +# with open(f"output/~{SampleID}_~{TumorType}_QUICviz.pdf","wb") as f: +# f.write(img2pdf.convert(glob.glob("output/images/*.png"))) + + # Get list of PNG files sorted + png_files = sorted(glob.glob("output/images/*.png"), key=lambda x: int(os.path.basename(x).split('.')[0])) + with open(f"output/~{SampleID}_~{TumorType}_QUICviz.pdf","wb") as f: - f.write(img2pdf.convert(glob.glob("output/images/*.png"))) + f.write(img2pdf.convert(png_files)) CODE >>> From d2dad3cbda4b84a03f0c3618d498631b5ed58e5d Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Mon, 22 Apr 2024 11:11:14 -0400 Subject: [PATCH 17/23] updated the PYTHON format --- PECGS-QUICviz/QUICviz.wdl | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 001061f..1a72fe3 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -92,23 +92,19 @@ task mergeImages { mkdir -p output/images for i in `ls ~{sep=" " plot}`; do mv $i output/images/; done ls output/images/ - source activate NeoVax-Input-Parser pip3 install img2pdf + python <>> output { From a88d4caab1a871991e5d2e905dc92a87697c5407 Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Mon, 22 Apr 2024 11:52:21 -0400 Subject: [PATCH 18/23] separate the files --- PECGS-QUICviz/QUICviz.wdl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 1a72fe3..06933de 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -33,7 +33,8 @@ workflow QUICviz { plot = QUICvizPlots } output { - File QUICvizPDF = mergeImages.compiled_pdf + File QUICvizPDF = mergeImages.chr_pdf + File AllChrPlot = mergeImages.allchr_plot } meta { author: "Yueyao Gao" @@ -101,14 +102,17 @@ task mergeImages { import os # Get list of PNG files sorted - png_files = sorted(glob.glob("output/images/*.png"), key=lambda x: int(os.path.basename(x).split('.')[0])) + png_files = sorted(glob.glob("output/images/*.png")) + numeric_png_files = [file for file in png_files if os.path.basename(file).split('.')[0].isdigit()] + png_files = sorted(numeric_png_files, key=lambda x: int(os.path.basename(x).split('.')[0])) with open(f"output/~{SampleID}_~{TumorType}_QUICviz.pdf","wb") as f: f.write(img2pdf.convert(png_files)) CODE >>> output { - File compiled_pdf = "output/~{SampleID}_~{TumorType}_QUICviz.pdf" + File chr_pdf = "output/~{SampleID}_~{TumorType}_QUICviz.pdf" + File allchr_plot = "output/All_chr.png" } runtime { docker: "us.gcr.io/tag-team-160914/neovax-parsley:2.2.1.0" From e0dbb9ed584eb1666d6882fe18829be112b8c306 Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Mon, 22 Apr 2024 12:12:22 -0400 Subject: [PATCH 19/23] Fix output path --- PECGS-QUICviz/QUICviz.wdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 06933de..cc1a3a4 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -112,7 +112,7 @@ task mergeImages { >>> output { File chr_pdf = "output/~{SampleID}_~{TumorType}_QUICviz.pdf" - File allchr_plot = "output/All_chr.png" + File allchr_plot = "output/images/All_chr.png" } runtime { docker: "us.gcr.io/tag-team-160914/neovax-parsley:2.2.1.0" From 4dcfd44b2626c78d155f8cf5ff3245489209997d Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Fri, 26 Apr 2024 13:02:16 -0400 Subject: [PATCH 20/23] make resource optional input --- PECGS-QUICviz/QUICviz.wdl | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index cc1a3a4..c18d1ff 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -30,7 +30,8 @@ workflow QUICviz { input: SampleID = sampleID, TumorType = tumorType, - plot = QUICvizPlots + plot = QUICvizPlots, + quicvizDocker = quicvizDocker } output { File QUICvizPDF = mergeImages.chr_pdf @@ -54,6 +55,8 @@ task QUICviz { File denoisedCopyRatiosTumor File calledCopyRatioSegTumor File oncotatedCalledTumor + Int memory = 16 + Int cpu = 4 } command <<< set -e @@ -70,16 +73,14 @@ task QUICviz { --tumor_seg_oncotated ~{oncotatedCalledTumor} \ --output_dir outputs/ - ls outputs/ - readlink -f outputs/*png >>> output { Array[File] plot = glob("outputs/*.png") } runtime { docker: quicvizDocker - memory: "16 GB" - cpu: "4" + memory: memory + cpu: cpu disks: "local-disk 100 HDD" } } @@ -88,13 +89,13 @@ task mergeImages { String SampleID String TumorType Array[File] plot + String quicvizDocker + Int memory = 16 + Int cpu = 4 } command <<< mkdir -p output/images for i in `ls ~{sep=" " plot}`; do mv $i output/images/; done - ls output/images/ - source activate NeoVax-Input-Parser - pip3 install img2pdf python < Date: Fri, 26 Apr 2024 13:39:41 -0400 Subject: [PATCH 21/23] calling python using python3 in WDL --- PECGS-QUICviz/QUICviz.wdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index c18d1ff..07d2dc7 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -97,7 +97,7 @@ task mergeImages { mkdir -p output/images for i in `ls ~{sep=" " plot}`; do mv $i output/images/; done - python < Date: Fri, 26 Apr 2024 14:28:54 -0400 Subject: [PATCH 22/23] updated the default quicviz docker image --- PECGS-QUICviz/QUICviz.wdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 07d2dc7..6810891 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -4,7 +4,7 @@ workflow QUICviz { input { String sampleID String tumorType - String quicvizDocker = "us-central1-docker.pkg.dev/tag-team-160914/gptag-dockers/cmi_quicviz:0.3.0" + String quicvizDocker = "us-central1-docker.pkg.dev/tag-team-160914/gptag-dockers/cmi_quicviz:0.3.1" File allelicCountsNormal File allelicCountsTumor File denoisedCopyRatiosNormal From 41bcb26a3de8d93096cc9587a04f1c4d56abcb39 Mon Sep 17 00:00:00 2001 From: Yueyao Gao Date: Fri, 26 Apr 2024 14:33:09 -0400 Subject: [PATCH 23/23] added unit to mem --- PECGS-QUICviz/QUICviz.wdl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 6810891..2c7279b 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -79,7 +79,7 @@ task QUICviz { } runtime { docker: quicvizDocker - memory: memory + memory: memory + " GB" cpu: cpu disks: "local-disk 100 HDD" } @@ -117,7 +117,7 @@ task mergeImages { } runtime { docker: quicvizDocker - memory: memory + memory: memory + " GB" cpu: cpu disks: "local-disk 100 HDD" }