Skip to content

Commit 4c0d89f

Browse files
Eliminate Array[File?] workflow outputs not supported by Terra (#222)
1 parent b5e954c commit 4c0d89f

File tree

7 files changed

+42
-28
lines changed

7 files changed

+42
-28
lines changed

input_templates/terra_workspaces/cohort_mode/workflow_configurations/FilterBatchSamples.json.tmpl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"FilterBatchSamples.N_IQR_cutoff": "10000",
77

88
"FilterBatchSamples.batch": "${this.sample_set_id}",
9-
"FilterBatchSamples.vcfs" : "${this.sites_filtered_vcfs}",
10-
"FilterBatchSamples.sv_counts": "${this.sv_counts}"
9+
"FilterBatchSamples.manta_vcf" : "${this.sites_filtered_manta_vcf}",
10+
"FilterBatchSamples.delly_vcf" : "${this.sites_filtered_delly_vcf}",
11+
"FilterBatchSamples.wham_vcf" : "${this.sites_filtered_wham_vcf}",
12+
"FilterBatchSamples.melt_vcf" : "${this.sites_filtered_melt_vcf}",
13+
"FilterBatchSamples.depth_vcf" : "${this.sites_filtered_depth_vcf}"
1114
}

input_templates/terra_workspaces/cohort_mode/workflow_configurations/PlotSVCountsPerSample.json.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"PlotSVCountsPerSample.N_IQR_cutoff": "6",
55

66
"PlotSVCountsPerSample.prefix": "${this.sample_set_id}",
7-
"PlotSVCountsPerSample.vcfs" : "${this.sites_filtered_vcfs}",
7+
"PlotSVCountsPerSample.vcfs" : "${[this.sites_filtered_manta_vcf, this.sites_filtered_delly_vcf, this.sites_filtered_wham_vcf, this.sites_filtered_melt_vcf, this.sites_filtered_depth_vcf]}",
88
"PlotSVCountsPerSample.vcf_identifiers" : "${this.algorithms_filtersites}"
99
}

test_input_templates/FilterBatch/FilterBatchSamples.json.tmpl

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,12 @@
77
"FilterBatchSamples.outlier_cutoff_table" : {{ test_batch.outlier_cutoff_table | tojson }},
88

99
"FilterBatchSamples.batch": {{ test_batch.batch_name | tojson }},
10-
"FilterBatchSamples.vcfs" : [
11-
{{ test_batch.sites_filtered_manta_vcf | tojson }},
12-
null,
13-
{{ test_batch.sites_filtered_wham_vcf | tojson }},
14-
{{ test_batch.sites_filtered_melt_vcf | tojson }},
15-
{{ test_batch.sites_filtered_depth_vcf | tojson }}
16-
],
17-
"FilterBatchSamples.sv_counts": [
18-
{{ test_batch.sites_filtered_svcounts_manta | tojson }},
19-
null,
20-
{{ test_batch.sites_filtered_svcounts_wham | tojson }},
21-
{{ test_batch.sites_filtered_svcounts_melt | tojson }},
22-
{{ test_batch.sites_filtered_svcounts_depth | tojson }}
23-
]
10+
"FilterBatchSamples.manta_vcf": {{ test_batch.sites_filtered_manta_vcf | tojson }},
11+
"FilterBatchSamples.wham_vcf": {{ test_batch.sites_filtered_wham_vcf | tojson }},
12+
"FilterBatchSamples.melt_vcf": {{ test_batch.sites_filtered_melt_vcf | tojson }},
13+
"FilterBatchSamples.depth_vcf": {{ test_batch.sites_filtered_depth_vcf | tojson }},
14+
"FilterBatchSamples.manta_counts": {{ test_batch.sites_filtered_svcounts_manta | tojson }},
15+
"FilterBatchSamples.wham_counts": {{ test_batch.sites_filtered_svcounts_wham | tojson }},
16+
"FilterBatchSamples.melt_counts": {{ test_batch.sites_filtered_svcounts_melt | tojson }},
17+
"FilterBatchSamples.depth_counts": {{ test_batch.sites_filtered_svcounts_depth | tojson }}
2418
}

