To celebrate the release of GATK 4.0, we are giving away free credits for running the GATK4 Best Practices pipelines in FireCloud, our secure online analysis portal. It’s first come first serve, so sign up now to claim your free credits worth $250. Sponsored by Google Cloud. Learn more at https://software.broadinstitute.org/firecloud/documentation/freecredits

How do I specify a Boolean variable that is skipped by wdltool inputs?

shleeshlee CambridgeMember, Broadie, Moderator
edited January 17 in Ask the WDL team

I am attempting to use the M2 WDL script at https://github.com/broadinstitute/gatk/blob/master/scripts/mutect2_wdl/mutect2.wdl.

For the M2 task, in the variables list is Boolean? is_bamOut. This is referenced in the task as ${true='--bam-output bamout.bam' false='' is_bamOut} \. This effectively does not generate a bamout for the M2 run. However, I would like to generate a bamout.

When I generate the inputs file with java -jar wdltool inputs, is_bamOut is not one of the input variables. I am using wdltool-0.14.jar. Do I just freehand add Mutect2.is_bamOut to the inputs.json variables list?

I see from https://software.broadinstitute.org/wdl/documentation/spec#true-and-false that this Boolean type variable must be set either to true or false, which is slightly different than how I've been defining the other Boolean variables, e.g. "Mutect2.is_run_oncotator": "False". Does the capitalization matter?

Thanks.

Post edited by shlee on

Best Answer

  • shleeshlee CambridgeMember, Broadie, Moderator
    edited January 19 Accepted Answer

    In the end I changed the WDL script so the line reads:

    Boolean is_bamOut = true
    

    This allowed me to generate a reassembled BAM for the Mutect2 run.

Answers

  • shleeshlee CambridgeMember, Broadie, Moderator
    edited January 17

    Here are some additional pieces of the puzzle:

    It appears a false value is hardcoded into the script:

    Talking to folks, I'm told it may be possible to override this hardcoding in the json inputs. However, they said overriding was possible months ago but are unsure for Cromwell v30.1. From https://github.com/openwdl/wdl/issues/141, it appears overriding is not possible?

  • shleeshlee CambridgeMember, Broadie, Moderator
    edited January 19 Accepted Answer

    In the end I changed the WDL script so the line reads:

    Boolean is_bamOut = true
    

    This allowed me to generate a reassembled BAM for the Mutect2 run.

  • ChrisLChrisL Cambridge, MAMember, Broadie, Dev

    Yeah, I'm sorry that this is a bit of a mess in draft-2. I believe the current state of play is still as described in that ticket, but I'm hopeful that in WDL draft-3 we'll be able to make some changes which will allow us to distinguish between "an input I can override" vs "a declaration that I cannot override" so that authors get to choose what counts as an intermediate assignment that's vital to their control flow vs a value that's just got a default.

    Here's an example: in this draft-3 proposal to address input overriding, you'll be able to write:

    task x {
      input {
        Boolean is_bamOut = true
      }
      Boolean is_not_bamOut = !is_bamOut
      command {
        ...
      }
    }
    

    this will allow you to override the is_bamOut input, but the is_not_bamOut value is a non-overridable intermediate value.

    That's still in the proposal stage so feel free to comment, suggest amendments, etc against the PR

Sign In or Register to comment.