-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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.1" | ||
String quicvizDocker = "us-central1-docker.pkg.dev/tag-team-160914/gptag-dockers/cmi_quicviz:0.4.1" | ||
File allelicCountsNormal | ||
File allelicCountsTumor | ||
File denoisedCopyRatiosNormal | ||
|
@@ -24,23 +24,16 @@ 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: "[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" | ||
description: "QUICviz.wdl is based on the QUICviz_v0.4 R script developed by Alex Neil, which is a tool for visualizing CNV data" | ||
} | ||
} | ||
|
||
|
@@ -73,52 +66,17 @@ 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 | ||
|
||
python3 <<CODE | ||
import img2pdf | ||
import glob | ||
import os | ||
|
||
# Get list of PNG files sorted | ||
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 chr_pdf = "output/~{SampleID}_~{TumorType}_QUICviz.pdf" | ||
File allchr_plot = "output/images/All_chr.png" | ||
File QUICvizPDF = "outputs/chromosome_plots.pdf" | ||
File GeneLevelCNV = "outputs/gene_level_calls.csv" | ||
File AllChrPlot = "outputs/All_chr.png" | ||
} | ||
runtime { | ||
docker: quicvizDocker | ||
memory: memory + " GB" | ||
cpu: cpu | ||
disks: "local-disk 100 HDD" | ||
} | ||
} | ||
} |