Skip to content

Commit

Permalink
Adjusting nested map task
Browse files Browse the repository at this point in the history
  • Loading branch information
tefirman committed Dec 20, 2024
1 parent 0bf307c commit 7e789cf
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions mapTypeTest/mapTypeTest.wdl
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
version 1.0
## This workflow demonstrates the usage of map types in WDL
## by processing sample read length data as an example.
#### WORKFLOW DEFINITION

workflow enhanced_map_test {
input {
Expand Down Expand Up @@ -97,12 +93,15 @@ task process_nested_map {
String patient_id
Map[String, String] patient_data
Array[String] samples_for_patient
String sample_type = patient_data[samples_for_patient[0]]
}

command <<<
echo "Processing patient ~{patient_id}"
~{sep='\n' select_all(prefix('echo "Sample: ', samples_for_patient))} Type: ~{patient_data[samples_for_patient[0]]}
>>>
command {
echo "Processing patient ${patient_id} with sample type ${sample_type}"
for sample in ${sep=' ' samples_for_patient}; do
echo "Sample: $sample"
done
}

output {
String message = read_string(stdout())
Expand Down

0 comments on commit 7e789cf

Please sign in to comment.