wdl/FilterBatch.wdl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ workflow FilterBatch {
6868
call sv_counts.PlotSVCountsPerSample {
6969
input:
7070
prefix = batch,
71-
vcfs = FilterBatchSites.sites_filtered_vcfs,
71+
vcfs = [FilterBatchSites.sites_filtered_manta_vcf, FilterBatchSites.sites_filtered_delly_vcf, FilterBatchSites.sites_filtered_wham_vcf, FilterBatchSites.sites_filtered_melt_vcf, FilterBatchSites.sites_filtered_depth_vcf],
7272
vcf_identifiers = FilterBatchSites.algorithms_filtersites,
7373
N_IQR_cutoff = outlier_cutoff_nIQR,
7474
sv_pipeline_docker = sv_pipeline_docker,
@@ -82,8 +82,11 @@ workflow FilterBatch {
8282
batch = batch,
8383
outlier_cutoff_table = outlier_cutoff_table,
8484
N_IQR_cutoff = outlier_cutoff_nIQR,
85-
vcfs = FilterBatchSites.sites_filtered_vcfs,
86-
sv_counts = PlotSVCountsPerSample.sv_counts,
85+
manta_vcf = FilterBatchSites.sites_filtered_manta_vcf,
86+
delly_vcf = FilterBatchSites.sites_filtered_delly_vcf,
87+
wham_vcf = FilterBatchSites.sites_filtered_wham_vcf,
88+
melt_vcf = FilterBatchSites.sites_filtered_melt_vcf,
89+
depth_vcf = FilterBatchSites.sites_filtered_depth_vcf,
8790
linux_docker = linux_docker,
8891
sv_pipeline_docker = sv_pipeline_docker,
8992
sv_base_mini_docker = sv_base_mini_docker,
@@ -133,8 +136,8 @@ workflow FilterBatch {
133136
File cutoffs = FilterBatchSites.cutoffs
134137
File scores = FilterBatchSites.scores
135138
File RF_intermediate_files = FilterBatchSites.RF_intermediate_files
136-
Array[File?] sv_counts = PlotSVCountsPerSample.sv_counts
137-
Array[File?] sv_count_plots = PlotSVCountsPerSample.sv_count_plots
139+
Array[File] sv_counts = PlotSVCountsPerSample.sv_counts
140+
Array[File] sv_count_plots = PlotSVCountsPerSample.sv_count_plots
138141
Array[String] outlier_samples_excluded = FilterBatchSamples.outlier_samples_excluded
139142
Array[String] batch_samples_postOutlierExclusion = FilterBatchSamples.filtered_batch_samples_list
140143
File outlier_samples_excluded_file = FilterBatchSamples.outlier_samples_excluded_file

wdl/FilterBatchSamples.wdl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,16 @@ import "IdentifyOutlierSamples.wdl" as identify_outliers
99
workflow FilterBatchSamples {
1010
input {
1111
String batch
12-
Array[File?] vcfs # in order of algorithms array: ["manta", "delly", "wham", "melt", "depth"]. To skip one, use null keyword - ex. ["manta.vcf.gz", null, "wham.vcf.gz", null, "depth.vcf.gz"]
13-
Array[File?] sv_counts # one SV counts file from PlotSVCountsPerSample per VCF in the same order
12+
File? manta_vcf
13+
File? delly_vcf
14+
File? wham_vcf
15+
File? melt_vcf
16+
File? depth_vcf
17+
File? manta_counts # SV counts files from PlotSVCountsPerSample. If not provided, SV counts will be calculated as part of this workflow
18+
File? delly_counts
19+
File? wham_counts
20+
File? melt_counts
21+
File? depth_counts
1422
Int N_IQR_cutoff
1523
File? outlier_cutoff_table
1624
String sv_pipeline_docker
@@ -25,16 +33,18 @@ workflow FilterBatchSamples {
2533
RuntimeAttr? runtime_attr_merge_pesr_vcfs
2634
}
2735

36+
Array[File?] vcfs = [manta_vcf, delly_vcf, wham_vcf, melt_vcf, depth_vcf]
2837
Array[String] algorithms = ["manta", "delly", "wham", "melt", "depth"] # fixed algorithms to enable File outputs to be determined
2938
Int num_algorithms = length(algorithms)
39+
Array[File?] sv_counts_ = [manta_counts, delly_counts, wham_counts, melt_counts, depth_counts]
3040

3141
scatter (i in range(num_algorithms)) {
3242
if (defined(vcfs[i])) {
3343
call identify_outliers.IdentifyOutlierSamples {
3444
input:
3545
vcf = select_first([vcfs[i]]),
3646
name = batch,
37-
sv_counts = sv_counts[i],
47+
sv_counts = sv_counts_[i],
3848
N_IQR_cutoff = N_IQR_cutoff,
3949
outlier_cutoff_table = outlier_cutoff_table,
4050
vcf_identifier = algorithms[i],

wdl/FilterBatchSites.wdl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ workflow FilterBatchSites {
5959
}
6060
6161
output {
62-
Array[File?] sites_filtered_vcfs = FilterAnnotateVcf.annotated_vcf
62+
File? sites_filtered_manta_vcf = FilterAnnotateVcf.annotated_vcf[0]
63+
File? sites_filtered_delly_vcf = FilterAnnotateVcf.annotated_vcf[1]
64+
File? sites_filtered_wham_vcf = FilterAnnotateVcf.annotated_vcf[2]
65+
File? sites_filtered_melt_vcf = FilterAnnotateVcf.annotated_vcf[3]
66+
File? sites_filtered_depth_vcf = FilterAnnotateVcf.annotated_vcf[4]
6367
File cutoffs = AdjudicateSV.cutoffs
6468
File scores = RewriteScores.updated_scores
6569
File RF_intermediate_files = AdjudicateSV.RF_intermediate_files

wdl/PlotSVCountsPerSample.wdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ workflow PlotSVCountsPerSample {
4949
5050
5151
output {
52-
Array[File?] sv_counts = CountSVsPerSamplePerType.sv_counts
53-
Array[File?] sv_count_plots = PlotSVCountsWithCutoff.svcount_distrib_plots
52+
Array[File] sv_counts = select_all(CountSVsPerSamplePerType.sv_counts)
53+
Array[File] sv_count_plots = select_all(PlotSVCountsWithCutoff.svcount_distrib_plots)
5454
File outlier_samples_preview = CatOutliersPreview.outliers_preview_file
5555
}
5656
}

0 commit comments

Comments
 (0)