Skip to content

Commit

Permalink
first commit of QUICviz WDL
Browse files Browse the repository at this point in the history
  • Loading branch information
yueyaog committed Apr 17, 2024
1 parent 84ae130 commit c635de1
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .dockstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,9 @@ workflows:
subclass: WDL
primaryDescriptorPath: /CleanupFailedSubmissions/Cleanup_Failed_Submissions.wdl
testParameterFiles:
- /CleanupFailedSubmissions/Cleanup_Failed_Submissions.inputs.json
- /CleanupFailedSubmissions/Cleanup_Failed_Submissions.inputs.json
- name: QUICviz
subclass: WDL
primaryDescriptorPath: /PECGS-QUICviz/QUICviz.wdl
testParameterFiles:
- /PECGS-QUICviz/QUICviz.inputs.json
11 changes: 11 additions & 0 deletions PECGS-QUICviz/QUICviz.inputs.json
Original file line number Diff line number Diff line change
@@ -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"
}

104 changes: 104 additions & 0 deletions PECGS-QUICviz/QUICviz.wdl
Original file line number Diff line number Diff line change
@@ -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: "[email protected]"
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 <<CODE
pip3 install img2pdf
import img2pdf
import glob
import os
with open(f"/output/~{SampleID}_~{TumorType}_QUICviz.pdf","wb") as f:
f.write(img2pdf.convert(glob.glob("/output/images/*.jpg")))
CODE
>>>
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"
}
}

0 comments on commit c635de1

Please sign in to comment.