Heads up:
We’re moving the GATK website, docs and forum to a new platform. Read the full story and breakdown of key changes on this blog.
Update: July 26, 2019
This section of the forum is now closed; we are working on a new support model for WDL that we will share here shortly. For Cromwell-specific issues, see the Cromwell docs and post questions on Github.

Feature request: add optional inputs directly to the wdltool inputs json file.

Currently, wdltool puts (optional) in front of inputs that are optional. When I want to change one of those inputs, I usually end up looking up the default value in the wdl file, to make sure I don't put something crazy in there. So I was thinking, wouldn't it be better to have wdltool directly read the default value from the wdl file and insert it in the json file? That way, the user doesn't have to specify them or remove the unneeded optional lines. And if a user wants to modify one of the settings, they at least have an idea of what the sensible setting for that parameter is.

Example task

task hello {
    String user
    String? greeting

    command {
        echo "${default="Hello" greeting} ${user}"
    }
    output {
        String text= read_string(stdout())
    }
}

Current input

$ wdltool inputs main.wdl 
{
  "wf.user": "String",
  "wf.hello.greeting": "(optional) String?"
}

My suggestion

$ wdltool inputs main.wdl 
{
  "wf.user": "String",
  "wf.hello.greeting": "Hello"
}

There might be an issue when the task defines different default values for a variable, but that is probably such a weird thing to do that it could be forbidden without breaking anyone's actual workflows.

task hello {
    String user
    String? greeting

    command {
        echo "${default="Hello" greeting} ${user}"
        echo "${default="Howdie" greeting} ${user}"
    }
    output {
        String text= read_string(stdout())
    }
}

Best Answer

Answers

  • I agree that your suggestion is even better, that way all default values are clearly defined at the beginning of the task.

Sign In or Register to comment.