From c66bbbd4f9e7e56ca15d8644e506abc0d742c340 Mon Sep 17 00:00:00 2001 From: Samuel Lee Date: Fri, 15 Feb 2019 08:59:23 -0500 Subject: [PATCH] Cleaned up intermediate files in gCNV WDL. (#5382) --- scripts/cnv_wdl/cnv_common_tasks.wdl | 11 ++++++----- .../cnv_wdl/germline/cnv_germline_case_workflow.wdl | 9 ++++++--- .../cnv_wdl/germline/cnv_germline_cohort_workflow.wdl | 8 +++++--- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/scripts/cnv_wdl/cnv_common_tasks.wdl b/scripts/cnv_wdl/cnv_common_tasks.wdl index a46a0391981..1519ab112ce 100644 --- a/scripts/cnv_wdl/cnv_common_tasks.wdl +++ b/scripts/cnv_wdl/cnv_common_tasks.wdl @@ -405,21 +405,22 @@ task PostprocessGermlineCNVCalls { model_args="$model_args --model-shard-path MODEL_$index" done - mkdir extracted-contig-ploidy-calls - tar xzf ${contig_ploidy_calls_tar} -C extracted-contig-ploidy-calls + mkdir contig-ploidy-calls + tar xzf ${contig_ploidy_calls_tar} -C contig-ploidy-calls gatk --java-options "-Xmx${command_mem_mb}m" PostprocessGermlineCNVCalls \ $calls_args \ $model_args \ ${sep=" " allosomal_contigs_args} \ --autosomal-ref-copy-number ${ref_copy_number_autosomal_contigs} \ - --contig-ploidy-calls extracted-contig-ploidy-calls \ + --contig-ploidy-calls contig-ploidy-calls \ --sample-index ${sample_index} \ --output-genotyped-intervals ${genotyped_intervals_vcf_filename} \ --output-genotyped-segments ${genotyped_segments_vcf_filename} - rm -r CALLS_* - rm -r MODEL_* + rm -rf CALLS_* + rm -rf MODEL_* + rm -rf contig-ploidy-calls >>> runtime { diff --git a/scripts/cnv_wdl/germline/cnv_germline_case_workflow.wdl b/scripts/cnv_wdl/germline/cnv_germline_case_workflow.wdl index 11717fbfb4e..aa8d7242180 100644 --- a/scripts/cnv_wdl/germline/cnv_germline_case_workflow.wdl +++ b/scripts/cnv_wdl/germline/cnv_germline_case_workflow.wdl @@ -372,8 +372,8 @@ task GermlineCNVCallerCaseMode { export MKL_NUM_THREADS=${default=8 cpu} export OMP_NUM_THREADS=${default=8 cpu} - mkdir contig-ploidy-calls-dir - tar xzf ${contig_ploidy_calls_tar} -C contig-ploidy-calls-dir + mkdir contig-ploidy-calls + tar xzf ${contig_ploidy_calls_tar} -C contig-ploidy-calls mkdir gcnv-model tar xzf ${gcnv_model_tar} -C gcnv-model @@ -381,7 +381,7 @@ task GermlineCNVCallerCaseMode { gatk --java-options "-Xmx${command_mem_mb}m" GermlineCNVCaller \ --run-mode CASE \ --input ${sep=" --input " read_count_files} \ - --contig-ploidy-calls contig-ploidy-calls-dir \ + --contig-ploidy-calls contig-ploidy-calls \ --model gcnv-model \ --output ${output_dir_} \ --output-prefix case \ @@ -425,6 +425,9 @@ task GermlineCNVCallerCaseMode { tar czf case-gcnv-calls-shard-${scatter_index}-sample-$CURRENT_SAMPLE_WITH_LEADING_ZEROS.tar.gz -C ${output_dir_}/case-calls/SAMPLE_$CURRENT_SAMPLE . let CURRENT_SAMPLE=CURRENT_SAMPLE+1 done + + rm -rf contig-ploidy-calls + rm -rf gcnv-model >>> runtime { diff --git a/scripts/cnv_wdl/germline/cnv_germline_cohort_workflow.wdl b/scripts/cnv_wdl/germline/cnv_germline_cohort_workflow.wdl index bebb4999637..450eaa27ae5 100644 --- a/scripts/cnv_wdl/germline/cnv_germline_cohort_workflow.wdl +++ b/scripts/cnv_wdl/germline/cnv_germline_cohort_workflow.wdl @@ -487,14 +487,14 @@ task GermlineCNVCallerCohortMode { export MKL_NUM_THREADS=${default=8 cpu} export OMP_NUM_THREADS=${default=8 cpu} - mkdir contig-ploidy-calls-dir - tar xzf ${contig_ploidy_calls_tar} -C contig-ploidy-calls-dir + mkdir contig-ploidy-calls + tar xzf ${contig_ploidy_calls_tar} -C contig-ploidy-calls gatk --java-options "-Xmx${command_mem_mb}m" GermlineCNVCaller \ --run-mode COHORT \ -L ${intervals} \ --input ${sep=" --input " read_count_files} \ - --contig-ploidy-calls contig-ploidy-calls-dir \ + --contig-ploidy-calls contig-ploidy-calls \ ${"--annotated-intervals " + annotated_intervals} \ --interval-merging-rule OVERLAPPING_ONLY \ --output ${output_dir_} \ @@ -549,6 +549,8 @@ task GermlineCNVCallerCohortMode { tar czf ${cohort_entity_id}-gcnv-calls-shard-${scatter_index}-sample-$CURRENT_SAMPLE_WITH_LEADING_ZEROS.tar.gz -C ${output_dir_}/${cohort_entity_id}-calls/SAMPLE_$CURRENT_SAMPLE . let CURRENT_SAMPLE=CURRENT_SAMPLE+1 done + + rm -rf contig-ploidy-calls >>> runtime {