From cad5d46a282ad769c544a1f735f5f9d339b7c17a Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 5 Oct 2021 15:55:36 -0400 Subject: [PATCH 1/3] Adjust behavior of command_input_file_expression Changes it to reference another input parameter instead of using self. The behavior of processing secondary files patterns in order and being able to reference earlier ones later is not part of the spec. This doesn't exactly replicate the previous behavior, because it introduces a new input parameter, however it does demonstrate the ability to rename a file and have it staged as a secondary file without having to use InitialWorkDir. refs #127 --- tests/secondaryfiles/rename-inputs.cwl | 6 ++++-- tests/secondaryfiles/rename-inputs.yml | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/secondaryfiles/rename-inputs.cwl b/tests/secondaryfiles/rename-inputs.cwl index bffc0311..9a76dd75 100644 --- a/tests/secondaryfiles/rename-inputs.cwl +++ b/tests/secondaryfiles/rename-inputs.cwl @@ -24,7 +24,6 @@ inputs: touch secondary_file_test.txt.accessory ``` secondaryFiles: - - .accessory - | ${ function resolveSecondary(base, secPattern) { @@ -37,10 +36,13 @@ inputs: } return [{ "class": "File", - "location": self.secondaryFiles[0].location, + "location": inputs.accessory.location, "basename": resolveSecondary(self.basename, '^.accessory') }]; } +- id: accessory + type: File + arguments: - valueFrom: "|" diff --git a/tests/secondaryfiles/rename-inputs.yml b/tests/secondaryfiles/rename-inputs.yml index de72eec9..90393b72 100644 --- a/tests/secondaryfiles/rename-inputs.yml +++ b/tests/secondaryfiles/rename-inputs.yml @@ -1,3 +1,6 @@ inputWithSecondary: class: File location: secondary_file_test.txt +accessory: + class: File + location: secondary_file_test.txt.accessory From 585babf26ab2cd96888a7f2acab574217f488ae8 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 5 Oct 2021 16:03:25 -0400 Subject: [PATCH 2/3] Remove InitialWorkDir requirement --- tests/secondaryfiles/rename-inputs.cwl | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/secondaryfiles/rename-inputs.cwl b/tests/secondaryfiles/rename-inputs.cwl index 9a76dd75..484c3f58 100644 --- a/tests/secondaryfiles/rename-inputs.cwl +++ b/tests/secondaryfiles/rename-inputs.cwl @@ -1,7 +1,5 @@ #!/usr/bin/env cwl-runner id: InputSecondaryFileConformanceTest -baseCommand: -- ls class: CommandLineTool cwlVersion: v1.2 doc: | @@ -45,13 +43,12 @@ inputs: arguments: +- "ls" +- $(inputs.inputWithSecondary.dirname) - valueFrom: "|" shellQuote: false - position: 0 -- valueFrom: "grep" - position: 1 -- valueFrom: "secondary" - position: 2 +- "grep" +- "secondary" outputs: - id: output_file @@ -60,6 +57,3 @@ stdout: result requirements: InlineJavascriptRequirement: {} ShellCommandRequirement: {} - InitialWorkDirRequirement: - listing: - - $(inputs.inputWithSecondary) From bbd478cb5b7fb548cba715cb28a313bdc2eca549 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" <1330696+mr-c@users.noreply.github.com> Date: Wed, 6 Oct 2021 11:33:24 +0200 Subject: [PATCH 3/3] command_input_file_expression uses ShellCommandRequirement --- tests/secondaryfiles/test-index.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/secondaryfiles/test-index.yaml b/tests/secondaryfiles/test-index.yaml index 79fae852..6ecec1d6 100644 --- a/tests/secondaryfiles/test-index.yaml +++ b/tests/secondaryfiles/test-index.yaml @@ -8,7 +8,7 @@ checksum: sha1$901c3d387a263c57eaed6f24a82517c1fb0e198d size: 54 location: result - tags: [ inline_javascript, secondary_files, command_line_tool ] + tags: [ inline_javascript, secondary_files, command_line_tool, shell_command ] - tool: rename-outputs.cwl doc: Confirm CommandOutputParameter expression can receive a File object