Optional parameters with defaults can not be overridden by inputs.json
See original GitHub issueSay I have a task called bwaMem
in a workflow called alignment
.
The task bwaMem looks as follows.
task bwaMem {
File in1
File? in2
String indexBase
Int? threads = 1
command {
bwa mem ${"-t" +threads} ${indexBase} ${in1} ${in2}
}
output {
File samFile = glob(*.sam)
}
runtime {
cpu = select_first([threads])
}
}
Then I can use the following inputs.json for the workflow alignment
:
{
"alignment.bwaMem.threads": 3
}
But this is ignored. The default value of 1 is used.
On the contrary, if I set defaults for the alignment
workflow itself. I can override these in the inputs.json. But apparently this does not work for imported tasks?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Parameters are not overridden in Input Steps when running a ...
Issue. The parameters in a flow file could not be applied to the Input steps when using the command line to override the...
Read more >Default parameters - JavaScript - MDN Web Docs
Default function parameters allow named parameters to be initialized with default values if no value or undefined is passed.
Read more >creating a function that deals with optional parameters
The purpose of the options specified are to give you default values. If you specify one of these, then the value you provide...
Read more >Understanding Default Parameters in JavaScript - DigitalOcean
In this case, the default parameter values were calculated, and an explicit undefined value did not override them.
Read more >Allow Task Group parameters to be optional
while explicitly marking the task group input parameter as optional is not supported, setting a default value and subsequently overriding the value is ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I agree that optional task inputs not being overridable from the inputs json is a bug and should be fixed.
Regarding defaults vs fixing values, you’re both right - values like that might be intended as inputs or might be intended as fixed intermediate values depending on the context and it’s really hard to deduce which one an author intended just based on the WDL file.
That kind of confusion is exactly why WDL 1.0 (you’re currently writing in draft-2) is adding
input
sections. Ie:vs
Closed as not an issue anymore in 1.0