diff --git a/.dockstore.yml b/.dockstore.yml index d050801..4ce4927 100644 --- a/.dockstore.yml +++ b/.dockstore.yml @@ -123,4 +123,9 @@ workflows: subclass: WDL primaryDescriptorPath: /TAG_Mop/TAG_Mop.wdl testParameterFiles: - - /TAG_Mop/TAG_Mop.inputs.json \ No newline at end of file + - /TAG_Mop/TAG_Mop.inputs.json + - name: QUICviz + subclass: WDL + primaryDescriptorPath: /PECGS-QUICviz/QUICviz.wdl + testParameterFiles: + - /PECGS-QUICviz/QUICviz.inputs.json 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..2c7279b --- /dev/null +++ b/PECGS-QUICviz/QUICviz.wdl @@ -0,0 +1,124 @@ +version 1.0 + +workflow QUICviz { + input { + String sampleID + String tumorType + String quicvizDocker = "us-central1-docker.pkg.dev/tag-team-160914/gptag-dockers/cmi_quicviz:0.3.1" + File allelicCountsNormal + File allelicCountsTumor + File denoisedCopyRatiosNormal + File denoisedCopyRatiosTumor + File calledCopyRatioSegTumor + File oncotatedCalledTumor + } + call QUICviz { + input: + sampleID = sampleID, + tumorType = tumorType, + quicvizDocker = quicvizDocker, + allelicCountsNormal = allelicCountsNormal, + allelicCountsTumor = allelicCountsTumor, + denoisedCopyRatiosNormal = denoisedCopyRatiosNormal, + denoisedCopyRatiosTumor = denoisedCopyRatiosTumor, + 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 + } + 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 + String quicvizDocker + File allelicCountsNormal + File allelicCountsTumor + File denoisedCopyRatiosNormal + File denoisedCopyRatiosTumor + File calledCopyRatioSegTumor + File oncotatedCalledTumor + Int memory = 16 + Int cpu = 4 + } + command <<< + set -e + mkdir outputs + + Rscript /BaseImage/CMI_QUICviz/scripts/CMI_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 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 + + python3 <>> + output { + File chr_pdf = "output/~{SampleID}_~{TumorType}_QUICviz.pdf" + File allchr_plot = "output/images/All_chr.png" + } + runtime { + docker: quicvizDocker + memory: memory + " GB" + cpu: cpu + disks: "local-disk 100 HDD" + } +} \ No newline at end of file