Skip to content

Commit 3651466

Browse files
committed
fix optional input handling
1 parent 7584509 commit 3651466

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

pipelines/wdl/glimpse/low_pass_imputation/input_qc/LowPassImputationQC.wdl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ workflow InputQC {
2020
File fasta_index
2121
File ref_dict
2222

23-
String billing_project_for_rp?
23+
String? billing_project_for_rp
2424
}
2525

2626
# validate that either crams, or cram manifest is provided
@@ -48,8 +48,8 @@ workflow InputQC {
4848
# validations for array crams input
4949
if (do_cram_qc) {
5050
Array[String] cram_array = select_first([crams, ConvertCramManifestToCramArrays.crams])
51-
Array[String] cram_index_array = select_first([cram_indices, ConvertCramManifestToCramArrays.cram_indices, []])
52-
Array[String] sample_id_array = select_first([sample_ids, ConvertCramManifestToCramArrays.sample_ids, []])
51+
Array[String]? cram_index_array = select_first([cram_indices, ConvertCramManifestToCramArrays.cram_indices])
52+
Array[String]? sample_id_array = select_first([sample_ids, ConvertCramManifestToCramArrays.sample_ids])
5353

5454
if (!defined(cram_index_array) || !defined(sample_id_array)) {
5555
Boolean no_cram_index_or_sample_id_passes_qc = false
@@ -59,8 +59,8 @@ workflow InputQC {
5959
call ValidateCramsAndIndices {
6060
input:
6161
crams = cram_array,
62-
cram_indices = cram_index_array,
63-
sample_ids = sample_id_array,
62+
cram_indices = select_first([cram_index_array]),
63+
sample_ids = select_first([sample_id_array]),
6464
billing_project_for_rp = billing_project_for_rp
6565
}
6666
}
@@ -142,7 +142,7 @@ task ValidateCramsAndIndices {
142142
Array[String] sample_ids
143143

144144
Int max_cram_file_size_gb = 10
145-
String billing_project_for_rp? # if set, will use this to check file sizes for requester pays buckets. if not set, will not be able to check file sizes for requester pays buckets and will assume all files are below the max file size
145+
String? billing_project_for_rp # if set, will use this to check file sizes for requester pays buckets. if not set, will not be able to check file sizes for requester pays buckets and will assume all files are below the max file size
146146
147147
String gatk_docker = "us.gcr.io/broad-gatk/gatk:4.6.1.0"
148148
Int cpu = 1

verification/test-wdls/TestLowPassImputationQC.wdl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ workflow TestLowPassImputationQC {
1717
Array[String]? sample_ids
1818
File? cram_manifest
1919

20+
String? billing_project_for_rp
21+
2022
File fasta
2123
File fasta_index
2224
String output_basename
@@ -44,7 +46,8 @@ workflow TestLowPassImputationQC {
4446
fasta = fasta,
4547
fasta_index = fasta_index,
4648
output_basename = output_basename,
47-
ref_dict = ref_dict
49+
ref_dict = ref_dict,
50+
billing_project_for_rp = billing_project_for_rp
4851
}
4952
5053
# Write pipeline outputs into json file so we can compare to truth

0 commit comments

Comments
 (0)