@@ -304,12 +304,18 @@ workflow CNVGermlineCohortWorkflow {
304
304
}
305
305
}
306
306
307
+ Array [Array [File ]] call_tars_sample_by_shard = transpose (GermlineCNVCallerCohortMode .gcnv_call_tars )
308
+
307
309
scatter (sample_index in range (length (CollectCounts .entity_id ))) {
308
310
call CNVTasks .PostprocessGermlineCNVCalls {
309
311
input :
310
312
entity_id = CollectCounts .entity_id [sample_index ],
311
- gcnv_calls_tars = GermlineCNVCallerCohortMode . gcnv_calls_tar ,
313
+ gcnv_calls_tars = call_tars_sample_by_shard [ sample_index ] ,
312
314
gcnv_model_tars = GermlineCNVCallerCohortMode .gcnv_model_tar ,
315
+ calling_configs = GermlineCNVCallerCohortMode .calling_config_json ,
316
+ denoising_configs = GermlineCNVCallerCohortMode .denoising_config_json ,
317
+ gcnvkernel_version = GermlineCNVCallerCohortMode .gcnvkernel_version_json ,
318
+ sharded_interval_lists = GermlineCNVCallerCohortMode .sharded_interval_list ,
313
319
contig_ploidy_calls_tar = DetermineGermlineContigPloidyCohortMode .contig_ploidy_calls_tar ,
314
320
allosomal_contigs = allosomal_contigs ,
315
321
ref_copy_number_autosomal_contigs = ref_copy_number_autosomal_contigs ,
@@ -329,7 +335,7 @@ workflow CNVGermlineCohortWorkflow {
329
335
File contig_ploidy_model_tar = DetermineGermlineContigPloidyCohortMode .contig_ploidy_model_tar
330
336
File contig_ploidy_calls_tar = DetermineGermlineContigPloidyCohortMode .contig_ploidy_calls_tar
331
337
Array [File ] gcnv_model_tars = GermlineCNVCallerCohortMode .gcnv_model_tar
332
- Array [File ] gcnv_calls_tars = GermlineCNVCallerCohortMode .gcnv_calls_tar
338
+ Array [Array [ File ]] gcnv_calls_tars = GermlineCNVCallerCohortMode .gcnv_call_tars
333
339
Array [File ] gcnv_tracking_tars = GermlineCNVCallerCohortMode .gcnv_tracking_tar
334
340
Array [File ] genotyped_intervals_vcfs = PostprocessGermlineCNVCalls .genotyped_intervals_vcf
335
341
Array [File ] genotyped_segments_vcfs = PostprocessGermlineCNVCalls .genotyped_segments_vcf
@@ -470,6 +476,9 @@ task GermlineCNVCallerCohortMode {
470
476
471
477
# If optional output_dir not specified, use "out"
472
478
String output_dir_ = select_first ([output_dir , "out" ])
479
+ Int num_samples = length (read_count_files )
480
+
481
+ String dollar = "$" #WDL workaround, see https://github.com/broadinstitute/cromwell/issues/1819
473
482
474
483
command <<<
475
484
set -e
@@ -529,9 +538,17 @@ task GermlineCNVCallerCohortMode {
529
538
--caller-external-admixing-rate ${default=" 1.00" caller_external_admixing_rate} \
530
539
--disable-annealing ${default=" false" disable_annealing}
531
540
532
- tar czf ${cohort_entity_id} -gcnv-model-${scatter_index} .tar.gz -C ${output_dir_} /${cohort_entity_id} -model .
533
- tar czf ${cohort_entity_id} -gcnv-calls-${scatter_index} .tar.gz -C ${output_dir_} /${cohort_entity_id} -calls .
534
- tar czf ${cohort_entity_id} -gcnv-tracking-${scatter_index} .tar.gz -C ${output_dir_} /${cohort_entity_id} -tracking .
541
+ tar czf ${cohort_entity_id} -gcnv-model-shard-${scatter_index} .tar.gz -C ${output_dir_} /${cohort_entity_id} -model .
542
+ tar czf ${cohort_entity_id} -gcnv-tracking-shard-${scatter_index} .tar.gz -C ${output_dir_} /${cohort_entity_id} -tracking .
543
+
544
+ CURRENT_SAMPLE=0
545
+ NUM_SAMPLES=${num_samples}
546
+ NUM_DIGITS=${dollar} {# NUM_SAMPLES}
547
+ while [ $CURRENT_SAMPLE -lt $NUM_SAMPLES ]; do
548
+ CURRENT_SAMPLE_WITH_LEADING_ZEROS=$( printf " %0${dollar} {NUM_DIGITS}d" $CURRENT_SAMPLE )
549
+ 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 .
550
+ let CURRENT_SAMPLE=CURRENT_SAMPLE+1
551
+ done
535
552
>>>
536
553
537
554
runtime {
@@ -543,9 +560,9 @@ task GermlineCNVCallerCohortMode {
543
560
}
544
561
545
562
output {
546
- File gcnv_model_tar = "${cohort_entity_id} -gcnv-model-${scatter_index} .tar.gz"
547
- File gcnv_calls_tar = "${cohort_entity_id} -gcnv-calls-${scatter_index} .tar.gz"
548
- File gcnv_tracking_tar = "${cohort_entity_id} -gcnv-tracking-${scatter_index} .tar.gz"
563
+ File gcnv_model_tar = "${cohort_entity_id} -gcnv-model-shard- ${scatter_index} .tar.gz"
564
+ Array [ File ] gcnv_call_tars = glob ( "${cohort_entity_id} -gcnv-calls-shard- ${scatter_index} -sample-* .tar.gz" )
565
+ File gcnv_tracking_tar = "${cohort_entity_id} -gcnv-tracking-shard- ${scatter_index} .tar.gz"
549
566
File calling_config_json = "${output_dir_} /${cohort_entity_id} -calls/calling_config.json"
550
567
File denoising_config_json = "${output_dir_} /${cohort_entity_id} -calls/denoising_config.json"
551
568
File gcnvkernel_version_json = "${output_dir_} /${cohort_entity_id} -calls/gcnvkernel_version.json"
0 commit comments