Skip to content

Commit 8681ffb

Browse files
committed
checkin
1 parent cb693a4 commit 8681ffb

1 file changed

Lines changed: 79 additions & 27 deletions

File tree

wdl/SVShell.wdl

Lines changed: 79 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,19 @@ workflow SVShell {
8686
output {
8787
File test = RunSVShell.test
8888
File test2 = RunSVShell.test2
89-
# File final_vcf = RunSVShell.final_vcf
90-
# File pre_cleanup_vcf = RunSVShell.pre_cleanup_vcf
91-
# File stripy_json_output = RunSVShell.stripy_json_output
92-
# File metrics_file = RunSVShell.metrics_file
93-
# File ploidy_matrix = RunSVShell.ploidy_matrix
89+
File final_vcf = RunSVShell.final_vcf
90+
File final_vcf_idx = RunSVShell.final_vcf_idx
91+
File pre_cleanup_vcf = RunSVShell.pre_cleanup_vcf
92+
File pre_cleanup_vcf_idx = RunSVShell.pre_cleanup_vcf_idx
93+
File stripy_json_output = RunSVShell.stripy_json_output
94+
File stripy_tsv_output = RunSVShell.stripy_tsv_output
95+
File stripy_html_output = RunSVShell.stripy_html_output
96+
File stripy_vcf_output = RunSVShell.stripy_vcf_output
97+
File metrics_file = RunSVShell.metrics_file
98+
File qc_file = RunSVShell.qc_file
99+
File ploidy_matrix = RunSVShell.ploidy_matrix
100+
File ploidy_plots = RunSVShell.ploidy_plots
101+
File non_genotyped_unique_depth_calls = RunSVShell.non_genotyped_unique_depth_calls
94102
}
95103
}
96104

@@ -194,9 +202,24 @@ task RunSVShell {
194202
RuntimeAttr? runtime_attr_override
195203
}
196204

