diff --git a/PECGS-QUICviz/QUICviz.wdl b/PECGS-QUICviz/QUICviz.wdl index 2c7279b..9238055 100644 --- a/PECGS-QUICviz/QUICviz.wdl +++ b/PECGS-QUICviz/QUICviz.wdl @@ -3,8 +3,9 @@ version 1.0 workflow QUICviz { input { String sampleID + Boolean isPECGS = true String tumorType - String quicvizDocker = "us-central1-docker.pkg.dev/tag-team-160914/gptag-dockers/cmi_quicviz:0.3.1" + String quicvizDocker = "us-central1-docker.pkg.dev/tag-team-160914/gptag-dockers/cmi_quicviz:0.4.2" File allelicCountsNormal File allelicCountsTumor File denoisedCopyRatiosNormal @@ -24,29 +25,23 @@ workflow QUICviz { calledCopyRatioSegTumor = calledCopyRatioSegTumor, oncotatedCalledTumor = oncotatedCalledTumor } - - Array[File] QUICvizPlots = QUICviz.plot - call mergeImages { - input: - SampleID = sampleID, - TumorType = tumorType, - plot = QUICvizPlots, - quicvizDocker = quicvizDocker - } output { - File QUICvizPDF = mergeImages.chr_pdf - File AllChrPlot = mergeImages.allchr_plot + File QUICvizPDF = QUICviz.QUICvizPDF + File GeneLevelCNV = QUICviz.GeneLevelCNV + File AllChrPlot = QUICviz.AllChrPlot } + 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" + description: "QUICviz.wdl is based on the QUICviz_v0.4 R script developed by Alex Neil, which is a tool for visualizing CNV data" } } task QUICviz { input { String sampleID + Boolean isPECGS String tumorType String quicvizDocker File allelicCountsNormal @@ -57,13 +52,24 @@ task QUICviz { File oncotatedCalledTumor Int memory = 16 Int cpu = 4 + Int maxRetries = 3 } command <<< set -e mkdir outputs - Rscript /BaseImage/CMI_QUICviz/scripts/CMI_QUICviz_v0.3.R \ - --sample ~{sampleID} \ + if ~{isPECGS}; then + IFS='-' read -r tumor_sample normal_sample <<< "~{sampleID}" + echo "Input Tumor Sample: $tumor_sample" + echo "Input Normal Sample: $normal_sample" + else + tumor_sample=~{sampleID} + echo "Input Tumor Sample: $tumor_sample" + fi + + + Rscript /BaseImage/CMI_QUICviz/scripts/CMI_QUICviz_v0.4.2.R \ + --sample $tumor_sample \ --tumor_type ~{tumorType} \ --normal_acf ~{allelicCountsNormal} \ --normal_cr ~{denoisedCopyRatiosNormal} \ @@ -73,52 +79,21 @@ task QUICviz { --tumor_seg_oncotated ~{oncotatedCalledTumor} \ --output_dir outputs/ - >>> - output { - Array[File] plot = glob("outputs/*.png") - } - runtime { - docker: quicvizDocker - memory: memory + " GB" - cpu: cpu - disks: "local-disk 100 HDD" - } -} -task mergeImages { - input { - 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 + mv outputs/*chromosome_plots.pdf outputs/~{sampleID}_chromosome_plots.pdf + mv outputs/*gene_level_calls.csv outputs/~{sampleID}_gene_level_calls.csv + mv outputs/*_all_chr.png outputs/~{sampleID}_All_chr.png - python3 <>> output { - File chr_pdf = "output/~{SampleID}_~{TumorType}_QUICviz.pdf" - File allchr_plot = "output/images/All_chr.png" + File QUICvizPDF = "outputs/~{sampleID}_chromosome_plots.pdf" + File GeneLevelCNV = "outputs/~{sampleID}_gene_level_calls.csv" + File AllChrPlot = "outputs/~{sampleID}_All_chr.png" } runtime { docker: quicvizDocker memory: memory + " GB" cpu: cpu disks: "local-disk 100 HDD" + maxRetries: maxRetries } -} \ No newline at end of file +}