-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Handling pairs correctly in input files
- Loading branch information
Showing
17 changed files
with
286 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
dxWDL { | ||
version = "1.09" | ||
version = "1.10" | ||
} | ||
|
||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{"echo_pairs.pairs_of_words": | ||
[ | ||
["hello", "world"], | ||
{"left" : "hello_again", "right" : "world_again"} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version 1.0 | ||
|
||
task echo_this_pair { | ||
input { | ||
String first_word | ||
String second_word | ||
} | ||
command <<< | ||
set -exo | ||
|
||
echo ~{first_word} >> output.txt | ||
echo ~{second_word} >> output.txt | ||
>>> | ||
runtime { | ||
docker: "debian:stretch-slim" | ||
} | ||
output { | ||
String echoed_words = read_string("output.txt") | ||
} | ||
} | ||
|
||
workflow echo_pairs { | ||
input { | ||
Array[Pair[String, String]] pairs_of_words | ||
} | ||
scatter (pair in pairs_of_words) { | ||
call echo_this_pair { | ||
input: | ||
first_word = pair.left, | ||
second_word = pair.right | ||
} | ||
} | ||
output { | ||
Array[String] all_echoed_words = echo_this_pair.echoed_words | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version 1.0 | ||
|
||
workflow override { | ||
call etl { input: a = 3 } | ||
output { | ||
Int result = etl.result | ||
} | ||
} | ||
|
||
task etl { | ||
input { | ||
Int a | ||
Int b = 10 | ||
Int? c | ||
} | ||
command {} | ||
output { | ||
Int result = a + b | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"override.etl.b" : 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
version 1.0 | ||
|
||
struct WordStruct { | ||
String word | ||
} | ||
|
||
task echo_xx { | ||
input { | ||
WordStruct input_word | ||
} | ||
command <<< | ||
echo ~{input_word.word} | ||
>>> | ||
runtime { | ||
docker: "debian:stretch-slim" | ||
} | ||
output { | ||
String out = read_string(stdout()) | ||
} | ||
} | ||
|
||
workflow array_of_structs { | ||
input { | ||
Array[WordStruct] words_to_say | ||
} | ||
scatter (input_word in words_to_say) { | ||
call echo_xx { | ||
input: | ||
input_word = input_word | ||
} | ||
} | ||
output { | ||
Array[String] out_words = echo_xx.out | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{"array_of_structs.words_to_say": [ | ||
{"word": "hello"}, | ||
{"word": "world"} | ||
]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version 1.0 | ||
|
||
task echo_this_pair { | ||
input { | ||
String first_word | ||
String second_word | ||
} | ||
command <<< | ||
set -exo | ||
|
||
echo ~{first_word} >> output.txt | ||
echo ~{second_word} >> output.txt | ||
>>> | ||
runtime { | ||
docker: "debian:stretch-slim" | ||
} | ||
output { | ||
String echoed_words = read_string("output.txt") | ||
} | ||
} | ||
|
||
workflow echo_pairs { | ||
input { | ||
Array[Pair[String, String]] pairs_of_words | ||
} | ||
scatter (pair in pairs_of_words) { | ||
call echo_this_pair { | ||
input: | ||
first_word = pair.left, | ||
second_word = pair.right | ||
} | ||
} | ||
output { | ||
Array[String] all_echoed_words = echo_this_pair.echoed_words | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{"echo_pairs.pairs_of_words": | ||
[ | ||
["hello", "world"], | ||
["hello_again", "world_again"] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"echo_pairs.all_echoed_words" : [ "hello\nworld", "hello_again\nworld_again"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
version 1.0 | ||
|
||
struct WordStruct { | ||
String word | ||
} | ||
|
||
task echo_xx { | ||
input { | ||
WordStruct input_word | ||
} | ||
command <<< | ||
echo ~{input_word.word} | ||
>>> | ||
runtime { | ||
docker: "debian:stretch-slim" | ||
} | ||
output { | ||
String out = read_string(stdout()) | ||
} | ||
} | ||
|
||
workflow array_structs { | ||
input { | ||
Array[WordStruct] words_to_say | ||
} | ||
scatter (input_word in words_to_say) { | ||
call echo_xx { | ||
input: | ||
input_word = input_word | ||
} | ||
} | ||
output { | ||
Array[String] out_words = echo_xx.out | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{"array_structs.words_to_say": [ | ||
{"word": "hello"}, | ||
{"word": "world"} | ||
]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"array_structs.out_words" : ["hello", "world"] | ||
} |