205+
String final_vcf_filename = sample_id + ".gatk_sv.vcf.gz"
206+
String final_vcf_idx_filename = final_vcf_filename + ".tbi"
207+
String pre_cleanup_vcf_filename = batch + ".annotated.vcf.gz"
208+
String pre_cleanup_vcf_idx_filename = pre_cleanup_vcf_filename + ".tbi"
209+
String stripy_json_filename = sample_id + ".stripy.json"
210+
String stripy_tsv_filename = sample_id + ".stripy.tsv"
211+
String stripy_html_filename = sample_id + ".stripy.html"
212+
String stripy_vcf_filename = sample_id + ".stripy.vcf"
213+
String metrics_filename = "single_sample." + batch + ".metrics.tsv"
214+
String qc_filename = "sv_qc." + batch + ".tsv"
215+
String ploidy_matrix_filename = batch + "_ploidy_matrix.bed.gz"
216+
String ploidy_plots_filename = batch + "_ploidy_plots.tar.gz"
217+
String non_genotyped_unique_depth_calls_filename = batch + ".non_genotyped_unique_depth_calls.vcf.gz"
218+
197219
command <<<
198220
set -Exeuo pipefail
199221
222+
export BASE_DIR="${PWD}"
200223
export SV_SHELL_BASE_DIR="${PWD}/wd"
201224
export TMPDIR="${PWD}/wd/tmp"
202225
mkdir -p "${PWD}/wd/tmp"
@@ -297,33 +320,62 @@ task RunSVShell {
297320
298321
echo "----------------------"
299322
echo "${PWD}"
300-
cp "${SV_SHELL_BASE_DIR}/single_sample_pipeline_inputs.json" .
301-
cp "${SV_SHELL_BASE_DIR}/single_sample_pipeline_outputs.json" .
323+
cp "${SV_SHELL_BASE_DIR}/single_sample_pipeline_inputs.json" "${BASE_DIR}/"
324+
cp "${SV_SHELL_BASE_DIR}/single_sample_pipeline_outputs.json" "${BASE_DIR}/"
302325
ls
303326
304-
final_vcf=$(jq -r '.final_vcf' "${SV_SHELL_BASE_DIR}/single_sample_pipeline_outputs.json")
305-
mv "${final_vcf}" "${SV_SHELL_BASE_DIR}/final_vcf.vcf.gz"
306-
mv "${final_vcf}.tbi" "${SV_SHELL_BASE_DIR}/final_vcf.vcf.gz.tbi"
327+
final_vcf_path=$(jq -r '.final_vcf' "${BASE_DIR}/single_sample_pipeline_outputs.json")
328+
mv "${final_vcf_path}" "${BASE_DIR}/~{final_vcf_filename}"
329+
mv "${final_vcf_path}.tbi" "${BASE_DIR}/~{final_vcf_idx_filename}"
330+
331+
pre_cleanup_vcf_path=$(jq -r '.pre_cleanup_vcf' "${BASE_DIR}/single_sample_pipeline_outputs.json")
332+
mv "${pre_cleanup_vcf_path}" "${BASE_DIR}/~{pre_cleanup_vcf_filename}"
333+
mv "${pre_cleanup_vcf_path}.tbi" "${BASE_DIR}/~{pre_cleanup_vcf_idx_filename}"
334+
335+
stripy_json_path=$(jq -r '.stripy_json_output' "${BASE_DIR}/single_sample_pipeline_outputs.json")
336+
mv "${stripy_json_path}" "${BASE_DIR}/~{stripy_json_filename}"
337+
338+
stripy_tsv_path=$(jq -r '.stripy_tsv_output' "${BASE_DIR}/single_sample_pipeline_outputs.json")
339+
mv "${stripy_tsv_path}" "${BASE_DIR}/~{stripy_tsv_filename}"
340+
341+
stripy_html_path=$(jq -r '.stripy_html_output' "${BASE_DIR}/single_sample_pipeline_outputs.json")
342+
mv "${stripy_html_path}" "${BASE_DIR}/~{stripy_html_filename}"
343+
344+
stripy_vcf_path=$(jq -r '.stripy_vcf_output' "${BASE_DIR}/single_sample_pipeline_outputs.json")
345+
mv "${stripy_vcf_path}" "${BASE_DIR}/~{stripy_vcf_filename}"
346+
347+
metrics_path=$(jq -r '.metrics_file' "${BASE_DIR}/single_sample_pipeline_outputs.json")
348+
mv "${metrics_path}" "${BASE_DIR}/~{metrics_filename}"
349+
350+
qc_path=$(jq -r '.qc_file' "${BASE_DIR}/single_sample_pipeline_outputs.json")
351+
mv "${qc_path}" "${BASE_DIR}/~{qc_filename}"
352+
353+
ploidy_matrix_path=$(jq -r '.ploidy_matrix' "${BASE_DIR}/single_sample_pipeline_outputs.json")
354+
mv "${ploidy_matrix_path}" "${BASE_DIR}/~{ploidy_matrix_filename}"
355+
356+
ploidy_plots_path=$(jq -r '.ploidy_plots' "${BASE_DIR}/single_sample_pipeline_outputs.json")
357+
mv "${ploidy_plots_path}" "${BASE_DIR}/~{ploidy_plots_filename}"
307358
359+
non_genotyped_path=$(jq -r '.non_genotyped_unique_depth_calls' "${BASE_DIR}/single_sample_pipeline_outputs.json")
360+
mv "${non_genotyped_path}" "${BASE_DIR}/~{non_genotyped_unique_depth_calls_filename}"
308361
>>>
309362

310363
output {
311-
File test = "single_sample_pipeline_inputs.json"
312-
File test2 = "single_sample_pipeline_outputs.json"
313-
# Map[String, String] manifest = read_json("pipeline_outputs_manifest.json")
314-
#
315-
File final_vcf = "final_vcf.vcf.gz"
316-
File final_vcf_idx = "final_vcf.vcf.gz.tbi"
317-
# File pre_cleanup_vcf = manifest["pre_cleanup_vcf"]
318-
# File stripy_json_output = manifest["stripy_json_output"]
319-
# File stripy_tsv_output = manifest["stripy_tsv_output"]
320-
# File stripy_html_output = manifest["stripy_html_output"]
321-
# File stripy_vcf_output = manifest["stripy_vcf_output"]
322-
# File metrics_file = manifest["metrics_file"]
323-
# File qc_file = manifest["qc_file"]
324-
# File ploidy_matrix = manifest["ploidy_matrix"]
325-
# File ploidy_plots = manifest["ploidy_plots"]
326-
# File non_genotyped_unique_depth_calls = manifest["non_genotyped_unique_depth_calls"]
364+
File inputs_json = "single_sample_pipeline_inputs.json"
365+
File outputs_json = "single_sample_pipeline_outputs.json"
366+
File final_vcf = final_vcf_filename
367+
File final_vcf_idx = final_vcf_idx_filename
368+
File pre_cleanup_vcf = pre_cleanup_vcf_filename
369+
File pre_cleanup_vcf_idx = pre_cleanup_vcf_idx_filename
370+
File stripy_json_output = stripy_json_filename
371+
File stripy_tsv_output = stripy_tsv_filename
372+
File stripy_html_output = stripy_html_filename
373+
File stripy_vcf_output = stripy_vcf_filename
374+
File metrics_file = metrics_filename
375+
File qc_file = qc_filename
376+
File ploidy_matrix = ploidy_matrix_filename
377+
File ploidy_plots = ploidy_plots_filename
378+
File non_genotyped_unique_depth_calls = non_genotyped_unique_depth_calls_filename
327379
}
328380

329381
RuntimeAttr default_attr = object {
@@ -332,7 +384,7 @@ task RunSVShell {
332384
disk_gb: 500,
333385
boot_disk_gb: 30,
334386
preemptible_tries: 0,
335-
max_retries: 1
387+
max_retries: 0
336388
}
337389
RuntimeAttr runtime_attr = select_first([runtime_attr_override, default_attr])
338390

0 commit comments

Comments
 (0)