From 29a6ffe34b0d33854c493d64f2f3968f792bc880 Mon Sep 17 00:00:00 2001 From: Marvellous Onyenaucheya Date: Fri, 21 Oct 2022 20:46:35 +0100 Subject: [PATCH 1/2] Added pulling out a specific member of an array to FAQ --- src/faq.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/faq.md b/src/faq.md index fb50e9ad..673ab3ea 100644 --- a/src/faq.md +++ b/src/faq.md @@ -455,3 +455,30 @@ https://github.com/common-workflow-language/common-workflow-language/blob/master % - https://github.com/common-workflow-language/user_guide/issues/6 % - Maybe adapt some of these (or move to a workaround?) https://www.synapse.org/#!Synapse:syn2813589/wiki/401464 + +## Pulling out a specific member of an array + +```yaml +cwlVersion: v1.0 +class: Workflow + +inputs: [] + +steps: + generates_an_array: + run: array_of_files.cwl + in: {} + out: [ an_array_of_files ] + single_file_processor: + run: only_one_file_input_tool.cwl + in: + raw_file: # this is type: File + source: generates_an_array/an_array_of_files + valueFrom: $(self[0]) + out: [ result ] + +outputs: + result: + type: File + outputSource: single_file_processor/result +``` \ No newline at end of file From ac76d81e22ff0b0680c77d2e65722a07b541217c Mon Sep 17 00:00:00 2001 From: Marvellous Onyenaucheya Date: Sat, 22 Oct 2022 00:22:45 +0100 Subject: [PATCH 2/2] updated FAQs --- src/faq.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/faq.md b/src/faq.md index 673ab3ea..c7c94aa2 100644 --- a/src/faq.md +++ b/src/faq.md @@ -456,7 +456,9 @@ https://github.com/common-workflow-language/common-workflow-language/blob/master % - https://github.com/common-workflow-language/user_guide/issues/6 % - Maybe adapt some of these (or move to a workaround?) https://www.synapse.org/#!Synapse:syn2813589/wiki/401464 -## Pulling out a specific member of an array +## Pulling Out a Specific Member of an Array + +This example demonstrates how you can get a specific file in an array. This could be useful when you are taking files produced from another step in a workflow and need to capture a specific one. ```yaml cwlVersion: v1.0