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

Set workflow level default value for required task input

I have a task that is shared between several workflows, and each workflow passes a different file to the task. I want to make that file an optional input of the workflow, and just pass the default value when the user doesn't specify the optional file.

Is there a way to do this in WDL currently? I now have something like this, and while the wdl validates, when I run it it crashes saying Variable 'gene_db' not found wdl4s.wdl.exception.VariableNotFoundException$$anon$1: Variable 'gene_db' not found

workflow ecoliserotype {                                                                               
    File inputFastqFile                                                                                
    Int nrCores                                                                                        
    File? ecoliDB

    String name                                                                                        

    Array[Array[File]] inputFastq = read_tsv(inputFastqFile)                                           

    call shared.docker as docker                                                                       

    scatter (sample in inputFastq) {                                                         
        call shared.srst2 as srst2 {                                                                   
            input:  forward = trimmomatic.forward_trimmed,                                             
                    reverse = trimmomatic.reverse_trimmed,                                             
                    gene_db = "${default=/path ecoliDB}",                                              
                    nrCores = nrCores,                                                                 
                    name    = name,
                    image   = docker.srst2
        }                                                                                              
    } 

Best Answer

Answers

Sign In or Register to comment.