Skip to content

Commit a0ed942

Browse files
committed
simplify example, show another workaround
1 parent 3dc0369 commit a0ed942

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

_extras/miscellaneous.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ outputs:
171171
outputSource: first/txt
172172
```
173173

174-
### There is a error, but only using Paramter Reference.
174+
### CWL Paramter Reference error due to hyphen in input identifier
175175

176-
`cwltool --validate` is return valid.
176+
If `cwltool --validate` returns valid
177177

178178
```console
179179
$ cwltool --validate cwl/qiime.cwl
@@ -182,42 +182,30 @@ INFO Resolved 'cwl/qiime.cwl' to 'file:///workspace/cwl/qiime.cwl'
182182
cwl/qiime.cwl is valid CWL.
183183
```
184184

185-
But execute it causes error.
185+
But executing it causes an error like:
186186

187-
```
188-
cwltool cwl/qiime.cwl --sample-input metadata.tsv
187+
```console
188+
$ cwltool cwl/qiime.cwl --sample-input metadata.tsv
189189
INFO /usr/local/bin/cwltool 1.0.20190831161204
190190
INFO Resolved 'cwl/qiime.cwl' to 'file:///workspace/cwl/qiime.cwl'
191191
ERROR Workflow error, try again with --debug for more information:
192192
cwl/qiime.cwl:14:5: Expression evaluation error:
193193
Syntax error in parameter reference '(inputs.sample-input)'. This could be due
194194
to using Javascript code without specifying InlineJavascriptRequirement.
195-
$
196195
```
197196

198197
The file is here
199198

200199
```cwl
201200
cwlVersion: v1.0
202201
class: CommandLineTool
203-
hints:
204-
DockerRequirement:
205-
dockerPull: qiime2/core:2019.7
206202
baseCommand: [qiime, metadata, tabulate]
207203
arguments:
208204
- prefix: --m-input-file
209205
valueFrom: $(inputs.sample-input)
210-
- prefix: --o-visualization
211-
valueFrom: metadata.qzv
212206
inputs:
213-
# for metadata.tsv
214207
sample-input: File
215-
outputs:
216-
# metadata.qzv
217-
visualization:
218-
type: File
219-
outputBinding:
220-
glob: metadata.qzv
208+
outputs: []
221209
```
222210

223211
Problem caused by `-` (hyphen charcter).
@@ -233,7 +221,7 @@ inputs:
233221
```
234222

235223

236-
Fix this error is change `-` (hyphen) to `_` (under score)
224+
Fix this error is change `-` (hyphen) to `_` (underscore)
237225

238226
```cwl
239227
valueFrom: $(inputs.sample_input)
@@ -245,3 +233,9 @@ inputs:
245233
sample_input: File
246234
# ^ changed here
247235
```
236+
237+
If is not possible to change the input identifier, then you can use an alternative CWL Parameter Reference syntax:
238+
239+
```cwl
240+
valueFrom: $(inputs["sample-input"])
241+
```

0 commit comments

Comments
 (0)